aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-26 12:22:56 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-26 12:22:56 +0100
commit52591a77f01fadfd748b01a4fd101e50bd473661 (patch)
tree57a4aae90d96d19d91009d21a8161213ffcf0300
parentae917eeee0a3100538cf71972a0cadcc80098d80 (diff)
parent734fd0aa2ef46a718dcddf73fa45b898535b9756 (diff)
downloadexchange-52591a77f01fadfd748b01a4fd101e50bd473661.tar.gz
exchange-52591a77f01fadfd748b01a4fd101e50bd473661.zip
intermediary commit, breaking the build by starting to move towards variable-size GNUnet signatures instead of fixed-size signatures; much broken now
-rw-r--r--src/lib/Makefile.am7
-rw-r--r--src/util/test_rsa.c26
2 files changed, 18 insertions, 15 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 5c740fe29..8632fc15b 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -1,10 +1,9 @@
1AM_CPPFLAGS = -I$(top_srcdir)/src/include $(POSTGRESQL_CPPFLAGS) 1AM_CPPFLAGS = -I$(top_srcdir)/src/include
2 2
3lib_LTLIBRARIES = \ 3lib_LTLIBRARIES = \
4 libtalermint.la 4 libtalermint.la
5 5
6libtalermint_la_LDFLAGS = \ 6libtalermint_la_LDFLAGS = \
7 $(POSTGRESQL_LDFLAGS) \
8 -version-info 0:0:0 \ 7 -version-info 0:0:0 \
9 -no-undefined 8 -no-undefined
10 9
@@ -16,10 +15,6 @@ libtalermint_la_LIBADD = \
16 -ljansson \ 15 -ljansson \
17 -lcurl 16 -lcurl
18 17
19libtalermint_la_LDFLAGS = \
20 -version-info 0:0:0 \
21 -no-undefined
22
23check_PROGRAMS = \ 18check_PROGRAMS = \
24 test_mint_api 19 test_mint_api
25 20
diff --git a/src/util/test_rsa.c b/src/util/test_rsa.c
index 85114843d..fdacf5212 100644
--- a/src/util/test_rsa.c
+++ b/src/util/test_rsa.c
@@ -38,7 +38,7 @@
38int 38int
39main (int argc, char *argv[]) 39main (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;
@@ -69,11 +69,13 @@ main (int argc, char *argv[])
69 ntohs (priv_enc->len)))); 69 ntohs (priv_enc->len))));
70 GNUNET_free (priv_enc); 70 GNUNET_free (priv_enc);
71 priv_enc = NULL; 71 priv_enc = NULL;
72 EXITIF (GNUNET_OK != TALER_RSA_hash_verify (&hash, 72 EXITIF (GNUNET_OK != TALER_RSA_verify (&hash, sizeof (hash),
73 &sig, 73 &sig,
74 &pubkey)); 74 &pubkey));
75 EXITIF (GNUNET_OK != TALER_RSA_verify (rnd_blk, 75 /* corrupt our hash and see if the signature is still valid */
76 RND_BLK_SIZE, 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),
77 &sig, 79 &sig,
78 &pubkey)); 80 &pubkey));
79 81
@@ -93,9 +95,15 @@ main (int argc, char *argv[])
93 EXITIF (GNUNET_OK != TALER_RSA_unblind (&sig, 95 EXITIF (GNUNET_OK != TALER_RSA_unblind (&sig,
94 bkey, 96 bkey,
95 &pubkey)); 97 &pubkey));
96 EXITIF (GNUNET_OK != TALER_RSA_hash_verify (&hash, 98 EXITIF (GNUNET_OK != TALER_RSA_verify (&hash, sizeof (hash),
97 &sig, 99 &sig,
98 &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));
99 ret = 0; /* all OK */ 107 ret = 0; /* all OK */
100 108
101 EXITIF_exit: 109 EXITIF_exit: