Skip to content

Commit

Permalink
update tpm-key_attestation runtime dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Jul 6, 2022
1 parent ba3028a commit f8476eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/webauthn/attestation_statement/tpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def valid_key_attestation?(certified_extra_data, key, aaguid)
OpenSSL::Digest.digest(cose_algorithm.hash_function, certified_extra_data),
signature_algorithm: tpm_algorithm[:signature],
hash_algorithm: tpm_algorithm[:hash],
root_certificates: root_certificates(aaguid: aaguid)
trusted_certificates: root_certificates(aaguid: aaguid)
)

key_attestation.valid? && key_attestation.key && key_attestation.key.to_pem == key.to_pem
Expand All @@ -54,7 +54,7 @@ def valid_certificate_chain?(**_)
end

def default_root_certificates
::TPM::KeyAttestation::ROOT_CERTIFICATES
::TPM::KeyAttestation::TRUSTED_CERTIFICATES
end

def tpm_algorithm
Expand Down
6 changes: 3 additions & 3 deletions spec/webauthn/attestation_statement/tpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@

around do |example|
silence_warnings do
original_tpm_certificates = ::TPM::KeyAttestation::ROOT_CERTIFICATES
::TPM::KeyAttestation::ROOT_CERTIFICATES = tpm_certificates
original_tpm_certificates = ::TPM::KeyAttestation::TRUSTED_CERTIFICATES
::TPM::KeyAttestation::TRUSTED_CERTIFICATES = tpm_certificates
example.run
::TPM::KeyAttestation::ROOT_CERTIFICATES = original_tpm_certificates
::TPM::KeyAttestation::TRUSTED_CERTIFICATES = original_tpm_certificates
end
end

Expand Down
2 changes: 1 addition & 1 deletion webauthn.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "cose", "~> 1.1"
spec.add_dependency "openssl", ">= 2.2", "< 3.1"
spec.add_dependency "safety_net_attestation", "~> 0.4.0"
spec.add_dependency "tpm-key_attestation", "~> 0.10.0"
spec.add_dependency "tpm-key_attestation", "~> 0.11.0"

spec.add_development_dependency "bundler", ">= 1.17", "< 3.0"
spec.add_development_dependency "byebug", "~> 11.0"
Expand Down

0 comments on commit f8476eb

Please sign in to comment.