Skip to content

Commit

Permalink
Merge pull request #424 from cedarcode/sr--fix-tests-failing-with-ope…
Browse files Browse the repository at this point in the history
…nssl3

Fix tests failing with OpenSSL v3
  • Loading branch information
santiagorodriguez96 authored Mar 8, 2024
2 parents 1370722 + cdd432d commit f030a78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions spec/webauthn/attestation_statement/packed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
let(:algorithm) { -7 }
let(:attestation_key) { create_ec_key }
let(:signature) { attestation_key.sign("SHA256", to_be_signed) }
let(:attestation_certificate_version) { 2 }
let(:attestation_certificate_subject) { "/C=UY/O=ACME/OU=Authenticator Attestation/CN=CN" }
let(:attestation_certificate_basic_constraints) { "CA:FALSE" }
let(:attestation_certificate_start_time) { Time.now - 1 }
Expand All @@ -103,7 +102,7 @@
root_certificate,
root_key,
attestation_key,
version: attestation_certificate_version,
version: 2,
name: attestation_certificate_subject,
not_before: attestation_certificate_start_time,
not_after: attestation_certificate_end_time,
Expand Down Expand Up @@ -187,7 +186,9 @@

context "when the attestation certificate doesn't meet requirements" do
context "because version is invalid" do
let(:attestation_certificate_version) { 1 }
before do
attestation_certificate.version = 1
end

it "fails" do
expect(statement.valid?(authenticator_data, client_data_hash)).to be_falsy
Expand Down
7 changes: 4 additions & 3 deletions spec/webauthn/attestation_statement/tpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
root_certificate,
root_key,
aik,
version: aik_certificate_version,
version: 2,
name: aik_certificate_subject,
not_before: aik_certificate_start_time,
not_after: aik_certificate_end_time,
Expand All @@ -49,7 +49,6 @@
end

let(:aik) { create_rsa_key }
let(:aik_certificate_version) { 2 }
let(:aik_certificate_subject) { "" }
let(:aik_certificate_basic_constraints) { "CA:FALSE" }
let(:aik_certificate_extended_key_usage) { ::TPM::AIKCertificate::OID_TCG_KP_AIK_CERTIFICATE }
Expand Down Expand Up @@ -361,7 +360,9 @@

context "when the AIK certificate doesn't meet requirements" do
context "because version is invalid" do
let(:aik_certificate_version) { 1 }
before do
aik_certificate.version = 1
end

it "returns false" do
expect(statement.valid?(authenticator_data, client_data_hash)).to be_falsy
Expand Down

0 comments on commit f030a78

Please sign in to comment.