aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_crypto_rsa.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-16 18:24:47 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-16 18:24:58 +0100
commitbe6c14f2b2b880d72cd77538e98a067241d90f55 (patch)
tree4b945be0967a8d1dc5ea28b3720dfa9d0c363063 /src/util/test_crypto_rsa.c
parent8a0e314c66e07a5f5f8af4e5508d5a3c938b4812 (diff)
downloadgnunet-be6c14f2b2b880d72cd77538e98a067241d90f55.tar.gz
gnunet-be6c14f2b2b880d72cd77538e98a067241d90f55.zip
patch up RSA signature format for #5698
Diffstat (limited to 'src/util/test_crypto_rsa.c')
-rw-r--r--src/util/test_crypto_rsa.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/test_crypto_rsa.c b/src/util/test_crypto_rsa.c
index 5b546f243..277f58ba0 100644
--- a/src/util/test_crypto_rsa.c
+++ b/src/util/test_crypto_rsa.c
@@ -93,15 +93,22 @@ main (int argc,
93 char *buf; 93 char *buf;
94 size_t buf_size; 94 size_t buf_size;
95 struct GNUNET_CRYPTO_RsaPublicKey *pub2; 95 struct GNUNET_CRYPTO_RsaPublicKey *pub2;
96 struct GNUNET_CRYPTO_RsaSignature *sig2;
96 97
97 buf_size = GNUNET_CRYPTO_rsa_public_key_encode (pub, 98 buf_size = GNUNET_CRYPTO_rsa_public_key_encode (pub,
98 &buf); 99 &buf);
99 pub2 = GNUNET_CRYPTO_rsa_public_key_decode (buf, 100 pub2 = GNUNET_CRYPTO_rsa_public_key_decode (buf,
100 buf_size); 101 buf_size);
101 GNUNET_free (buf); 102 GNUNET_free (buf);
103 buf_size = GNUNET_CRYPTO_rsa_signature_encode (sig,
104 &buf);
105 sig2 = GNUNET_CRYPTO_rsa_signature_decode (buf,
106 buf_size);
107 GNUNET_free (buf);
102 GNUNET_assert (GNUNET_OK == 108 GNUNET_assert (GNUNET_OK ==
103 GNUNET_CRYPTO_rsa_verify (&hash, sig, pub2)); 109 GNUNET_CRYPTO_rsa_verify (&hash, sig2, pub2));
104 GNUNET_CRYPTO_rsa_public_key_free (pub2); 110 GNUNET_CRYPTO_rsa_public_key_free (pub2);
111 GNUNET_CRYPTO_rsa_signature_free (sig2);
105 } 112 }
106 /* corrupt our hash and see if the signature is still valid */ 113 /* corrupt our hash and see if the signature is still valid */
107 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &hash, 114 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &hash,