gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: fixed test of erd en-/decryptio


From: gnunet
Subject: [taler-anastasis] branch master updated: fixed test of erd en-/decryption
Date: Thu, 26 Mar 2020 11:16:16 +0100

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new c173acc  fixed test of erd en-/decryption
c173acc is described below

commit c173acc724849129b85d6b22dd9cfb537ad5a692
Author: Dennis Neufeld <address@hidden>
AuthorDate: Thu Mar 26 10:16:10 2020 +0000

    fixed test of erd en-/decryption
---
 src/util/anastasis_crypto.c      | 9 ++++++---
 src/util/test_anastasis_crypto.c | 4 ++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c
index 386fcb1..51c40bb 100644
--- a/src/util/anastasis_crypto.c
+++ b/src/util/anastasis_crypto.c
@@ -224,12 +224,14 @@ ANASTASIS_CRYPTO_recovery_document_decrypt (
 {
   struct ANASTASIS_CRYPTO_Nonce nonce;
   gcry_cipher_hd_t cipher;
-  char ciphertext[data_size - sizeof (struct ANASTASIS_CRYPTO_Nonce)
-                  - GCM_TAG_SIZE];
   char sym_key[AES_KEY_SIZE];
   char iv[AES_IV_SIZE];
   char gcm_tag[GCM_TAG_SIZE];
+  char ciphertext[data_size - sizeof (struct ANASTASIS_CRYPTO_Nonce)
+                  - GCM_TAG_SIZE];
   int rc;
+  *res_size = sizeof (ciphertext);
+  *res = GNUNET_malloc (*res_size);
 
   memcpy (&nonce, data, sizeof (struct ANASTASIS_CRYPTO_Nonce));
   memcpy (&gcm_tag,
@@ -259,10 +261,11 @@ ANASTASIS_CRYPTO_recovery_document_decrypt (
                                            *res, *res_size,
                                            ciphertext,
                                            sizeof (ciphertext)));
+  gcry_cipher_close (cipher);
+
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "PLAINTEXT_AFTER(int):   %s\n",
               TALER_B2S (*res));
-  gcry_cipher_close (cipher);
 }
 
 /**
diff --git a/src/util/test_anastasis_crypto.c b/src/util/test_anastasis_crypto.c
index f35fbdd..8b1ce00 100644
--- a/src/util/test_anastasis_crypto.c
+++ b/src/util/test_anastasis_crypto.c
@@ -59,8 +59,8 @@ test_recovery_document ()
                                               &size_plaintext);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "PLAINTEXT_AFTER(ext):   %s\n",
-              TALER_B2S (&plaintext));
-  return 1;
+              TALER_B2S (plaintext));
+  return GNUNET_memcmp ("TestTest", plaintext);
 }
 
 int

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]