aboutsummaryrefslogtreecommitdiff
path: root/openssl/apps/s_cb.c
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/apps/s_cb.c')
-rw-r--r--openssl/apps/s_cb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/openssl/apps/s_cb.c b/openssl/apps/s_cb.c
index 7918500a6..fabf9cfb2 100644
--- a/openssl/apps/s_cb.c
+++ b/openssl/apps/s_cb.c
@@ -111,6 +111,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h> /* for memcpy() */
#define USE_SOCKETS
#define NON_MAIN
#include "apps.h"
@@ -747,7 +748,7 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie,
/* Initialize a random secret */
if (!cookie_initialized) {
- if (!RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH)) {
+ if (RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH) <= 0) {
BIO_printf(bio_err, "error setting random cookie secret\n");
return 0;
}