File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ import (
8
8
"github.com/go-webauthn/webauthn/protocol/webauthncbor"
9
9
)
10
10
11
- var (
11
+ const (
12
12
minAuthDataLength = 37
13
13
minAttestedAuthLength = 55
14
+ maxCredentialIDLength = 1023
14
15
)
15
16
16
17
// Authenticators respond to Relying Party requests by returning an object derived from the
@@ -203,6 +204,10 @@ func (a *AuthenticatorData) unmarshalAttestedData(rawAuthData []byte) (err error
203
204
return ErrBadRequest .WithDetails ("Authenticator attestation data length too short" )
204
205
}
205
206
207
+ if idLength > maxCredentialIDLength {
208
+ return ErrBadRequest .WithDetails ("Authenticator attestation data credential id length too long" )
209
+ }
210
+
206
211
a .AttData .CredentialID = rawAuthData [55 : 55 + idLength ]
207
212
208
213
a .AttData .CredentialPublicKey , err = unmarshalCredentialPublicKey (rawAuthData [55 + idLength :])
Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ type CredentialCreationResponse struct {
51
51
type ParsedCredentialCreationData struct {
52
52
ParsedPublicKeyCredential
53
53
Response ParsedAttestationResponse
54
+ Transports []AuthenticatorTransport
54
55
Raw CredentialCreationResponse
55
- Transports []AuthenticatorTransport `json:"transports,omitempty"`
56
56
}
57
57
58
58
func ParseCredentialCreationResponse (response * http.Request ) (* ParsedCredentialCreationData , error ) {
You can’t perform that action at this time.
0 commit comments