aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_crypto_rsa.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-15 19:16:20 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-15 19:16:20 +0100
commit3cb670b171017db733d6cfcbf8e7e6be9fd7cd11 (patch)
treebfbad8f7cb9add2494ad39f4bca24b49fa58084c /src/util/test_crypto_rsa.c
parent3d3c271c20f795c78867e2c0b9c771695a6ad0ef (diff)
downloadgnunet-3cb670b171017db733d6cfcbf8e7e6be9fd7cd11.tar.gz
gnunet-3cb670b171017db733d6cfcbf8e7e6be9fd7cd11.zip
fix #5968, but not active
Diffstat (limited to 'src/util/test_crypto_rsa.c')
-rw-r--r--src/util/test_crypto_rsa.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util/test_crypto_rsa.c b/src/util/test_crypto_rsa.c
index 423f1d6f1..5b546f243 100644
--- a/src/util/test_crypto_rsa.c
+++ b/src/util/test_crypto_rsa.c
@@ -89,6 +89,20 @@ main (int argc,
89 GNUNET_assert (NULL != pub_copy); 89 GNUNET_assert (NULL != pub_copy);
90 GNUNET_assert (GNUNET_OK == 90 GNUNET_assert (GNUNET_OK ==
91 GNUNET_CRYPTO_rsa_verify (&hash, sig, pub_copy)); 91 GNUNET_CRYPTO_rsa_verify (&hash, sig, pub_copy));
92 {
93 char *buf;
94 size_t buf_size;
95 struct GNUNET_CRYPTO_RsaPublicKey *pub2;
96
97 buf_size = GNUNET_CRYPTO_rsa_public_key_encode (pub,
98 &buf);
99 pub2 = GNUNET_CRYPTO_rsa_public_key_decode (buf,
100 buf_size);
101 GNUNET_free (buf);
102 GNUNET_assert (GNUNET_OK ==
103 GNUNET_CRYPTO_rsa_verify (&hash, sig, pub2));
104 GNUNET_CRYPTO_rsa_public_key_free (pub2);
105 }
92 /* corrupt our hash and see if the signature is still valid */ 106 /* corrupt our hash and see if the signature is still valid */
93 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &hash, 107 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &hash,
94 sizeof(struct GNUNET_HashCode)); 108 sizeof(struct GNUNET_HashCode));