evp enc: cache cipher key length
authorPauli <pauli@openssl.org>
Thu, 27 Jan 2022 02:33:36 +0000 (13:33 +1100)
committerPauli <pauli@openssl.org>
Sun, 6 Feb 2022 22:46:16 +0000 (09:46 +1100)
commit70f39a487d3f7d976a01e0ee7ae98a82ceeea7a0
treed73af15d85194f56614a4a0165e6a6060e3be32b
parentb30b45b7247d056b569e2b5139f8b503d36e646c
evp enc: cache cipher key length

Instead of doing a heavy params based query every time a context is
asked for its key length, this value is cached in the context and only
queried if it could have been modified.

Fixes #17064

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17543)
crypto/evp/evp_enc.c
crypto/evp/evp_lib.c