From 9d18f7846d6c408c6b216fd45728bb3f1de5825c Mon Sep 17 00:00:00 2001 From: Vincent Bernardoff Date: Wed, 13 Jun 2018 09:28:40 +0200 Subject: [PATCH] Crypto: disable P256 signing --- src/bin_client/test/test_basic.sh | 8 ++++---- vendors/ocaml-uecc/src/uecc.ml | 30 ++++++++++++++++-------------- vendors/ocaml-uecc/test/test.ml | 2 +- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/bin_client/test/test_basic.sh b/src/bin_client/test/test_basic.sh index af63064a8..58978dd22 100755 --- a/src/bin_client/test/test_basic.sh +++ b/src/bin_client/test/test_basic.sh @@ -28,12 +28,12 @@ key2=bar key3=boo key4=king key5=queen -key6=p256 +# key6=p256 $client gen keys $key1 $client gen keys $key2 --sig secp256k1 $client gen keys $key3 --sig ed25519 -$client gen keys $key6 --sig p256 +# $client gen keys $key6 --sig p256 $client list known identities $client get balance for bootstrap1 @@ -41,12 +41,12 @@ $client get balance for bootstrap1 bake_after $client transfer 1,000 from bootstrap1 to $key1 bake_after $client transfer 2,000 from bootstrap1 to $key2 bake_after $client transfer 3,000 from bootstrap1 to $key3 -bake_after $client transfer 4,000 from bootstrap1 to $key6 +# bake_after $client transfer 4,000 from bootstrap1 to $key6 $client get balance for $key1 | assert "1,000 ꜩ" $client get balance for $key2 | assert "2,000 ꜩ" $client get balance for $key3 | assert "3,000 ꜩ" -$client get balance for $key6 | assert "4,000 ꜩ" +# $client get balance for $key6 | assert "4,000 ꜩ" bake_after $client transfer 1,000 from $key2 to $key1 -fee 0 $client get balance for $key1 | assert "2,000 ꜩ" diff --git a/vendors/ocaml-uecc/src/uecc.ml b/vendors/ocaml-uecc/src/uecc.ml index 7ada97dff..0a6fbe0fb 100644 --- a/vendors/ocaml-uecc/src/uecc.ml +++ b/vendors/ocaml-uecc/src/uecc.ml @@ -206,26 +206,28 @@ let dh (Sk (sk, c)) (Pk (pk, _)) = | true -> Some secret | false -> None -external sign : - Bigstring.t -> Bigstring.t -> Bigstring.t -> curve -> bool = - "uECC_sign_stub" [@@noalloc] +(* external sign : + * Bigstring.t -> Bigstring.t -> Bigstring.t -> curve -> bool = + * "uECC_sign_stub" [@@noalloc] *) external verify : Bigstring.t -> Bigstring.t -> Bigstring.t -> curve -> bool = "uECC_verify_stub" [@@noalloc] -let write_sign (Sk (sk, c)) buf ~msg = - if Bigstring.length buf < pk_size c then 0 - else - match sign sk msg buf (to_curve c) with - | true -> pk_size c - | false -> 0 +let write_sign (Sk (_sk, _c)) _buf ~msg:_ = + failwith "Not implemented" + (* if Bigstring.length buf < pk_size c then 0 + * else + * match sign sk msg buf (to_curve c) with + * | true -> pk_size c + * | false -> 0 *) -let sign (Sk (sk, c)) msg = - let signature = Bigstring.create (pk_size c) in - match sign sk msg signature (to_curve c) with - | true -> Some signature - | false -> None +let sign (Sk (_sk, _c)) _msg = + failwith "Not implemented" + (* let signature = Bigstring.create (pk_size c) in + * match sign sk msg signature (to_curve c) with + * | true -> Some signature + * | false -> None *) let verify (Pk (pk, c)) ~msg ~signature = if Bigstring.length signature <> pk_size c then false diff --git a/vendors/ocaml-uecc/test/test.ml b/vendors/ocaml-uecc/test/test.ml index 73173653a..a318a9247 100644 --- a/vendors/ocaml-uecc/test/test.ml +++ b/vendors/ocaml-uecc/test/test.ml @@ -164,7 +164,7 @@ let basic = [ "export_compressed", `Quick, test_export_compressed ; "keypair", `Quick, test_keypair ; "dh", `Quick, test_dh ; - "sign", `Quick, test_sign ; + (* "sign", `Quick, test_sign ; *) ] let () =