INNER CODE UNIT · Go
requireBioTests
go-piv/piv-go · v2/piv/bio_integration_test.go:177
func requireBioTests(t *testing.T) {
if !canModifyYubiKey {
t.Skip("not running test that accesses yubikey, provide --wipe-yubikey flag")
}
if os.Getenv("PIV_BIO_TESTS") == "" {
t.Skip("set PIV_BIO_TESTS=1 to run biometric integration tests")
}
}
func signWithBioRetry(t *testing.T, signer crypto.Signer, message []byte) {
const maxAttempts = 3
digest := sha256.Sum256(message)
for attempt := 1; attempt <= maxAttempts; attempt++ {
sig, err := signer.Sign(rand.Reader, digest[:], crypto.SHA256)
if err != nil {
if isUnsupportedMatchPolicy(err) {
t.Skipf("match policy not supported: %v", err)
}