diff options
Diffstat (limited to 'src/util/test_rsa.c')
-rw-r--r-- | src/util/test_rsa.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/util/test_rsa.c b/src/util/test_rsa.c index 1f7adfd6c..fdacf5212 100644 --- a/src/util/test_rsa.c +++ b/src/util/test_rsa.c | |||
@@ -38,7 +38,7 @@ | |||
38 | int | 38 | int |
39 | main (int argc, char *argv[]) | 39 | main (int argc, char *argv[]) |
40 | { | 40 | { |
41 | #define RND_BLK_SIZE 4096 | 41 | #define RND_BLK_SIZE 16524 |
42 | unsigned char rnd_blk[RND_BLK_SIZE]; | 42 | unsigned char rnd_blk[RND_BLK_SIZE]; |
43 | struct TALER_RSA_PrivateKey *priv; | 43 | struct TALER_RSA_PrivateKey *priv; |
44 | struct TALER_RSA_PrivateKeyBinaryEncoded *priv_enc; | 44 | struct TALER_RSA_PrivateKeyBinaryEncoded *priv_enc; |
@@ -72,6 +72,12 @@ main (int argc, char *argv[]) | |||
72 | EXITIF (GNUNET_OK != TALER_RSA_verify (&hash, sizeof (hash), | 72 | EXITIF (GNUNET_OK != TALER_RSA_verify (&hash, sizeof (hash), |
73 | &sig, | 73 | &sig, |
74 | &pubkey)); | 74 | &pubkey)); |
75 | /* corrupt our hash and see if the signature is still valid */ | ||
76 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &hash, | ||
77 | sizeof (struct GNUNET_HashCode)); | ||
78 | EXITIF (GNUNET_OK == TALER_RSA_verify (&hash, sizeof (hash), | ||
79 | &sig, | ||
80 | &pubkey)); | ||
75 | 81 | ||
76 | /* test blind signing */ | 82 | /* test blind signing */ |
77 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, rnd_blk, | 83 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, rnd_blk, |
@@ -92,6 +98,12 @@ main (int argc, char *argv[]) | |||
92 | EXITIF (GNUNET_OK != TALER_RSA_verify (&hash, sizeof (hash), | 98 | EXITIF (GNUNET_OK != TALER_RSA_verify (&hash, sizeof (hash), |
93 | &sig, | 99 | &sig, |
94 | &pubkey)); | 100 | &pubkey)); |
101 | /* corrupt our hash and see if the signature is still valid */ | ||
102 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &hash, | ||
103 | sizeof (struct GNUNET_HashCode)); | ||
104 | EXITIF (GNUNET_OK == TALER_RSA_verify (&hash, sizeof (hash), | ||
105 | &sig, | ||
106 | &pubkey)); | ||
95 | ret = 0; /* all OK */ | 107 | ret = 0; /* all OK */ |
96 | 108 | ||
97 | EXITIF_exit: | 109 | EXITIF_exit: |