Bug 1759982 (rhel9-modern-pkcs12)

Summary: Use modern algorithms in PKCS#12 files by default
Product: Red Hat Enterprise Linux 9 Reporter: Hubert Kario <hkario>
Component: distributionAssignee: RHEL Program Management <pm-rhel>
Status: CLOSED CURRENTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 9.0CC: jwboyer
Target Milestone: pre-dev-freezeKeywords: Tracking
Target Release: 9.0 Alpha   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-16 13:56:06 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: 1759983, 1764196, 1764198, 1764199, 1764205    
Bug Blocks:    

Description Hubert Kario 2019-10-09 14:35:42 UTC
Description of problem:
The common encryption settings for PKCS#12 files is to use pbeWithSHA1And40BitRC2-CBC algorithm (a.k.a PBE-SHA1-RC2-40) for encrypting the certificate and pbeWithSHA1And3-KeyTripleDES-CBC algorithm (a.k.a PBE-SHA1-2DES)  for encrypting the key.
Both of those algorithms are very old and far from currently recommended cryptographic practice. If we want to remove them in the future, we need to first not create more files encrypted using those algorithms.

Version-Release number of selected component (if applicable):
RHEL-8

How reproducible:
always

Steps to Reproduce:
1. export or create PKCS#12 file with keys
2. openssl pkcs12 -passin pass: -passout pass: -in /tmp/cert.p12 -out /dev/null -info -noout
3.

Actual results:
File encrypted with pbeWithSHA1And40BitRC2-CBC and pbeWithSHA1And3-KeyTripleDES-CBC

Expected results:
The file should use AES-128-CBC with PBKDF2 and SHA-256:

MAC: sha256, Iteration 600000
MAC length: 32, salt length: 8
PKCS7 Encrypted data: PBES2, PBKDF2, AES-128-CBC, Iteration 600000, PRF hmacWithSHA256
Certificate bag
PKCS7 Data
Shrouded Keybag: PBES2, PBKDF2, AES-128-CBC, Iteration 600000, PRF hmacWithSHA256

Additional info:
This is a tracking bug, it applies to all applications and libraries that produce PKCS#12 files.

It is not about removing support for old algorithms, just about changing the defaults. Since this change is expected to bring interoperability issues, we do not want to perform it during RHEL-8 life, but introduce it with next major release.

Increasing the iteration count above 600K is not recommended, it's known to cause interoperability issues with Windows (that is their maximum), see https://bugzilla.mozilla.org/show_bug.cgi?id=1278071#c31

This change will also automatically make the PKCS#12 files compatible with FIPS.

Comment 1 Hubert Kario 2021-04-21 16:53:16 UTC
Note: OpenSSL 3.0 requires 128 bit long salt for PBKDF2 when running in FIPS mode.

Comment 2 Hubert Kario 2022-03-16 13:56:06 UTC
All the relevant bugs have been created, core crypto libraries have been updated, closing as done.