Conversation
OpenSSL's master branch is changing functions to return const pointers where the returned objects are not meant to be modified by the caller. Update ossl_*_new() to take const pointers accordingly. Unfortunately, *_dup() in older versions of OpenSSL and in LibreSSL/AWS-LC take non-const pointers, so const casts are required.
ossl_ec_new() was removed in commit 94aeab2 (pkey: simplify ossl_pkey_new(), 2017-03-16), but it forgot to remove the declaration while doing so.
ASN1_STRING has been made opaque in OpenSSL's master branch. Use the new accessor functions instead of accessing fields directly. Other uses of ASN1_STRING fields were already updated in <ruby#978>. This patch converts the remaining ones, which require the new functions added in OpenSSL 4.0 and were not available at that time.
OpenSSL master added support for RFC 7919 groups in TLS 1.2. They are preferred over SSLContext#tmp_dh= or #tmp_dh_callback= values if the client advertises them in the supported_groups extension.
|
Here is the error. https://github.com/ruby/openssl/actions/runs/23562768731/job/68606686661?pr=1019#step:11:590 |
|
I got the following CI log when I ran without the 5th commit (my commit) now. Interestingly there is no error about https://github.com/junaruga/ruby-openssl/actions/runs/23566877802/job/68620449742 |
|
There are differences between my local and GitHub Actions openssl-master environment. The differences may make the GitHub Actions specific test failure. My localOS: Fedora Linux 43 Ruby version GitHub Actions openssl-masterOS: Ubuntu 24.04.4 LTS Ruby version: |
|
Oh I just noticed the https://github.com/ruby/openssl/actions/runs/23562768731/job/68606686661?pr=1019#step:11:600 |
|
For the It seems the test failed because the length of the password ( The stack trace is below. |
528c991 to
f909fd5
Compare
|
For the test failures in This is a reproducer. The |
|
However, I couldn't find which commit caused the error in the |
I am trying to run |
I found the first bad commit openssl/openssl@2ea6e78 caused the failure by Here are the command log. Apply the following patch based on #1005 to fix a compile error with OpenSSL 4.0 master branch. There are openssl/openssl commits where the Prepare the following script. bisect.sh |
f909fd5 to
6e409d2
Compare
|
Thanks for digging!
It appears to be leaking the error queue entry on a success path, which seems to me a simple oversight. Would you open an issue/send a patch to openssl/openssl? I don't think we have to introduce a workaround for the PKCS12 issue for now. |
All right. That makes sense. I will open an issue or send a patch to openssl/openssl, and will let you know here. |
6e409d2 to
52a0321
Compare
@rhenium I sent the patch openssl/openssl#30607 to openssl/openssl. I confirmed that the test_pkcs12.rb test passed with this patch. |
52a0321 to
82911b1
Compare
|
I rebased this PR changing my 5th commit. The 5th commit is a temporary workaround to fix this error. Hopefully my patch to openssl/openssl will be merged to the master branch and backported to the openssl-4.0 branch until OpenSSL 4.0.0 official release. |
… and later This commit is a temporary workaround for an error message printed in a valid case OpenSSL::PKCS12.create with PBE-SHA1-3DES. This commit fixes the following test failures in test/openssl/test_pkcs12.rb in OpenSSL 4.0.0-alpha1 and later versions. https://github.com/ruby/openssl/actions/runs/23093927984/job/67083113067?pr=1005 ``` 2) Failure: test_create_no_pass(OpenSSL::TestPKCS12) /home/runner/work/openssl/openssl/test/openssl/utils.rb:140:in `teardown' <[]> expected but was <["error:0308010C:digital envelope routines::unsupported"]> diff: ? ["error:0308010C:digital envelope routines::unsupported"] ``` The following OpenSSL commit triggered the test failures. openssl/openssl@2ea6e78
…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. openssl/openssl@71ed0fc 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 ruby#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 ```
82911b1 to
ff13d3b
Compare
|
I think we can merge the 5th commit of the |
|
I'd prefer not to pollute our git blame history for an issue that only exists in their development branches. If the fix doesn't make it into the final release, I think a better course of action might be to just skip PKCS12 tests. However, I'm fairly optimistic it can be merged since the final release appears to be 2 weeks away. I think other changes are good to merge now. |
This PR is based on the #1005, fixing the following test failures with OpenSSL master case. I don't intend to merge this PR. It's just show the result of the CI. I added the 5th commit on the #1005.
Use AES-256-CBC for OpenSSL to avoid errors on the error stack with OpenSSL 4.0. LibreSSL and AWS-LC don't support AES-256-CBC well, so use PBE-SHA1-3DES for them.
I haven't checked which commit of the openssl/openssl master branch caused the error.
This commit fixes the following test failures.
https://github.com/ruby/openssl/actions/runs/23093927984/job/67083113067?pr=1005
However, I see other kind of test failure. I cannot reproduce this failure on my local, even when using the same commit of the OpenSSL openssl/openssl@5f084f8.
https://github.com/junaruga/ruby-openssl/actions/runs/23562223843/job/68604792678#step:11:590