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

Backport #17304

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>

Co-authored-by: David Jimenez <dvejmz@users.noreply.github.com>
This commit is contained in:
zeripath 2021-10-20 20:45:17 +01:00 committed by GitHub
parent eb748ff79e
commit 79a3d277e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 2 deletions

View file

@ -52,7 +52,7 @@ func (list U2FRegistrationList) ToRegistrations() []u2f.Registration {
for _, reg := range list {
r, err := reg.Parse()
if err != nil {
log.Fatal("parsing u2f registration: %v", err)
log.Error("parsing u2f registration: %v", err)
continue
}
regs = append(regs, *r)