Branch Coverage

blib/lib/Authen/WebAuthn.pm
Criterion Covered Total %
branch 72 124 58.0


line true false branch
78 0 9 if ($@)
83 0 9 unless ($client_data->{'type'} eq "webauthn.create")
89 0 9 unless ($challenge_b64)
93 1 8 unless ($challenge_b64 eq $client_data->{'challenge'})
102 0 8 unless ($client_data->{'origin'})
106 1 7 unless ($client_data->{'origin'} eq $self->origin)
133 0 7 unless ($authenticator_data)
137 0 7 unless ($authenticator_data->{'attestedCredentialData'})
144 1 6 unless ($authenticator_data->{'rpIdHash'} eq $hash_rp_id)
153 0 6 unless ($authenticator_data->{'flags'}{'userPresent'} == 1)
160 1 5 if ($requested_uv eq "required" and $authenticator_data->{'flags'}{'userVerified'} != 1)
182 0 5 unless (ref $attestation_function eq "CODE")
198 0 5 if $@
200 0 5 unless ($attestation_result->{'success'} == 1)
256 0 17 if $@
270 1 16 if ($@)
275 0 16 unless ($client_data->{'type'} eq "webauthn.get")
281 0 16 unless ($challenge_b64)
285 1 15 unless ($challenge_b64 eq $client_data->{'challenge'})
293 0 15 unless ($client_data->{'origin'})
297 1 14 unless ($client_data->{'origin'} eq $self->origin)
319 0 12 if ($extension_results->{'appid'}) { }
326 1 11 unless ($authenticator_data->{'rpIdHash'} eq $hash_rp_id)
335 0 11 unless ($authenticator_data->{'flags'}{'userPresent'} == 1)
342 1 10 if ($requested_uv eq "required" and $authenticator_data->{'flags'}{'userVerified'} != 1)
361 2 8 unless (&$credential_verifier($signature, $to_sign))
370 5 3 if ($signature_count > 0 or $stored_sign_count > 0)
371 2 3 if ($signature_count <= $stored_sign_count)
384 0 21 unless ($key->{'curve_name'} eq "secp256r1")
428 18 3 if (ref $client_data_token_binding ne "HASH")
434 3 0 if ($token_binding_status eq 'present') { }
439 3 0 if ($client_data_cbid_b64) { }
440 1 2 if ($client_data_cbid_b64 eq $connection_tbid_b64) { }
472 0 1 unless $$COSE_ALG{$cose_key->{'3'}}{'name'} eq "ES256"
488 0 17 unless ($curve_name)
554 0 18 unless ($alg_config)
560 0 18 unless ($key_type_config)
566 0 18 unless (ref $key_function eq "CODE")
572 0 18 unless ($public_key)
607 7 0 if ($alg) { }
618 7 0 if (length $aaguid == 16) { }
659 0 31 if ($len < $expected_len)
675 7 17 if ($res->{'flags'}{'atIncluded'})
684 0 24 if ($res->{'flags'}{'edIncluded'}) { }
687 0 0 if ($ext)
693 0 24 if length $ad > 37 + $attestedCredentialDataLength
746 0 1 unless $attestation_statement->{'alg'}
749 0 1 unless $attestation_statement->{'sig'}
754 1 0 if ($attestation_statement->{'x5c'}) { }
780 0 1 if $@
786 0 1 if $@
802 1 0 if (&$attestation_verifier($sig, $signed_value)) { }
827 0 0 unless $sign_alg
830 0 0 unless ($sign_alg eq $cose_alg)
839 0 0 if $@
843 0 0 if (&$credential_verifier($sig, $signed_value)) { }
865 0 1 unless $attestation_statement->{'sig'}
874 0 1 unless ($attestation_statement->{'x5c'} and ref $attestation_statement->{'x5c'} eq "ARRAY" and $attestation_statement->{'x5c'}[0])
889 0 1 if $@
891 0 1 if ($attestation_key->key2hash->{'curve_name'} ne "secp256r1")
908 0 1 if $@
918 1 0 if ($attestation_key->verify_message($sig, $verification_data, 'SHA256')) { }