Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions piv/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,11 @@ func pinPolicy(yk *YubiKey, slot Slot) (PINPolicy, error) {
cert, err := yk.Attest(slot)
if err != nil {
var e *apduErr
errors.As(err, &e)
if e == nil {
// Yubikey Version 5.2.7 Attest returns ErrNotFound
return PINPolicyAlways, nil
}
if errors.As(err, &e) && e.sw1 == 0x6d && e.sw2 == 0x00 {
// Attestation cert command not supported, probably an older YubiKey.
// Guess PINPolicyAlways.
Expand Down