gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: used TALER_B2S for debugging


From: gnunet
Subject: [taler-anastasis] branch master updated: used TALER_B2S for debugging
Date: Wed, 25 Mar 2020 13:27:57 +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 a090c1f  used TALER_B2S for debugging
a090c1f is described below

commit a090c1f75956c1c8fc22d11b77fc520824f5d1fb
Author: Dennis Neufeld <address@hidden>
AuthorDate: Wed Mar 25 12:27:45 2020 +0000

    used TALER_B2S for debugging
---
 src/util/anastasis_crypto.c      | 20 ++++++++++----------
 src/util/test_anastasis_crypto.c |  9 ++++-----
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c
index cc53e9b..4572364 100644
--- a/src/util/anastasis_crypto.c
+++ b/src/util/anastasis_crypto.c
@@ -160,8 +160,8 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
                               &nonce,
                               sizeof (struct ANASTASIS_CRYPTO_Nonce));
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "\n NONCE_1:  %s \n",
-              &nonce);
+              "NONCE_1:  %s\n",
+              TALER_B2S (&nonce));
   get_iv_key (id, &nonce, "erd", sym_key, iv);
   GNUNET_assert (0 ==
                  gcry_cipher_open (&cipher,
@@ -174,8 +174,8 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
   GNUNET_assert ((0 == rc) || ((char) rc == GPG_ERR_WEAK_KEY));
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "\n SYMKEY_1:  %s \n",
-              sym_key);
+              "SYMKEY_1:  %s\n",
+              TALER_B2S (&sym_key));
   rc = gcry_cipher_setiv (cipher,
                           &iv,
                           sizeof (iv));
@@ -193,7 +193,7 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
 
   erd_size = sizeof (ciphertext) + sizeof(struct ANASTASIS_CRYPTO_Nonce)
              + GCM_TAG_SIZE;
-  memcpy (res_size, &erd_size, sizeof (erd_size));
+  *res_size = erd_size;
   erd = GNUNET_malloc (erd_size);
   memcpy (erd,
           &nonce,
@@ -204,7 +204,7 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
   memcpy (erd + sizeof (struct ANASTASIS_CRYPTO_Nonce) + GCM_TAG_SIZE,
           &ciphertext,
           sizeof(ciphertext));
-  *res = (void *) erd;
+  *res = erd;
 }
 
 /**
@@ -246,8 +246,8 @@ ANASTASIS_CRYPTO_recovery_document_decrypt (
 
   get_iv_key (id, &nonce, "erd", sym_key, iv);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "\n NONCE_2:  %s \n",
-              &nonce);
+              "NONCE_2:  %s\n",
+              TALER_B2S (&nonce));
   GNUNET_assert (0 == gcry_cipher_open (&cipher,
                                         GCRY_CIPHER_AES256,
                                         GCRY_CIPHER_MODE_GCM,
@@ -258,8 +258,8 @@ ANASTASIS_CRYPTO_recovery_document_decrypt (
   GNUNET_assert ((0 == rc) || ((char) rc == GPG_ERR_WEAK_KEY));
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "\n SYMKEY_2:  %s \n",
-              sym_key);
+              "SYMKEY_2:  %s\n",
+              TALER_B2S (&sym_key));
   rc = gcry_cipher_setiv (cipher,
                           &iv,
                           sizeof (iv));
diff --git a/src/util/test_anastasis_crypto.c b/src/util/test_anastasis_crypto.c
index 12bad2f..4f3a3c2 100644
--- a/src/util/test_anastasis_crypto.c
+++ b/src/util/test_anastasis_crypto.c
@@ -29,12 +29,12 @@
 #include <gnunet/gnunet_util_lib.h>
 #include "anastasis_crypto_lib.h"
 
-static int test_recovery_document ()
+static int
+test_recovery_document ()
 {
   void *ciphertext;
   size_t size_ciphertext;
   void *plaintext;
-  const char *dec_plaintext;
   size_t size_plaintext;
   const struct ANASTASIS_CRYPTO_UserIdentifier id;
 
@@ -54,10 +54,9 @@ static int test_recovery_document ()
                                               size_ciphertext,
                                               &plaintext,
                                               &size_plaintext);
-  dec_plaintext = (char*) plaintext;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "\n\n Plaintext:   %s\n\n",
-              *dec_plaintext);
+              "Plaintext:   %s\n",
+              TALER_B2S (&plaintext));
   // return strncmp ("Text", dec_plaintext, sizeof (dec_plaintext));
   return 1;
 }

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



reply via email to

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