[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 02/173: openssl-random: check return code when aski
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 02/173: openssl-random: check return code when asking for random |
Date: |
Fri, 24 Feb 2017 14:00:24 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.53.1
in repository gnurl.
commit 00c817068ed9e73974b3fedf6b9d7cb085db69f4
Author: Daniel Stenberg <address@hidden>
AuthorDate: Fri Dec 23 15:29:01 2016 +0100
openssl-random: check return code when asking for random
and fail appropriately if it returns error
---
lib/vtls/openssl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index d92e71365..df8f11f34 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -3275,6 +3275,7 @@ size_t Curl_ossl_version(char *buffer, size_t size)
int Curl_ossl_random(struct Curl_easy *data, unsigned char *entropy,
size_t length)
{
+ int rc;
if(data) {
if(Curl_ossl_seed(data)) /* Initiate the seed if not already done */
return 1; /* couldn't seed for some reason */
@@ -3283,8 +3284,9 @@ int Curl_ossl_random(struct Curl_easy *data, unsigned
char *entropy,
if(!rand_enough())
return 1;
}
- RAND_bytes(entropy, curlx_uztosi(length));
- return 0; /* 0 as in no problem */
+ /* RAND_bytes() returns 1 on success, 0 otherwise. */
+ rc = RAND_bytes(entropy, curlx_uztosi(length));
+ return rc^1;
}
void Curl_ossl_md5sum(unsigned char *tmp, /* input */
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] annotated tag gnurl-7.53.1 created (now 45aa29388), gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 09/173: configure: accept --with-libidn2 instead, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 01/173: gnutls-random: check return code for failed random, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 02/173: openssl-random: check return code when asking for random,
gnunet <=
- [GNUnet-SVN] [gnurl] 18/173: darwinssl: fix CFArrayRef leak, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 07/173: ftp-gss: check for init before use, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 11/173: formdata: use NULL, not 0, when returning pointers, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 10/173: ftp: failure to resolve proxy should return that error code, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 14/173: vtls: s/SSLEAY/OPENSSL, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 12/173: cmdline-opts/page-footer: add three more exit codes, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 04/173: bump: toward next release, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 06/173: build-wolfssl: Sync config with wolfSSL 3.10, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 03/173: http: remove "Curl_http_done: called premature" message, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 17/173: darwinssl: fix iOS build, gnunet, 2017/02/24