File tree Expand file tree Collapse file tree
lib/webauthn/attestation_statement
spec/webauthn/attestation_statement Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,12 +6,18 @@ module WebAuthn
66 module AttestationStatement
77 class None < Base
88 def valid? ( *_args )
9- if statement == { }
9+ if statement == { } && trustworthy?
1010 [ WebAuthn ::AttestationStatement ::ATTESTATION_TYPE_NONE , nil ]
1111 else
1212 false
1313 end
1414 end
15+
16+ private
17+
18+ def attestation_type
19+ WebAuthn ::AttestationStatement ::ATTESTATION_TYPE_NONE
20+ end
1521 end
1622 end
1723end
Original file line number Diff line number Diff line change 3131 expect ( WebAuthn ::AttestationStatement ::None . new ( [ ] ) . valid? ( authenticator_data , nil ) ) . to be_falsy
3232 expect ( WebAuthn ::AttestationStatement ::None . new ( "a" => "b" ) . valid? ( authenticator_data , nil ) ) . to be_falsy
3333 end
34+
35+ it "returns false if None is not among the acceptable attestation types" do
36+ WebAuthn . configuration . acceptable_attestation_types = [ 'AttCA' ]
37+
38+ expect ( WebAuthn ::AttestationStatement ::None . new ( { } ) . valid? ( authenticator_data , nil ) ) . to be_falsy
39+ end
3440 end
3541end
You can’t perform that action at this time.
0 commit comments