summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_aes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/e_aes.c')
-rw-r--r--src/lib/libcrypto/evp/e_aes.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c
index 3d357f0119..eb7f520282 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.54 2023/09/28 11:29:10 tb Exp $ */ 1/* $OpenBSD: e_aes.c,v 1.55 2023/11/18 09:37:15 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 *
@@ -2460,7 +2460,11 @@ aes_wrap_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
2460 } 2460 }
2461 2461
2462 if (iv != NULL) { 2462 if (iv != NULL) {
2463 memcpy(ctx->iv, iv, EVP_CIPHER_CTX_iv_length(ctx)); 2463 int iv_len = EVP_CIPHER_CTX_iv_length(ctx);
2464
2465 if (iv_len < 0 || iv_len > sizeof(ctx->iv))
2466 return 0;
2467 memcpy(ctx->iv, iv, iv_len);
2464 wctx->iv = ctx->iv; 2468 wctx->iv = ctx->iv;
2465 } 2469 }
2466 2470