Fix bug in EVP_CIPHER_CTX_get_iv_length()
authorPauli <pauli@openssl.org>
Tue, 26 Jul 2022 01:46:45 +0000 (11:46 +1000)
committerPauli <pauli@openssl.org>
Fri, 19 Aug 2022 10:12:24 +0000 (20:12 +1000)
commit2e4b074800a293c5f3049286116a0a5030ea9312
tree569d77085e7f4eb416f59fdf5f5b48a0798cc28a
parent87ceff925f5f1d43dac0413f36c8b7bba94e4a41
Fix bug in EVP_CIPHER_CTX_get_iv_length()

Out of range values could possibly be returned due to a lack of range checking.
Very unlikely to be exploitable for our provider because sensible values are
returned for all ciphers.

Also fixed the defaulting code so that the cipher's IV length is returned if
the cipher ctx doesn't support getting.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18995)
crypto/evp/evp_lib.c