Bug 2141695
Summary: | In FIPS mode, openssl should reject KDF input and output key lengths < 112 bits or provide an indicator | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Clemens Lang <cllang> | ||||||
Component: | openssl | Assignee: | Clemens Lang <cllang> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Alicja Kario <hkario> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 9.0 | CC: | cllang, dbelyavs, hkario, ssorce | ||||||
Target Milestone: | rc | Keywords: | Triaged, ZStream | ||||||
Target Release: | --- | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | openssl-3.0.7-2.el9 | Doc Type: | No Doc Update | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 2144019 2144020 (view as bug list) | Environment: | |||||||
Last Closed: | 2023-05-09 08:20:47 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 2144019, 2144020 | ||||||||
Attachments: |
|
Description
Clemens Lang
2022-11-10 14:02:39 UTC
Created attachment 1923620 [details]
kdf.c
Re-reading "The use of HMAC-based KDFs is acceptable using a hash function specified in FIPS 180 or FIPS 202 with a key whose length is at least 112 bits", this obviously refers to the length of the key used for HMAC, not the length of the derived secret. The attached reproducer tested HKDF, which is only approved for use in TLS anyway. The restriction in SP 800-131Ar2 section 8 refers to KDFs defined in SP 800-108, which OpenSSL calls "key-based KDFs" and implements in EVP_KDF-KB(7), see https://www.openssl.org/docs/man3.0/man7/EVP_KDF-KB.html. I am attaching an updated reproducer that correctly uses KBKDF (in HMAC mode) and prints the indicator state, if supported. I verified that this correctly detects unapproved key lengths: $> $(head -n1 kdf.c | sed -E 's#^// ##g') && ./kdf sha256 16 $(( 112 / 8 )) $(( 112 / 8 )) OK (indicator: approved): 0xb7dfff7bf89bce1ecbb2eb979e $> $(head -n1 kdf.c | sed -E 's#^// ##g') && ./kdf sha256 16 $(( 112 / 8 - 1 )) $(( 112 / 8 )) OK (indicator: unapproved): 0x5e294ba2fd908be0c58fb8b86bb1 Note that testing with CMAC does not seem to be necessary, since CMAC requires a cipher that expects a fixed key length (e.g., 128 bits for AES-128 or 256 bits for AES-256). Created attachment 1925055 [details]
Updated reproducer that uses KBKDF and supports indicators
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Low: openssl security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:2523 |