summaryrefslogtreecommitdiffstats
path: root/providers/implementations/ciphers
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2021-05-27 10:08:53 +0200
committerShane Lontis <shane.lontis@oracle.com>2021-06-01 07:22:30 +0200
commite2311445bbfc9e2a6ff05e467cf13475b058d0a2 (patch)
treefcb1072a80cc78fdaa5dc6685a7d4d0968c21106 /providers/implementations/ciphers
parentadd some cross compilation builds (diff)
downloadopenssl-e2311445bbfc9e2a6ff05e467cf13475b058d0a2.tar.xz
openssl-e2311445bbfc9e2a6ff05e467cf13475b058d0a2.zip
Fix aes cfb1 so that it can operate in bit mode.
The code to handle the cipher operation was already in the provider. It just needed a OSSL_PARAM in order to set this into the algorithm. EVP_CIPHER_CTX_set_flags() has been modified to pass the OSSL_PARAM. Issue reported by Mark Powers from Acumen. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15496)
Diffstat (limited to 'providers/implementations/ciphers')
-rw-r--r--providers/implementations/ciphers/ciphercommon.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/providers/implementations/ciphers/ciphercommon.c b/providers/implementations/ciphers/ciphercommon.c
index f84f7a36c2..3c8ea8c03c 100644
--- a/providers/implementations/ciphers/ciphercommon.c
+++ b/providers/implementations/ciphers/ciphercommon.c
@@ -95,6 +95,7 @@ CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_START(ossl_cipher_generic)
CIPHER_DEFAULT_GETTABLE_CTX_PARAMS_END(ossl_cipher_generic)
CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_START(ossl_cipher_generic)
+OSSL_PARAM_uint(OSSL_CIPHER_PARAM_USE_BITS, NULL),
OSSL_PARAM_uint(OSSL_CIPHER_PARAM_TLS_VERSION, NULL),
OSSL_PARAM_size_t(OSSL_CIPHER_PARAM_TLS_MAC_SIZE, NULL),
CIPHER_DEFAULT_SETTABLE_CTX_PARAMS_END(ossl_cipher_generic)
@@ -598,6 +599,16 @@ int ossl_cipher_generic_set_ctx_params(void *vctx, const OSSL_PARAM params[])
}
ctx->pad = pad ? 1 : 0;
}
+ p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_USE_BITS);
+ if (p != NULL) {
+ unsigned int bits;
+
+ if (!OSSL_PARAM_get_uint(p, &bits)) {
+ ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
+ return 0;
+ }
+ ctx->use_bits = bits ? 1 : 0;
+ }
p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS_VERSION);
if (p != NULL) {
if (!OSSL_PARAM_get_uint(p, &ctx->tlsversion)) {