Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fail with OpenSSL 3.3.0 and mingw #744

Open
hsbt opened this issue Apr 24, 2024 · 5 comments
Open

Test fail with OpenSSL 3.3.0 and mingw #744

hsbt opened this issue Apr 24, 2024 · 5 comments

Comments

@hsbt
Copy link
Member

hsbt commented Apr 24, 2024

I found test fails with OpenSSL 3.3.0 on mingw environment

https://github.com/ruby/ruby/actions/runs/8806703011/job/24172105094?pr=10610

    2) Error:
  OpenSSL::TestASN1#test_generalizedtime:
  OpenSSL::ASN1::ASN1Error: generalizedtime is too short
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:700:in `decode'
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:700:in `decode_test'
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:435:in `test_generalizedtime'
  
    3) Error:
  OpenSSL::TestASN1#test_utctime:
  OpenSSL::ASN1::ASN1Error: utctime is too short
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:700:in `decode'
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:700:in `decode_test'
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:408:in `test_utctime'
@MSP-Greg
Copy link
Contributor

@hsbt

I ran the test file locally, and it passed. Also, ruby-loco's test-all in CI is passing.

I added a mingw job to this repo, and ran CI in my fork. All three ruby-loco builds passed. See https://github.com/MSP-Greg/ruby-openssl/actions/runs/8810008077, they're the last three jobs in the list (ucrt, mswin, & mingw).

Both MSYS2 (ucrt & mingw) and mswin (vcpkg) have updated to OpenSSL 3.3.0.

Tonite is not the best night for digging into this issue, I'll be able to check tomorrow, (if it hasn't been fixed)

It would seem this is particular to ruby/ruby CI...

@MSP-Greg
Copy link
Contributor

Ignore everything above. The CI run that you listed is a backport to Ruby 3.1.x, and Windows 3.1 has always used OpenSSL 1.1.1, so it should be using the 1.1.1 build tool archive files. For some reason it's using the 3.x archives files. That's something in setup-ruby.

See https://github.com/ruby/ruby/actions/runs/8806703011/job/24172105094?pr=10610#step:6:38, which shows 'ucrt64-3.0 build tools'. Thats the archive that contains OpenSSL 3.x.

I just ran Puma CI in my fork, and the Windows Ruby 3.1 job is using the correct archives. Also, the Windows CI job I mentioned above is using the correct archives on the Windows 3.1 job. See https://github.com/MSP-Greg/ruby-openssl/actions/runs/8810008077/job/24181704227#step:3:21, which shows 'ucrt64 build tools'.

I'll look at it tomorrow and see if I can repro it.

@junaruga
Copy link
Member

I found test fails with OpenSSL 3.3.0 on mingw environment

https://github.com/ruby/ruby/actions/runs/8806703011/job/24172105094?pr=10610

    2) Error:
  OpenSSL::TestASN1#test_generalizedtime:
  OpenSSL::ASN1::ASN1Error: generalizedtime is too short
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:700:in `decode'
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:700:in `decode_test'
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:435:in `test_generalizedtime'
  
    3) Error:
  OpenSSL::TestASN1#test_utctime:
  OpenSSL::ASN1::ASN1Error: utctime is too short
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:700:in `decode'
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:700:in `decode_test'
      D:/a/ruby/ruby/src/test/openssl/test_asn1.rb:408:in `test_utctime'

I found the reason. The CI log's PR ruby/ruby#10610 is for the ruby_3_1 branch.

And we need to backport this commit ruby/ruby@dd5e625 (2e826d5) on the ruby/ruby's master branch into the stable branches: ruby_3_3, ruby_3_2, ruby_3_1 ruby_3_0 branches when we want to pass the tests on the branches.

@junaruga
Copy link
Member

I think this issue can generally happen in OpenSSL 3.3.0. Not only mingw.

@rhenium
Copy link
Member

rhenium commented Apr 26, 2024

#728 needs backport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants