summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/evp_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/evp_enc.c')
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c
index 4333e4dff8..49ceacefad 100644
--- a/src/lib/libcrypto/evp/evp_enc.c
+++ b/src/lib/libcrypto/evp/evp_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_enc.c,v 1.24 2014/07/11 08:44:48 jsing Exp $ */ 1/* $OpenBSD: evp_enc.c,v 1.25 2014/10/22 13:02:04 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,13 +57,13 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h>
60#include <string.h> 61#include <string.h>
61 62
62#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
63 64
64#include <openssl/err.h> 65#include <openssl/err.h>
65#include <openssl/evp.h> 66#include <openssl/evp.h>
66#include <openssl/rand.h>
67 67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
@@ -613,8 +613,7 @@ EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key)
613{ 613{
614 if (ctx->cipher->flags & EVP_CIPH_RAND_KEY) 614 if (ctx->cipher->flags & EVP_CIPH_RAND_KEY)
615 return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_RAND_KEY, 0, key); 615 return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_RAND_KEY, 0, key);
616 if (RAND_bytes(key, ctx->key_len) <= 0) 616 arc4random_buf(key, ctx->key_len);
617 return 0;
618 return 1; 617 return 1;
619} 618}
620 619