diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-03-16 12:34:13 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-03-16 12:34:13 +0100 |
commit | 9dc568d2f275a2d923f8aad4281300e50b64da01 (patch) | |
tree | b3ae5a7231936569931d7da2fb465f39a2f430df | |
parent | c815c8cededea0ae8cf31f6d7405f8cb6e024bda (diff) | |
download | twister-9dc568d2f275a2d923f8aad4281300e50b64da01.tar.gz twister-9dc568d2f275a2d923f8aad4281300e50b64da01.tar.bz2 twister-9dc568d2f275a2d923f8aad4281300e50b64da01.zip |
rely again on RNG.
-rw-r--r-- | src/twister/taler-twister-service.c | 11 |
1 files 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) |