summaryrefslogtreecommitdiffstats
path: root/crypto/evp/e_aes.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/evp/e_aes.c')
-rw-r--r--crypto/evp/e_aes.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
index 2421385425..1d5007acf8 100644
--- a/crypto/evp/e_aes.c
+++ b/crypto/evp/e_aes.c
@@ -17,7 +17,6 @@
#include "internal/evp_int.h"
#include "modes_lcl.h"
#include <openssl/rand.h>
-#include <openssl/rand_drbg.h>
#include "evp_locl.h"
typedef struct {
@@ -1405,14 +1404,8 @@ static int s390x_aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
memcpy(gctx->iv, ptr, arg);
enc = EVP_CIPHER_CTX_encrypting(c);
- if (enc) {
- if (c->drbg != NULL) {
- if (RAND_DRBG_bytes(c->drbg, gctx->iv + arg, gctx->ivlen - arg) == 0)
- return 0;
- } else if (RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0) {
- return 0;
- }
- }
+ if (enc && RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0)
+ return 0;
gctx->iv_gen = 1;
return 1;
@@ -2639,14 +2632,9 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
return 0;
if (arg)
memcpy(gctx->iv, ptr, arg);
- if (EVP_CIPHER_CTX_encrypting(c)) {
- if (c->drbg != NULL) {
- if (RAND_DRBG_bytes(c->drbg, gctx->iv + arg, gctx->ivlen - arg) == 0)
- return 0;
- } else if (RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0) {
- return 0;
- }
- }
+ if (EVP_CIPHER_CTX_encrypting(c)
+ && RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0)
+ return 0;
gctx->iv_gen = 1;
return 1;