summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-02-03 15:30:05 +0000
committerMatt Caswell <matt@openssl.org>2020-02-05 09:40:02 +0000
commitd8d4e5fb32b3f7d9af28d21ce4c1c46cc1c7614c (patch)
treedf5c462ad4e255f600dceb3d6be80537cc8a63c9
parent8f2fe32df26244da7c76ecc691e29c0777648d21 (diff)
Fix no-multiblock
Minor fixes to resolve compilation errors with the no-multiblock Configure option. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11004)
-rw-r--r--providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
index f6f4cb339d..0810b84f21 100644
--- a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
+++ b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
@@ -69,9 +69,11 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
PROV_AES_HMAC_SHA_CTX *ctx = (PROV_AES_HMAC_SHA_CTX *)vctx;
PROV_CIPHER_HW_AES_HMAC_SHA *hw =
(PROV_CIPHER_HW_AES_HMAC_SHA *)ctx->hw;
- EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param;
- const OSSL_PARAM *p, *p1, *pin;
+ const OSSL_PARAM *p;
int ret = 1;
+# if !defined(OPENSSL_NO_MULTIBLOCK)
+ EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param;
+# endif
p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_MAC_KEY);
if (p != NULL) {
@@ -101,8 +103,8 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
*/
p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD);
if (p != NULL) {
- p1 = OSSL_PARAM_locate_const(params,
- OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
+ const OSSL_PARAM *p1 = OSSL_PARAM_locate_const(params,
+ OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
if (p->data_type != OSSL_PARAM_OCTET_STRING
|| p1 == NULL
|| !OSSL_PARAM_get_uint(p1, &mb_param.interleave)) {
@@ -126,10 +128,11 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
*/
p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC);
if (p != NULL) {
- p1 = OSSL_PARAM_locate_const(params,
- OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
- pin = OSSL_PARAM_locate_const(params,
- OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN);
+ const OSSL_PARAM *p1 = OSSL_PARAM_locate_const(params,
+ OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
+ const OSSL_PARAM *pin = OSSL_PARAM_locate_const(params,
+ OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN);
+
if (p->data_type != OSSL_PARAM_OCTET_STRING
|| pin == NULL
|| pin->data_type != OSSL_PARAM_OCTET_STRING
@@ -175,13 +178,13 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
static int aes_get_ctx_params(void *vctx, OSSL_PARAM params[])
{
PROV_AES_HMAC_SHA_CTX *ctx = (PROV_AES_HMAC_SHA_CTX *)vctx;
- PROV_CIPHER_HW_AES_HMAC_SHA *hw =
- (PROV_CIPHER_HW_AES_HMAC_SHA *)ctx->hw;
OSSL_PARAM *p;
# if !defined(OPENSSL_NO_MULTIBLOCK)
p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE);
if (p != NULL) {
+ PROV_CIPHER_HW_AES_HMAC_SHA *hw =
+ (PROV_CIPHER_HW_AES_HMAC_SHA *)ctx->hw;
size_t len = hw->tls1_multiblock_max_bufsize(ctx);
if (!OSSL_PARAM_set_size_t(p, len)) {