[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: fix encrypt
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: fix encrypt |
Date: |
Mon, 30 Mar 2020 10:42:27 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new e8934c7 fix encrypt
e8934c7 is described below
commit e8934c7a959fcb7a8d8b43b59bb80b69f9191d89
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Mar 30 10:42:25 2020 +0200
fix encrypt
---
src/util/anastasis_crypto.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c
index e9e6458..3ebddd2 100644
--- a/src/util/anastasis_crypto.c
+++ b/src/util/anastasis_crypto.c
@@ -94,8 +94,8 @@ anastasis_encrypt (const void *msec,
const void *data,
size_t data_size,
const char *salt,
- void **res,
- size_t *res_size)
+ void *res,
+ size_t res_size)
{
struct ANASTASIS_CRYPTO_Nonce *nonce;
gcry_cipher_hd_t cipher;
@@ -105,6 +105,7 @@ anastasis_encrypt (const void *msec,
struct ANASTASIS_CRYPTO_AesTag *tag;
char *ciphertext;
+ GNUNET_assert (res_size == data_size + sizeof (*nonce) + sizeof (*tag));
nonce = (struct ANASTASIS_CRYPTO_Nonce*) *res;
tag = (struct ANASTASIS_CRYPTO_AesTag *) &nonce[1];
ciphertext = (char *) &tag[1];
@@ -290,10 +291,11 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
size_t *res_size)
{
char *salt = "erd";
+
*res_size = data_size + sizeof(struct ANASTASIS_CRYPTO_Nonce)
+ GCM_TAG_SIZE;
*res = GNUNET_malloc (*res_size);
- anastasis_encrypt (id, data, data_size, salt, res, res_size);
+ anastasis_encrypt (id, data, data_size, salt, *res, *res_size);
}
@@ -350,7 +352,7 @@ ANASTASIS_CRYPTO_key_share_encrypt (
security question, see 12.6.-> interface EncryptedKeyShare in spec)
*/
anastasis_encrypt (id, key_share, sizeof (struct ANASTASIS_CRYPTO_KeyShare),
- salt, res,res_size);
+ salt, *res, *res_size);
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [taler-anastasis] branch master updated: fix encrypt,
gnunet <=