FIPS updated guidelines may be in conflict with our current indicator implementation. We may want to revamp them.
Description
Details
Revisions and Commits
Status | Assigned | Task | ||
---|---|---|---|---|
Open | • gniibe | T7338 Revamp the FIPS service indicator | ||
Testing | • gniibe | T7340 Introduced a context with thread local storage |
Event Timeline
New internal API is introduced with T7340 by the commit rCe1cf31232825: fips: Introduce an internal API for FIPS service indicator.
New external API is by GCRYCTL_FIPS_SERVICE_INDICATOR and/or the new macro gcry_get_fips_service_indicator.
This change is pushed by rCf51f4e98930e: fips: Introduce GCRYCTL_FIPS_SERVICE_INDICATOR and the macro.
A change for gcry_md_hash_* functions are pushed by rC3478caac62c7: fips,md: Implement new FIPS service indicator for gcry_md_hash_*..
It doesn't have tests with FIPS service indicator yet.
It seems that the internal API (as of 2024-12-06) is not enough.
Now, we have _gcry_md_hash_buffer function with the new FIPS service indicator.
It's used for public key crypto, too.
The compliance for hash function is a part of public key crypto, but not all.
Perhaps, something like following would be needed:
- at function entry (visibility.c): fips_service_indicator(COMPONENT_BITS_TO_BE_MARKED) (like CIPHER_BIT, PK_BIT, MD_BIT, etc.), sets bits
- inside implementation: fips_service_indicator_mark_sucess(is_compliant, COMPNENT_BIT_FOR_the_function) clears a single bit
- 0 means all success, !=0 means something goes wrong
Pushed the change for adding hash tests in rC7faf542f1573: fips,tests: Add t-digest.
Next, we fix hmac.
Then, it found that we need to revise the change for: T6376: FIPS 140-3: add explicit indicators for md and mac to unblock MD5 in apt
My idea in https://dev.gnupg.org/T7338#195529 doesn't work well when a function call is done multiple times.
Assuming SUCCESS, and marking all non-compliant places in the code works, and it would be good because libgcrypt so far maintains non-compliant path with rejection.