[openssl/openssl] 4f5feb: Add FIPS indicator to CMAC.
Shane
noreply at github.com
Tue Jul 30 23:05:59 UTC 2024
Branch: refs/heads/master
Home: https://github.com/openssl/openssl
Commit: 4f5febe2c684a803553171940634c1b6f4b7ba40
https://github.com/openssl/openssl/commit/4f5febe2c684a803553171940634c1b6f4b7ba40
Author: slontis <shane.lontis at oracle.com>
Date: 2024-07-31 (Wed, 31 Jul 2024)
Changed paths:
M crypto/cmac/cmac.c
M doc/man7/EVP_MAC-CMAC.pod
A include/crypto/cmac.h
M providers/common/include/prov/fipsindicator.h
M providers/implementations/macs/cmac_prov.c
M test/recipes/30-test_evp_data/evpmac_cmac_des.txt
Log Message:
-----------
Add FIPS indicator to CMAC.
There is a issue currently related to CMAC TDES, when the new provider
is tested against older branches.
The new strict check caused backwards compatibility issues when
using old branch with the new FIPS provider.
To get around this CMAC now allows TDES by default, but it can be either
enabled via config or a settable. (i.e it uses an indicator)
Where the TDES cipher check can be done turned out to be problematic.
Shifting the check in the TDES cipherout of the init doesnt work because
ciphers can run thru either final or cipher (and checking on every
cipher call seemed bad). This means it needs to stay in the cipher init.
So the check needs to be done in CMAC BEFORE the underlying TDES cipher
does it check.
When using an indicator the TDES cipher needs its "encrypt-check" set
so that needs to be propagated from the CMAC object. This requires
the ability to set the param at the time the cipher ctx is inited.
An internal function was required in order to pass params to CMAC_Init.
Note also that the check was done where it is, because EVP_Q_mac() calls
EVP_MAC_CTX_set_params(ctx, cipher_param)
EVP_MAC_CTX_set_params(ctx, params)
EVP_MAC_init(ctx, key, keylen, params)
Where the second call to set_params would set up "encrypt-check" after
"cipher".
Reviewed-by: Neil Horman <nhorman at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25022)
To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications
More information about the openssl-commits
mailing list