summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_enc.c
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-06-07 21:07:21 +1000
committerPauli <pauli@openssl.org>2021-06-08 19:32:25 +1000
commit69807ab8ed5d5b3b0bb59f418cb3a7658de005a3 (patch)
treeb81a80900338c4b02d1158d5fb5084963d77f2a8 /crypto/evp/evp_enc.c
parentcec8854cc90794a0696c518efabd90e0279658db (diff)
evp: avoid some calls to EVP_CIPHER_CTX_get_iv_length() because it's been called already
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15635)
Diffstat (limited to 'crypto/evp/evp_enc.c')
-rw-r--r--crypto/evp/evp_enc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index cf73ba230e..5188e73602 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -345,8 +345,8 @@ static int evp_cipher_init_internal(EVP_CIPHER_CTX *ctx,
if (!ossl_assert(n >= 0 && n <= (int)sizeof(ctx->iv)))
return 0;
if (iv != NULL)
- memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_get_iv_length(ctx));
- memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_get_iv_length(ctx));
+ memcpy(ctx->oiv, iv, n);
+ memcpy(ctx->iv, ctx->oiv, n);
break;
case EVP_CIPH_CTR_MODE: