-
Notifications
You must be signed in to change notification settings - Fork 60
WebAuthn::U2fMigrator returns the attestation certificate
spec failing with OpenSSL v3.3+
#463
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
Comments
It seems that there's an issue when trying to build an require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "activesupport", "~> 8.0.0"
gem "minitest", "~> 5.25.0"
gem "openssl", "~> 3.3.0"
gem "base64", "~> 0.2.0"
end
require "openssl"
require "base64"
require "active_support"
require "minitest/autorun"
class BugTest < ActiveSupport::TestCase
def test_1
puts "======================================================"
puts "OpenSSL library version is: #{OpenSSL::OPENSSL_VERSION}"
puts "======================================================"
puts
OpenSSL::X509::Certificate.new(Base64.strict_decode64(<<~CERT.strip))
MIIBNDCB26ADAgECAgp2ubKB51u9YwjcMAoGCCqGSM49BAMCMBUxEzARBgNVBAMTClUyRiBJc3N1ZXIwGhcLMDAwMTAxMDAwMFoXCzAwMDEwMTAwMDBaMBUxEzARBgNVBAMTClUyRiBEZXZpY2UwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQfqziP5Gobu7FmIoFH0WCaD15knMWpIiLgeero1dVBVt2qo62PNI6GktGDUkzCwoj5pENTzTFVDUqAZTHDHTN1oxcwFTATBgsrBgEEAYLlHAIBAQQEAwIFIDAKBggqhkjOPQQDAgNIADBFAiEAwaOmji8WpyFGJwV/YrtyjJ4D56G6YtBGUk5FbSwvP3MCIAtfeOURqhgSn28jbZITIn2StOZ+31PoFt+wXZ3IuQ/e
CERT
end
end
<<-OUTPUT
# Running:
======================================================
OpenSSL library version is: OpenSSL 3.4.1 11 Feb 2025
======================================================
E
Finished in 0.000562s, 1779.3592 runs/s, 0.0000 assertions/s.
1) Error:
BugTest#test_1:
OpenSSL::X509::CertificateError: PEM_read_bio_X509: no start line (Expecting: CERTIFICATE)
repro.rb:23:in `initialize'
repro.rb:23:in `new'
repro.rb:23:in `test_1'
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
OUTPUT |
I tried spinning up a I think the issue might be related to the way the certificates associated with the keys were generated? |
The issue seems to be related to the fact that the certificate do not start with the
This is the script that I used to reproduce it: require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "activesupport", "~> 8.0.0"
gem "minitest", "~> 5.25.0"
gem "openssl", "~> 3.3.0"
gem "base64", "~> 0.2.0"
end
require "openssl"
require "base64"
require "active_support"
require "minitest/autorun"
class BugTest < ActiveSupport::TestCase
def test_1
puts "======================================================"
puts "OpenSSL library version is: #{OpenSSL::OPENSSL_VERSION}"
puts "======================================================"
puts
raw_cert = <<~CERT.strip
-----BEGIN CERTIFICATE-----
MIIBNDCB26ADAgECAgp2ubKB51u9YwjcMAoGCCqGSM49BAMCMBUxEzARBgNVBAMTClUyRiBJc3N1ZXIwGhcLMDAwMTAxMDAwMFoXCzAwMDEwMTAwMDBaMBUxEzARBgNVBAMTClUyRiBEZXZpY2UwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQfqziP5Gobu7FmIoFH0WCaD15knMWpIiLgeero1dVBVt2qo62PNI6GktGDUkzCwoj5pENTzTFVDUqAZTHDHTN1oxcwFTATBgsrBgEEAYLlHAIBAQQEAwIFIDAKBggqhkjOPQQDAgNIADBFAiEAwaOmji8WpyFGJwV/YrtyjJ4D56G6YtBGUk5FbSwvP3MCIAtfeOURqhgSn28jbZITIn2StOZ+31PoFt+wXZ3IuQ/e
-----END CERTIFICATE-----
CERT
certificate = OpenSSL::X509::Certificate.new raw_cert
end
end
<<-OUTPUT
# Running:
======================================================
OpenSSL library version is: OpenSSL 3.4.1 11 Feb 2025
======================================================
E
Finished in 0.000724s, 1381.2156 runs/s, 0.0000 assertions/s.
1) Error:
BugTest#test_1:
OpenSSL::X509::CertificateError: PEM_read_bio_X509: ASN1 lib
repro.rb:28:in `initialize'
repro.rb:28:in `new'
repro.rb:28:in `test_1'
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
OUTPUT |
@bdewater perhaps you can shed more light on this issue 🙂 |
Ruby 3.4 and OpenSSSL 3.4:
Ruby 3.3 and OpenSSL 3.3
Ruby 3.4 and OpenSSL 3.2
The text was updated successfully, but these errors were encountered: