1
0
Fork 0
forked from forgejo/forgejo

Don't panic if we fail to parse U2FRegistration data (#17304)

* Don't panic if we fail to parse a U2FRegistration data

Downgrade logging statement from Fatal to Error so that errors parsing
U2FRegistration data does not panic; instead, the invalid key will be
skipped and we will attempt to parse the next one, if available.

Signed-off-by: David Jimenez <dvejmz@sgfault.com>
This commit is contained in:
David Jimenez 2021-10-14 17:37:35 +01:00 committed by GitHub
parent d47798ccc7
commit fa8b8c055d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 2 deletions

View file

@ -462,7 +462,7 @@ func U2FSign(ctx *context.Context) {
for _, reg := range regs {
r, err := reg.Parse()
if err != nil {
log.Fatal("parsing u2f registration: %v", err)
log.Error("parsing u2f registration: %v", err)
continue
}
newCounter, authErr := r.Authenticate(*signResp, *challenge, reg.Counter)