gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-twister] 33/34: rely again on RNG.


From: gnunet
Subject: [GNUnet-SVN] [taler-twister] 33/34: rely again on RNG.
Date: Sat, 17 Mar 2018 01:58:24 +0100

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

marcello pushed a commit to branch master
in repository twister.

commit 9dc568d2f275a2d923f8aad4281300e50b64da01
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Mar 16 12:34:13 2018 +0100

    rely again on RNG.
---
 src/twister/taler-twister-service.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/twister/taler-twister-service.c 
b/src/twister/taler-twister-service.c
index f1a0d1a..6104fda 100644
--- a/src/twister/taler-twister-service.c
+++ b/src/twister/taler-twister-service.c
@@ -513,8 +513,8 @@ create_mhd_response_from_hr (struct HttpRequest *hr)
 
 
 /**
- * Handle response payload data from cURL.  Copies it into our `io_buf` to make
- * it available to MHD.
+ * Handle response payload data from cURL.
+ * Copies it into our `io_buf` to make it available to MHD.
  *
  * @param ptr pointer to the data
  * @param size number of blocks of data
@@ -1151,7 +1151,8 @@ create_response (void *cls,
   {
     TALER_LOG_DEBUG
       ("Will (badly) truncate the request.\n");
-    malformed_size = hr->io_len - TRUNC_SIZE;
+    malformed_size = GNUNET_CRYPTO_random_u32
+      (GNUNET_CRYPTO_QUALITY_WEAK, hr->io_len);
     hr->io_len = malformed_size;
   }
 
@@ -1378,7 +1379,8 @@ create_response (void *cls,
 
     TALER_LOG_DEBUG
       ("Will (badly) truncate the response.\n");
-    fake_len = hr->io_len - TRUNC_SIZE;
+    fake_len = GNUNET_CRYPTO_random_u32
+      (GNUNET_CRYPTO_QUALITY_WEAK, body_len);
     body_len = fake_len; 
     malform = GNUNET_NO;
   }
@@ -1388,6 +1390,7 @@ create_response (void *cls,
      body,
      MHD_RESPMEM_MUST_COPY);
 
+  GNUNET_free (body);
   for (header = hr->header_head;
        NULL != header;
        header = header->next)

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



reply via email to

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