Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve output length checking for FIPS indicators in AES/HMAC code #138

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Jakuje
Copy link
Contributor

@Jakuje Jakuje commented Jan 3, 2025

There were several issues:

  • The check_mac_fips_indicators() won't do anything for the CMACs, as the cmac implementation in FIPS provider does not implement the fips indicator OSSL_PARAM.
  • The AES key with SIGN/VERIFY flags was also not marked correctly as FIPS valid so any CMAC operation on that given key caused the FIPS indicator failure.
  • Adding explicit tag/mac length checks for CMAC and GCM
  • Ignoring CCM and KMAC as I think we do not certify these

I am still not sure about the GCM as the specs are vague. Putting 64b for now.

Jakuje added 4 commits January 2, 2025 18:41
Signed-off-by: Jakub Jelen <[email protected]>
The check_mac_fips_indicators() won't do anything for the CMACs,
as the cmac implementation in FIPS provider does not implement this
parameter.

The AES key with SIGN/VERIFY flags was also not marked correctly as FIPS
valid so any CMAC operation on that given key caused the FIPS indicator
failure.

Signed-off-by: Jakub Jelen <[email protected]>
* > For most applications, a value for Tlen that is at least 64
* should provide sufficient protection against guessing attacks.
*/
self.fips_approved = Some(self.maclen >= (32 / 8));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended to use 32 or 64 bits here? The comment seems to reference 64 bits but the code uses 32 bits.

@jvdsn
Copy link

jvdsn commented Jan 3, 2025

For what it's worth, if you're ever thinking about certifying KMAC, OpenSSL < 3.4 doesn't have a check. OpenSSL 3.4+ should have a check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants