Skip to content

Commit

Permalink
Be resilient to open errors
Browse files Browse the repository at this point in the history
  • Loading branch information
codingllama authored and github-actions committed Feb 2, 2024
1 parent 37d3e68 commit c6d03be
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/auth/webauthncli/fido2.go
Expand Up @@ -680,8 +680,15 @@ func startDevices(

dev, err := fidoNewDevice(path)
if err != nil {
closeAll()
return nil, nil, trace.Wrap(err, "device open")
// Be resilient to open errors.
// This can happen to devices that failed to cancel (and thus are still
// asserting) when we run sequential operations. For example: registration
// immediately followed by assertion (in a single process).
// This is largely safe to ignore, as opening is fairly consistent in
// other situations and failures are likely from a non-chosen device in
// multi-device scenarios.
log.Debugf("FIDO2: Device %v failed to open, skipping: %v", path, err)
continue
}

fidoDevs = append(fidoDevs, dev)
Expand All @@ -690,6 +697,9 @@ func startDevices(
dev: dev,
})
}
if len(fidoDevs) == 0 {
return nil, nil, errors.New("failed to open security keys")
}

// Prompt touch, it's about to begin.
ackTouch, err := prompt.PromptTouch()
Expand Down

0 comments on commit c6d03be

Please sign in to comment.