X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fe_aes.c;h=1d5007acf8f273d7718c5ab6ef92300b9a13a523;hp=2421385425ca3e7544f6fe089b8aba56a5256e2f;hb=16cfc2c90d9e7776965db07c1f31bbec2f6c41e3;hpb=7caf122e717e79afcb986fe217e77a630b67bf4c 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 -#include #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;