Skip to content

Figure out what version of YubiKeys support PIN caching #60

Open
@ericchiang

Description

@ericchiang

Currently we're assuming > 4.3.0 since I only have a v4.3.7 and v3.4.9 key to test with

piv-go/piv/piv_test.go

Lines 137 to 152 in 2184bb6

func TestYubiKeyLoginNeeded(t *testing.T) {
yk, close := newTestYubiKey(t)
defer close()
testRequiresVersion(t, yk, 4, 3, 0)
if !ykLoginNeeded(yk.tx) {
t.Errorf("expected login needed")
}
if err := ykLogin(yk.tx, DefaultPIN); err != nil {
t.Fatalf("login: %v", err)
}
if ykLoginNeeded(yk.tx) {
t.Errorf("expected no login needed")
}
}

If someone can confirm that that test passes with an older version of a YubiKey (e.g. 4.2.X), we can support PIN caching and PINPolicyOnce for those versions.

To test against a YubiKey, comment out the version and run (this will destroy all data on your PIV applet but leave GPG and U2F/WebAuthN data unaffected):

go test -v -run=^TestYubiKeyReset$ . -wipe-yubikey
go test -v -run=^TestYubiKeyLoginNeeded$ . -wipe-yubikey

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions