9c827a49cc (master): [ruby/openssl] test_pkey_rsa.rb: Fix test_private_encoding_encrypted in OpenSSL 4.0 FIPS

0 views
Skip to first unread message

Jun Aruga

unread,
11:15 AM (8 hours ago) 11:15 AM
to ruby...@g.ruby-lang.org
Jun Aruga 2026-03-26 14:42:07 +0000 (Thu, 26 Mar 2026)

New Revision: 9c827a49cc

https://github.com/ruby/ruby/commit/9c827a49cc

Log:
[ruby/openssl] test_pkey_rsa.rb: Fix test_private_encoding_encrypted in OpenSSL 4.0 FIPS

OpenSSL 4.0.0 added a check for Password-Based Key Derivation Function 2
(PBKDF2) to require the minimal password length 8 in FIPS by the following
commit.
https://github.com/openssl/openssl/commit/71ed0fc8b3cdb33cd06059416686f8972ede0248

This commit fixes the following test failure in OpenSSL 4.0 FIPS by changing
testing password length from 6 to 8..

```
1) Error: test_private_encoding_encrypted(OpenSSL::TestPKeyRSA): OpenSSL::PKey::PKeyError: i2d_PKCS8PrivateKey_bio: encrypt error
/home/runner/work/openssl/openssl/test/openssl/test_pkey_rsa.rb:465:in `private_to_der'
/home/runner/work/openssl/openssl/test/openssl/test_pkey_rsa.rb:465:in `test_private_encoding_encrypted'
462:
463: def test_private_encoding_encrypted
464: rsa = Fixtures.pkey("rsa2048")
=> 465: encoded = rsa.private_to_der("aes-128-cbc", "abcdef")
466: asn1 = OpenSSL::ASN1.decode(encoded) # PKCS #8 EncryptedPrivateKeyInfo
467: assert_kind_of OpenSSL::ASN1::Sequence, asn1
468: assert_equal 2, asn1.value.size
Error: OpenSSL::PKey::PKeyError: i2d_PKCS8PrivateKey_bio: encrypt error
```

https://github.com/ruby/openssl/commit/69f8cd1af1

Modified files:
test/openssl/test_pkey_rsa.rb
Reply all
Reply to author
Forward
0 new messages