aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_ecc_setup.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-17 12:26:30 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-17 12:26:30 +0200
commitdd8289771b35e5ea36ebdcbfd5b09b599bd59c67 (patch)
treee79e565302867ab16d9ed8560793919094288716 /src/util/crypto_ecc_setup.c
parent3175cde841a8a7836fcf74a3e1b804c71a3aa153 (diff)
downloadgnunet-dd8289771b35e5ea36ebdcbfd5b09b599bd59c67.tar.gz
gnunet-dd8289771b35e5ea36ebdcbfd5b09b599bd59c67.zip
work-around for crypto bug (to be documented more)
Diffstat (limited to 'src/util/crypto_ecc_setup.c')
-rw-r--r--src/util/crypto_ecc_setup.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/util/crypto_ecc_setup.c b/src/util/crypto_ecc_setup.c
index e7caf9ded..76c25dc70 100644
--- a/src/util/crypto_ecc_setup.c
+++ b/src/util/crypto_ecc_setup.c
@@ -41,6 +41,9 @@
41#define LOG_GCRY(level, cmd, rc) do { LOG(level, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, gcry_strerror(rc)); } while(0) 41#define LOG_GCRY(level, cmd, rc) do { LOG(level, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, gcry_strerror(rc)); } while(0)
42 42
43 43
44#include "crypto_bug.c"
45
46
44/** 47/**
45 * Wait for a short time (we're trying to lock a file or want 48 * Wait for a short time (we're trying to lock a file or want
46 * to give another process a shot at finishing a disk write, etc.). 49 * to give another process a shot at finishing a disk write, etc.).
@@ -221,6 +224,15 @@ GNUNET_CRYPTO_eddsa_key_create_from_file (const char *filename)
221 filename); 224 filename);
222 GNUNET_assert (GNUNET_YES == 225 GNUNET_assert (GNUNET_YES ==
223 GNUNET_DISK_file_close (fd)); 226 GNUNET_DISK_file_close (fd));
227#if CRYPTO_BUG
228 if (GNUNET_OK !=
229 check_eddsa_key (priv))
230 {
231 GNUNET_break (0);
232 GNUNET_free (priv);
233 return NULL;
234 }
235#endif
224 return priv; 236 return priv;
225} 237}
226 238
@@ -248,7 +260,7 @@ GNUNET_CRYPTO_ecdsa_key_create_from_file (const char *filename)
248 int ec; 260 int ec;
249 uint64_t fs; 261 uint64_t fs;
250 ssize_t sret; 262 ssize_t sret;
251 263
252 if (GNUNET_SYSERR == 264 if (GNUNET_SYSERR ==
253 GNUNET_DISK_directory_create_for_file (filename)) 265 GNUNET_DISK_directory_create_for_file (filename))
254 return NULL; 266 return NULL;