Home GnuPG

random: Get maximum 32B of entropy at once in FIPS Mode

Description

random: Get maximum 32B of entropy at once in FIPS Mode

* random/rndgetentropy.c (_gcry_rndgetentropy_gather_random): In fips
mode, gather max 32 B of strong entropy for initialization.

The limitation of our current kernel patch guarantees that only 32B of
strong random data can be gathered using getrandom().

  • Signed-off-by: Jakub Jelen <jjelen@redhat.com>

Details

Auditors
werner
Provenance
JakujeAuthored on Sep 26 2022, 6:45 PM
gniibeCommitted on Oct 4 2022, 6:52 AM
Parents
rC567bc62e1c30: tests: Avoid memory leak
Branches
Unknown
Tags
Unknown

Event Timeline

Why is that not stated in my man page which knows about kernel 3.19? Is that a regression or a RedHat specific patch?

Why is that not stated in my man page which knows about kernel 3.19? Is that a regression or a RedHat specific patch?

Right now, this is specific only to RHEL kernel, which has this limitation to satisfy the FIPS DRBG chaining requirements. It is not applicable to generic kernel, but whoever will want to make kernel/libgcrypt fips compliant will need some changes to the DRBG anyway.

I initially did not propose this change here, only in https://gitlab.com/redhat-crypto/libgcrypt/libgcrypt-mirror/-/merge_requests/7 to give it some test-ride because of the above.

Given that, I do not insist on having this in upstream, but the previous change aab1d63e4def on its own is not solving the requirement either so we can do one of the following:

  • revert both of these commits and keep it on the downstream patch
  • keep both of the patches and clarify this in comments. I would have to check if we have already some reference for the upstream kernel for this

A minor clarification in the code comment would be enough. Something like: Some non-standard kernel return only 32 bytes of strong entropy to satisfy current FIPS requirements.

I tried to clarify the comment in the following merge request. Feel free to pull it from there or adjust if it is too verbose or missing some points:

https://gitlab.com/redhat-crypto/libgcrypt/libgcrypt-mirror/-/merge_requests/7

That's more than sufficient. Thanks.

All concerns with this commit have now been addressed.Oct 6 2022, 3:07 PM