diff options
author | Matt Caswell <matt@openssl.org> | 2019-04-10 13:54:38 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-04-19 09:31:54 +0100 |
commit | dcd446f1005f5c99768965a11c10dd6c7b6aee59 (patch) | |
tree | bc3c8ad02a8539c4534a3db254aeabbf2723eac5 | |
parent | 3b94944cf2d6476d1b8ac7949bf8b28abb644426 (diff) |
Make implementation of blocksize, iv_length and key_length mandatory
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8700)
-rw-r--r-- | crypto/evp/evp_enc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 69cd577800..4426a81629 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -1109,12 +1109,16 @@ static void *evp_cipher_from_dispatch(int nid, const OSSL_DISPATCH *fns, } if ((fnciphcnt != 0 && fnciphcnt != 3 && fnciphcnt != 4) || (fnciphcnt == 0 && cipher->ccipher == NULL) - || fnctxcnt != 2) { + || fnctxcnt != 2 + || cipher->blocksize == NULL + || cipher->iv_length == NULL + || cipher->key_length == NULL) { /* * In order to be a consistent set of functions we must have at least * a complete set of "encrypt" functions, or a complete set of "decrypt" * functions, or a single "cipher" function. In all cases we need a - * complete set of context management functions + * complete set of context management functions, as well as the + * blocksize, iv_length and key_length functions. */ EVP_CIPHER_meth_free(cipher); EVPerr(EVP_F_EVP_CIPHER_FROM_DISPATCH, EVP_R_INVALID_PROVIDER_FUNCTIONS); |