]> granicus.if.org Git - curl/commitdiff
openssl: Fix random generation
authorJay Satiro <raysatiro@yahoo.com>
Tue, 17 Jan 2017 07:53:29 +0000 (02:53 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 17 Jan 2017 07:53:59 +0000 (02:53 -0500)
- Fix logic error in Curl_ossl_random.

Broken a few days ago in 807698d.

lib/vtls/openssl.c

index 63fad71fc3b4a7d068c64a151a38682450ba1ee3..48a4c0b022b271d4fd106ae0ce49b98560587368 100644 (file)
@@ -3286,7 +3286,7 @@ CURLcode Curl_ossl_random(struct Curl_easy *data, unsigned char *entropy,
   }
   /* RAND_bytes() returns 1 on success, 0 otherwise.  */
   rc = RAND_bytes(entropy, curlx_uztosi(length));
-  return rc?CURLE_FAILED_INIT:CURLE_OK;
+  return (rc == 1 ? CURLE_OK : CURLE_FAILED_INIT);
 }
 
 void Curl_ossl_md5sum(unsigned char *tmp, /* input */