From: Pauli Date: Mon, 7 Jun 2021 11:07:21 +0000 (+1000) Subject: evp: avoid some calls to EVP_CIPHER_CTX_get_iv_length() because it's been called... X-Git-Tag: openssl-3.0.0-beta1~141 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69807ab8ed5d5b3b0bb59f418cb3a7658de005a3;p=thirdparty%2Fopenssl.git evp: avoid some calls to EVP_CIPHER_CTX_get_iv_length() because it's been called already Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15635) --- diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index cf73ba230ef..5188e736022 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: