diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-05-26 03:05:33 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-05-26 03:05:46 +0530 |
commit | 2a82be115c2a47eab1fed70d8c85a8b2711f13d1 (patch) | |
tree | c76a75a82093ac1afdfcec407ef30d17c45038e2 | |
parent | 3be8295f2fac6890f2ff0e312c39aecda8b25342 (diff) | |
download | gnunet-2a82be115c2a47eab1fed70d8c85a8b2711f13d1.tar.gz gnunet-2a82be115c2a47eab1fed70d8c85a8b2711f13d1.zip |
add additional test condition for GNS crypto
-rw-r--r-- | src/util/test_crypto_ecdsa.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/test_crypto_ecdsa.c b/src/util/test_crypto_ecdsa.c index cfa236d6d..7908590a8 100644 --- a/src/util/test_crypto_ecdsa.c +++ b/src/util/test_crypto_ecdsa.c | |||
@@ -107,6 +107,7 @@ testDeriveSignVerify (void) | |||
107 | struct GNUNET_CRYPTO_EcdsaPrivateKey *dpriv; | 107 | struct GNUNET_CRYPTO_EcdsaPrivateKey *dpriv; |
108 | struct GNUNET_CRYPTO_EcdsaPublicKey pkey; | 108 | struct GNUNET_CRYPTO_EcdsaPublicKey pkey; |
109 | struct GNUNET_CRYPTO_EcdsaPublicKey dpub; | 109 | struct GNUNET_CRYPTO_EcdsaPublicKey dpub; |
110 | struct GNUNET_CRYPTO_EcdsaPublicKey dpub2; | ||
110 | 111 | ||
111 | dpriv = GNUNET_CRYPTO_ecdsa_private_key_derive (&key, | 112 | dpriv = GNUNET_CRYPTO_ecdsa_private_key_derive (&key, |
112 | "test-derive", | 113 | "test-derive", |
@@ -117,9 +118,17 @@ testDeriveSignVerify (void) | |||
117 | "test-derive", | 118 | "test-derive", |
118 | "test-CTX", | 119 | "test-CTX", |
119 | &dpub); | 120 | &dpub); |
121 | GNUNET_CRYPTO_ecdsa_key_get_public (dpriv, &dpub2); | ||
120 | purp.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose)); | 122 | purp.size = htonl (sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose)); |
121 | purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); | 123 | purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); |
122 | 124 | ||
125 | if (0 != GNUNET_memcmp (&dpub.q_y, &dpub2.q_y)) | ||
126 | { | ||
127 | fprintf (stderr, "%s", "key derivation failed\n"); | ||
128 | GNUNET_free (dpriv); | ||
129 | return GNUNET_SYSERR; | ||
130 | } | ||
131 | |||
123 | if (GNUNET_SYSERR == | 132 | if (GNUNET_SYSERR == |
124 | GNUNET_CRYPTO_ecdsa_sign_ (dpriv, | 133 | GNUNET_CRYPTO_ecdsa_sign_ (dpriv, |
125 | &purp, | 134 | &purp, |