Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The attestation format none is unknown #15

Open
justin-jiajia opened this issue Jan 29, 2024 · 0 comments
Open

The attestation format none is unknown #15

justin-jiajia opened this issue Jan 29, 2024 · 0 comments

Comments

@justin-jiajia
Copy link

justin-jiajia commented Jan 29, 2024

#koesie10/webauthn-demo:1

When I was trying to register with Windows Hello, I got the following error:

image

then I added these code:

{
	Type:      protocol.PublicKeyCredentialTypePublicKey,
	Algorithm: protocol.RS256,
},

in PubKeyCredParams:

PubKeyCredParams: []protocol.PublicKeyCredentialParameters{
{
Type: protocol.PublicKeyCredentialTypePublicKey,
Algorithm: protocol.ES256,
},
},

Then the error disappeared, but I got an error while finishing the registration (running WebAuthn.ParseAndFinishRegistration()) at line 132:

func (a Attestation) IsValid(relyingPartyID string, clientDataHash []byte) error {
// Check the auth data, i.e. steps 9-11
if err := a.AuthData.IsValid(relyingPartyID); err != nil {
return err
}
// 13. Determine the attestation statement format by performing a USASCII case-sensitive match on fmt against the set
// of supported WebAuthn Attestation Statement Format Identifier values.
format, ok := attestationFormats[a.Fmt]
if !ok {
return ErrUnsupportedAttestationFormat.WithDebugf("The attestation format %q is unknown", a.Fmt)
}
// 14. Verify that attStmt is a correct attestation statement, conveying a valid attestation signature, by using the
// attestation statement format fmt’s verification procedure given attStmt, authData and the hash of the serialized
// client data computed in step 7.
if err := format(a, clientDataHash); err != nil {
return err
}
// NOTE: However, if permitted by policy, the Relying Party MAY register the credential ID and credential public
// key but treat the credential as one with self attestation (see §6.4.3 Attestation Types). If doing so, the
// Relying Party is asserting there is no cryptographic proof that the public key credential has been generated
// by a particular authenticator model. See [FIDOSecRef] and [UAFProtocol] for a more detailed discussion.
return nil
}

the a.Fmt was none.

When I added the code after line 131, in the if statement:

fmt.Println(a)

I got:

{none {[73 150 13 229 136 14 140 104 116 52 23 15 100 118 96 91 143 228 174 185 162 134 50 199 153 92 243 186 131 29 151 99] 69 0 {[8 152 112 88 202 220 75 129 182 225 48 222 80 220 190 150] [128 130 138 131 9 189 56 216 26 246 190 158 248 45 191 164 84 166 213 131 62 181 18 46 113 12 28 137 121 0 109 91] 0xc000591f20} [73 150 13 229 136 14 140 104 116 52 23 15 100 118 96 91 143 228 174 185 162 134 50 199 153 92 243 186 131 29 151 99 69 0 0 0 0 8 152 112 88 202 220 75 129 182 225 48 222 80 220 190 150 0 32 128 130 138 131 9 189 56 216 26 246 190 158 248 45 191 164 84 166 213 131 62 181 18 46 113 12 28 137 121 0 109 91 165 1 2 3 38 32 1 33 88 32 217 145 48 116 108 253 35 25 94 92 211 105 11 171 14 210 166 187 234 244 11 98 139 121 164 113 221 85 67 162 231 185 34 88 32 247 33 217 249 92 143 250 186 2 86 77 210 126 150 173 2 255 141 59 201 39 82 166 104 190 125 179 18 199 101 148 97]} map[]}

Chrome 121.0.6167.86.

Update: Same problem on Firefox 116.0.3 (64 bit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant