diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/evp/e_aes.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c index e1b53c2ce7..80eba80244 100644 --- a/src/lib/libcrypto/evp/e_aes.c +++ b/src/lib/libcrypto/evp/e_aes.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: e_aes.c,v 1.40 2020/04/27 19:31:02 tb Exp $ */ | 1 | /* $OpenBSD: e_aes.c,v 1.41 2020/04/30 18:43:11 tb Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -721,6 +721,10 @@ aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | |||
| 721 | case EVP_CTRL_INIT: | 721 | case EVP_CTRL_INIT: |
| 722 | gctx->key_set = 0; | 722 | gctx->key_set = 0; |
| 723 | gctx->iv_set = 0; | 723 | gctx->iv_set = 0; |
| 724 | if (c->cipher->iv_len == 0) { | ||
| 725 | EVPerror(EVP_R_INVALID_IV_LENGTH); | ||
| 726 | return 0; | ||
| 727 | } | ||
| 724 | gctx->ivlen = c->cipher->iv_len; | 728 | gctx->ivlen = c->cipher->iv_len; |
| 725 | gctx->iv = c->iv; | 729 | gctx->iv = c->iv; |
| 726 | gctx->taglen = -1; | 730 | gctx->taglen = -1; |
