Skip to content

Commit

Permalink
refactor: update apple statement using openssl v2.2 methods
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Mar 14, 2021
1 parent ef1440d commit a344850
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/webauthn/attestation_statement/apple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def valid?(authenticator_data, client_data_hash)
private

def valid_nonce?(authenticator_data, client_data_hash)
extension = cred_cert&.extensions&.detect { |ext| ext.oid == NONCE_EXTENSION_OID }
extension = cred_cert&.find_extension(NONCE_EXTENSION_OID)

if extension
sequence = OpenSSL::ASN1.decode(OpenSSL::ASN1.decode(extension.to_der).value[1].value)
sequence = OpenSSL::ASN1.decode(extension.value_der)

sequence.tag == OpenSSL::ASN1::SEQUENCE &&
sequence.value.size == 1 &&
Expand Down

0 comments on commit a344850

Please sign in to comment.