From e10d678fc055eadde27abf723782c701012322ce Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 11 Oct 2012 14:12:46 +0000 Subject: [PATCH] -only generate keys of size 914 --- src/util/gnunet-rsa.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/gnunet-rsa.c b/src/util/gnunet-rsa.c index cdf693841..040e66ea9 100644 --- a/src/util/gnunet-rsa.c +++ b/src/util/gnunet-rsa.c @@ -25,6 +25,7 @@ */ #include "platform.h" #include "gnunet_util_lib.h" +#include "gnunet_testing_lib-new.h" #include @@ -121,6 +122,13 @@ create_keys (const char *fn) break; } enc = GNUNET_CRYPTO_rsa_encode_key (pk); + if (GNUNET_TESTING_HOSTKEYFILESIZE != htons (enc->len)) + { + /* sometimes we get a different key length because 'd' or 'u' start + with leading bits; skip those... */ + make_keys++; + continue; + } if (htons (enc->len) != fwrite (enc, 1, htons (enc->len), f)) { fprintf (stderr, -- 2.25.1