[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 102/171: -fix leaks
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 102/171: -fix leaks |
Date: |
Thu, 04 Jan 2018 16:10:10 +0100 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 075494d7b52eeab8c9e7a064edf55aa9f7fb0895
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Sun Jul 9 19:36:04 2017 +0200
-fix leaks
---
src/util/crypto_abe.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/util/crypto_abe.c b/src/util/crypto_abe.c
index ddaec83eb..62b8d5231 100644
--- a/src/util/crypto_abe.c
+++ b/src/util/crypto_abe.c
@@ -145,6 +145,8 @@ 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;
}
@@ -171,11 +173,13 @@ GNUNET_CRYPTO_cpabe_create_key (struct
GNUNET_CRYPTO_AbeMasterKey *key,
prv = bswabe_keygen(pub, msk, attrs);
prv_key = GNUNET_new (struct GNUNET_CRYPTO_AbeKey);
prv_key->prv = bswabe_prv_serialize(prv);
-
len = key->pub->len;
printf ("Keylen %lu\n", len);
prv_key->pub = bswabe_pub_serialize (pub);
GNUNET_assert (NULL != prv_key->prv);
+ bswabe_prv_free (prv);
+ bswabe_pub_free (pub);
+ bswabe_msk_free (msk);
return prv_key;
}
@@ -256,6 +260,7 @@ GNUNET_CRYPTO_cpabe_encrypt (const void *block,
element_t m;
size_t payload_len;
ssize_t result_len;
+
pub = bswabe_pub_unserialize(key->pub, 0);
if( !(cph = bswabe_enc(pub, m, policy)) )
return GNUNET_SYSERR;
@@ -270,6 +275,7 @@ GNUNET_CRYPTO_cpabe_encrypt (const void *block,
result_len = write_cpabe(result, cph_buf, payload_len, aes_buf);
g_byte_array_free(cph_buf, 1);
g_byte_array_free(aes_buf, 1);
+ bswabe_pub_free (pub);
return result_len;
}
@@ -303,7 +309,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);
+ bswabe_pub_free (pub);
return pt_size;
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 100/171: -merge, (continued)
- [GNUnet-SVN] [gnunet] 100/171: -merge, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 103/171: Merge branch 'abe' into identity_abe, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 112/171: Merge remote-tracking branch 'origin/master' into identity_abe, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 99/171: -add free ABE functions, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 90/171: -fix, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 125/171: -do not persist sensitive data, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 95/171: -fix, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 106/171: -fixes, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 114/171: -move idp gns record handling to identity-provider, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 75/171: -add policy record type, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 102/171: -fix leaks,
gnunet <=
- [GNUnet-SVN] [gnunet] 108/171: -fixes, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 111/171: Merge remote-tracking branch 'origin/master' into identity_abe, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 97/171: -add attr list, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 85/171: -add ABE crypto module, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 123/171: -fix bugs, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 138/171: -add new jwt handling, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 88/171: -add serialization, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 131/171: -more revocation, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 98/171: -add cli, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 92/171: Merge branch 'abe' into identity_abe, gnunet, 2018/01/04