Skip to content

Commit fd25291

Browse files
committed
remove workaround for bug in webauthn library, now fixed
1 parent 89f55f7 commit fd25291

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

user.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,6 @@ func (u *DynamoUser) FinishLogin(r *http.Request) (*webauthn.Credential, error)
390390
}
391391
}
392392

393-
// there is an issue with URLEncodeBase64.UnmarshalJSON and null values
394-
// see https://github.com/duo-labs/webauthn/issues/69
395-
// null byte sequence is []byte{158,233,101}
396-
if isNullByteSlice(parsedResponse.Response.UserHandle) {
397-
parsedResponse.Response.UserHandle = nil
398-
}
399-
400393
credential, err := u.WebAuthnClient.ValidateLogin(u, u.SessionData, parsedResponse)
401394
if err != nil {
402395
logProtocolError("failed to validate login", err)
@@ -493,18 +486,6 @@ func (u *DynamoUser) WebAuthnCredentials() []webauthn.Credential {
493486
})
494487
}
495488

496-
// isNullByteSlice works around a bug in JSON unmarshalling for a URL-encoded Base64 string
497-
// (see https://github.com/duo-labs/webauthn/issues/69)
498-
func isNullByteSlice(slice []byte) bool {
499-
if len(slice) != 3 {
500-
return false
501-
}
502-
if slice[0] == 158 && slice[1] == 233 && slice[2] == 101 {
503-
return true
504-
}
505-
return false
506-
}
507-
508489
// hashAndEncodeKeyHandle returns the Base64 URL-encoded SHA256 hash of a byte slice to provide a hash of a key
509490
// handle to the client.
510491
func hashAndEncodeKeyHandle(id []byte) string {

0 commit comments

Comments
 (0)