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

Merged
merged 4 commits into from
Jan 6, 2025

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.

src/ossl/aes.rs Outdated Show resolved Hide resolved
@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.

Copy link
Member

@simo5 simo5 left a comment

Choose a reason for hiding this comment

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

Only nits, otherwise this looks good to me, any reason why it is still in draft ?

src/ossl/aes.rs Outdated Show resolved Hide resolved
src/ossl/aes.rs Outdated Show resolved Hide resolved
Jakuje added 2 commits January 6, 2025 18:19
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
@Jakuje Jakuje marked this pull request as ready for review January 6, 2025 17:25
Jakuje added 2 commits January 6, 2025 21:11
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 <jjelen@redhat.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
@simo5
Copy link
Member

simo5 commented Jan 6, 2025

Looks good, feel free to push once tests pass

@Jakuje Jakuje merged commit 3059c26 into latchset:main Jan 6, 2025
19 checks passed
@Jakuje
Copy link
Contributor Author

Jakuje commented Jan 6, 2025

All green. Merged.

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.

3 participants