Преглед изворни кода

For incomplete credentials (where proving the validity is optional) it's possible that P can be arbitrarily chosen by the client, and so it is not cind.

Thanks to Lloyd Fournier of Frostsnap for the report.
Ian Goldberg пре 5 дана
родитељ
комит
30971c8ba9
1 измењених фајлова са 8 додато и 1 уклоњено
  1. 8 1
      cmz-core/src/lib.rs

+ 8 - 1
cmz-core/src/lib.rs

@@ -1138,7 +1138,14 @@ pub fn cmz_core(
         request_fields.push_point(&P_cred);
         request_fields.push_point(&CQ_cred);
         cli_proof_rand_scalars.push(zQ_cred.clone());
-        cli_proof_cind_points.push(P_cred.clone());
+        // For incomplete credentials (where proving the validity is
+        // optional) it's possible that P can be arbitrarily chosen by
+        // the client, and so it is not cind.
+        if show_cred.valid_optional {
+            cli_proof_pub_points.push(P_cred.clone());
+        } else {
+            cli_proof_cind_points.push(P_cred.clone());
+        }
         cli_proof_pub_points.push(V_cred.clone());
 
         // The ZKP statement that proves the format of V