cedarcode / webauthn-ruby

WebAuthn ruby server library ― Make your Ruby/Rails web server become a conformant WebAuthn Relying Party
https://rubygems.org/gems/webauthn
MIT License
644 stars 51 forks source link

Fix tests failing with OpenSSL v3 #424

Closed santiagorodriguez96 closed 5 months ago

santiagorodriguez96 commented 6 months ago

Fixes #417.

Some tests fail when using OpenSSL v3. The issue is that, for testing the valid? method for attestation statements, we set up a certificate to have an invalid version (version is 1 initially) and expect the attestation statement to not be valid. But when setting up the certificate we have to sign it which, in newer versions of OpenSSL, updates the version to a valid one (version changes to be 2), thus causing the expectation to not be met and therefore the spec to fail.

This PR fixes the issue by changing the version after the certificate has been signed.

santiagorodriguez96 commented 6 months ago

@bdewater I took a different approach than the ones were discussed here, let me know what you think!