summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-communicator-udp.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-25 12:17:04 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-25 12:17:04 +0100
commit0eaaeeeccd18fcfdef4c37ea56fc40daf097706a (patch)
tree70d7d4e52075a190123f76da46530708be280fa8 /src/transport/gnunet-communicator-udp.c
parent19d73a8facd4534c2ad2ab37bbdf047e715af2d5 (diff)
error handling
Diffstat (limited to 'src/transport/gnunet-communicator-udp.c')
-rw-r--r--src/transport/gnunet-communicator-udp.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c
index e931bd2e7..d767689b9 100644
--- a/src/transport/gnunet-communicator-udp.c
+++ b/src/transport/gnunet-communicator-udp.c
@@ -1133,14 +1133,18 @@ setup_cipher (const struct GNUNET_HashCode *msec,
{
char key[AES_KEY_SIZE];
char iv[AES_IV_SIZE];
+ int rc;
- gcry_cipher_open (cipher,
- GCRY_CIPHER_AES256 /* low level: go for speed */,
- GCRY_CIPHER_MODE_GCM,
- 0 /* flags */);
+ GNUNET_assert (0 ==
+ gcry_cipher_open (cipher,
+ GCRY_CIPHER_AES256 /* low level: go for speed */,
+ GCRY_CIPHER_MODE_GCM,
+ 0 /* flags */));
get_iv_key (msec, serial, key, iv);
- gcry_cipher_setkey (*cipher, key, sizeof(key));
- gcry_cipher_setiv (*cipher, iv, sizeof(iv));
+ rc = gcry_cipher_setkey (*cipher, key, sizeof(key));
+ GNUNET_assert ((0 == rc) || ((char) rc == GPG_ERR_WEAK_KEY));
+ rc = gcry_cipher_setiv (*cipher, iv, sizeof(iv));
+ GNUNET_assert ((0 == rc) || ((char) rc == GPG_ERR_WEAK_KEY));
}