summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-02-26 12:57:37 +0100
committerMatt Caswell <matt@openssl.org>2015-03-25 13:38:07 +0100
commit266483d2f56b0764849797f31866bfd84f9c3aa8 (patch)
tree42323d0c8b8cea8da4aff3dfdd4bc2251e34a0db /demos
parentFix return checks in GOST engine (diff)
downloadopenssl-266483d2f56b0764849797f31866bfd84f9c3aa8.tar.xz
openssl-266483d2f56b0764849797f31866bfd84f9c3aa8.zip
RAND_bytes updates
Ensure RAND_bytes return value is checked correctly, and that we no longer use RAND_pseudo_bytes. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'demos')
-rw-r--r--demos/easy_tls/easy-tls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/demos/easy_tls/easy-tls.c b/demos/easy_tls/easy-tls.c
index 33303cc117..3475551d6a 100644
--- a/demos/easy_tls/easy-tls.c
+++ b/demos/easy_tls/easy-tls.c
@@ -760,7 +760,8 @@ SSL_CTX *tls_create_ctx(struct tls_create_ctx_args a, void *apparg)
if (tls_dhe1024 == NULL) {
int i;
- RAND_bytes((unsigned char *)&i, sizeof i);
+ if (RAND_bytes((unsigned char *)&i, sizeof i) <= 0)
+ goto err_return;
/*
* make sure that i is non-negative -- pick one of the provided
* seeds