From 811155110e1d22345f13ac6c7c85ebba92226132 Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Sun, 9 Jul 2017 20:14:16 +0200 Subject: [PATCH] -fixes --- src/identity-provider/test_idp.sh | 18 ++++-------------- src/util/crypto_abe.c | 7 +++++-- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/identity-provider/test_idp.sh b/src/identity-provider/test_idp.sh index 9947dfe30..2eeb27ce9 100755 --- a/src/identity-provider/test_idp.sh +++ b/src/identity-provider/test_idp.sh @@ -25,17 +25,7 @@ which timeout &> /dev/null && DO_TIMEOUT="timeout 30" TEST_ATTR="test" gnunet-arm -s -c test_idp.conf gnunet-identity -C testego -c test_idp.conf -$DO_TIMEOUT valgrind gnunet-idp -e testego --init -c test_idp.conf -$DO_TIMEOUT valgrind gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf -STATUS=$? -gnunet-namestore -z testego -D -c test_idp.conf -$DO_TIMEOUT valgrind --leak-check=full gnunet-idp -e testego -D -c test_idp.conf - -if test $? != 0 -then - echo "Error issuing..." - exit 1 -fi -#Try import -gnunet-arm -e -c test_idp_lookup.conf -exit $RES +gnunet-idp -e testego --init -c test_idp.conf +gnunet-idp -e testego -a email -V john@doe.gnu -c test_idp.conf +gnunet-idp -e testego -D -c test_idp.conf +gnunet-arm -e -c test_idp.conf diff --git a/src/util/crypto_abe.c b/src/util/crypto_abe.c index 798a74f87..f84aaf9f9 100644 --- a/src/util/crypto_abe.c +++ b/src/util/crypto_abe.c @@ -145,7 +145,6 @@ GNUNET_CRYPTO_cpabe_create_master_key (void) key->msk = bswabe_msk_serialize(msk); GNUNET_assert (NULL != key->pub); GNUNET_assert (NULL != key->msk); - bswabe_pub_free (pub); bswabe_msk_free (msk); return key; } @@ -174,6 +173,8 @@ GNUNET_CRYPTO_cpabe_create_key (struct GNUNET_CRYPTO_AbeMasterKey *key, prv_key->prv = bswabe_prv_serialize(prv); prv_key->pub = bswabe_pub_serialize (pub); GNUNET_assert (NULL != prv_key->prv); + //Memory management in bswabe is buggy + //bswabe_prv_free (prv); bswabe_msk_free (msk); return prv_key; } @@ -296,6 +297,7 @@ GNUNET_CRYPTO_cpabe_decrypt (const void *block, if( !bswabe_dec(pub, prv, cph, m) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n", bswabe_error()); + bswabe_cph_free(cph); return GNUNET_SYSERR; } bswabe_cph_free(cph); @@ -304,7 +306,8 @@ GNUNET_CRYPTO_cpabe_decrypt (const void *block, g_byte_array_free(aes_buf, 1); *result = GNUNET_malloc (plt->len); GNUNET_memcpy (*result, plt->data, plt->len); - bswabe_prv_free (prv); + //freeing is buggy in bswabe + //bswabe_prv_free (prv); bswabe_pub_free (pub); return pt_size; } -- 2.25.1