summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-30 12:18:47 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-30 12:18:47 +0000
commit079d2f0b130d3f6e830a4d8567f43e03782ae2cb (patch)
treee7d58d865e257c93663ff41921ec3cc624922897
parent862d9416e6e4fc2bd493d5c89a58187218fe4e51 (diff)
-fix use after free
-rw-r--r--src/util/test_crypto_rsa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/test_crypto_rsa.c b/src/util/test_crypto_rsa.c
index 156d40ed4..3b2731528 100644
--- a/src/util/test_crypto_rsa.c
+++ b/src/util/test_crypto_rsa.c
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet
- (C) 2014 Christian Grothoff (and other contributing authors)
+ (C) 2014,2015 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -55,14 +55,13 @@ main (int argc,
enc = NULL;
size = GNUNET_CRYPTO_rsa_private_key_encode (priv, &enc);
GNUNET_free (enc);
-
+
/* try ordinary sig first */
sig = GNUNET_CRYPTO_rsa_sign (priv,
&hash,
sizeof (hash));
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_rsa_verify (&hash, sig, pub));
- GNUNET_CRYPTO_rsa_signature_free (sig);
/* corrupt our hash and see if the signature is still valid */
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &hash,
sizeof (struct GNUNET_HashCode));
@@ -70,6 +69,7 @@ main (int argc,
sig,
pub));
(void) fprintf (stderr, "The above warning is expected.\n");
+ GNUNET_CRYPTO_rsa_signature_free (sig);
/* test blind signing */