WebAuthn CredentialID field needs to be increased in size (#20530)
WebAuthn have updated their specification to set the maximum size of the CredentialID to 1023 bytes. This is somewhat larger than our current size and therefore we need to migrate. The PR changes the struct to add CredentialIDBytes and migrates the CredentialID string to the bytes field before another migration drops the old CredentialID field. Another migration renames this field back. Fix #20457 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
692707f145
commit
e819da0837
10 changed files with 363 additions and 16 deletions
|
@ -5,7 +5,6 @@
|
|||
package auth
|
||||
|
||||
import (
|
||||
"encoding/base32"
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
|
@ -129,7 +128,7 @@ func WebAuthnLoginAssertionPost(ctx *context.Context) {
|
|||
}
|
||||
|
||||
// Success! Get the credential and update the sign count with the new value we received.
|
||||
dbCred, err := auth.GetWebAuthnCredentialByCredID(user.ID, base32.HexEncoding.EncodeToString(cred.ID))
|
||||
dbCred, err := auth.GetWebAuthnCredentialByCredID(user.ID, cred.ID)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetWebAuthnCredentialByCredID", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue