[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] 02/09: sizeof to strlen...
From: |
gnunet |
Subject: |
[taler-anastasis] 02/09: sizeof to strlen... |
Date: |
Wed, 01 Apr 2020 10:12:25 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
commit 10939ad4514f4c3026d18ee6a4c149bb78639ddf
Author: Dennis Neufeld <address@hidden>
AuthorDate: Wed Apr 1 07:07:46 2020 +0000
sizeof to strlen...
---
src/util/anastasis_crypto.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c
index e001a92..8586c4d 100644
--- a/src/util/anastasis_crypto.c
+++ b/src/util/anastasis_crypto.c
@@ -71,9 +71,10 @@ get_iv_key (const void *key_material,
key_material,
key_m_len,
nonce,
- sizeof(struct ANASTASIS_CRYPTO_Nonce),
+ sizeof (struct
+ ANASTASIS_CRYPTO_Nonce),
salt,
- sizeof (*salt),
+ strlen (salt),
NULL,
0));
memcpy (key, res, AES_KEY_SIZE);
@@ -109,12 +110,13 @@ anastasis_encrypt (const void *key,
struct ANASTASIS_CRYPTO_AesTag *tag;
char *ciphertext;
- *res_size = data_size + sizeof(struct ANASTASIS_CRYPTO_Nonce)
- + sizeof(struct ANASTASIS_CRYPTO_AesTag);
+ *res_size = data_size
+ + sizeof (struct ANASTASIS_CRYPTO_Nonce)
+ + sizeof (struct ANASTASIS_CRYPTO_AesTag);
*res = GNUNET_malloc (*res_size);
GNUNET_assert (*res_size == data_size
+ sizeof (struct ANASTASIS_CRYPTO_Nonce)
- + sizeof(struct ANASTASIS_CRYPTO_AesTag));
+ + sizeof (struct ANASTASIS_CRYPTO_AesTag));
nonce = (struct ANASTASIS_CRYPTO_Nonce *) *res;
tag = (struct ANASTASIS_CRYPTO_AesTag *) &nonce[1];
ciphertext = (char *) &tag[1];
@@ -150,7 +152,7 @@ anastasis_encrypt (const void *key,
GNUNET_assert (0 ==
gcry_cipher_gettag (cipher,
tag,
- sizeof(struct ANASTASIS_CRYPTO_AesTag)));
+ sizeof (struct ANASTASIS_CRYPTO_AesTag)));
gcry_cipher_close (cipher);
}
@@ -183,12 +185,13 @@ anastasis_decrypt (const void *key,
struct ANASTASIS_CRYPTO_AesTag *tag;
char *ciphertext;
- *res_size = data_size - sizeof (struct ANASTASIS_CRYPTO_Nonce)
- - sizeof(struct ANASTASIS_CRYPTO_AesTag);
+ *res_size = data_size
+ - sizeof (struct ANASTASIS_CRYPTO_Nonce)
+ - sizeof (struct ANASTASIS_CRYPTO_AesTag);
*res = GNUNET_malloc (*res_size);
GNUNET_assert (*res_size == data_size
- sizeof (struct ANASTASIS_CRYPTO_Nonce)
- - sizeof(struct ANASTASIS_CRYPTO_AesTag));
+ - sizeof (struct ANASTASIS_CRYPTO_AesTag));
nonce = (struct ANASTASIS_CRYPTO_Nonce *) data;
tag = (struct ANASTASIS_CRYPTO_AesTag *) &nonce[1];
ciphertext = (char *) &tag[1];
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [taler-anastasis] branch master updated (9612023 -> 7e332f6), gnunet, 2020/04/01
- [taler-anastasis] 04/09: private key derivation, gnunet, 2020/04/01
- [taler-anastasis] 02/09: sizeof to strlen...,
gnunet <=
- [taler-anastasis] 01/09: changed msec to key, added key_len, gnunet, 2020/04/01
- [taler-anastasis] 03/09: GNUNET_free() to free()..., gnunet, 2020/04/01
- [taler-anastasis] 08/09: GNUNET_malloc() in core_secret_encrypt/recover, gnunet, 2020/04/01
- [taler-anastasis] 06/09: const char*..., gnunet, 2020/04/01
- [taler-anastasis] 07/09: PolicyKey to hash, gnunet, 2020/04/01
- [taler-anastasis] 05/09: modified policy key derivation, gnunet, 2020/04/01
- [taler-anastasis] 09/09: renaming, gnunet, 2020/04/01