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.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
index 71ce6df94e..868c7e5bf7 100644
--- a/crypto/evp/e_aes.c
+++ b/crypto/evp/e_aes.c
@@ -1475,10 +1475,8 @@ static int s390x_aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
if (gctx->iv != c->iv)
OPENSSL_free(gctx->iv);
- if ((gctx->iv = OPENSSL_malloc(len)) == NULL) {
- ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE);
+ if ((gctx->iv = OPENSSL_malloc(len)) == NULL)
return 0;
- }
}
/* Add padding. */
memset(gctx->iv + arg, 0, len - arg - 8);
@@ -1594,10 +1592,8 @@ static int s390x_aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
} else {
len = S390X_gcm_ivpadlen(gctx->ivlen);
- if ((gctx_out->iv = OPENSSL_malloc(len)) == NULL) {
- ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE);
+ if ((gctx_out->iv = OPENSSL_malloc(len)) == NULL)
return 0;
- }
memcpy(gctx_out->iv, gctx->iv, len);
}
@@ -2682,10 +2678,8 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
if ((arg > EVP_MAX_IV_LENGTH) && (arg > gctx->ivlen)) {
if (gctx->iv != c->iv)
OPENSSL_free(gctx->iv);
- if ((gctx->iv = OPENSSL_malloc(arg)) == NULL) {
- ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE);
+ if ((gctx->iv = OPENSSL_malloc(arg)) == NULL)
return 0;
- }
}
gctx->ivlen = arg;
return 1;
@@ -2784,10 +2778,8 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
if (gctx->iv == c->iv)
gctx_out->iv = out->iv;
else {
- if ((gctx_out->iv = OPENSSL_malloc(gctx->ivlen)) == NULL) {
- ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE);
+ if ((gctx_out->iv = OPENSSL_malloc(gctx->ivlen)) == NULL)
return 0;
- }
memcpy(gctx_out->iv, gctx->iv, gctx->ivlen);
}
return 1;