Fix EVP_CIPHER_CTX_set_padding for legacy path
authorShane Lontis <shane.lontis@oracle.com>
Wed, 18 Nov 2020 09:49:19 +0000 (19:49 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Thu, 26 Nov 2020 21:58:01 +0000 (07:58 +1000)
commit719bc0e826317d22c0687cf919e97749fa53d54a
treeaa6de7298aa461857d87f6daa52c7613f0fce9ee
parent8dc34b1f579f71f24aa385d33112da4a91db7079
Fix EVP_CIPHER_CTX_set_padding for legacy path

Fixes #13057

When using an engine, there is no cipher->prov so a call to
EVP_CIPHER_CTX_set_padding() returns an error when
evp_do_ciph_ctx_setparams() is called. For the legacy path it needs to
avoid doing the call and just return 1.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/13437)
crypto/evp/evp_enc.c