Merge pull request #278 from docker/bail-if-no-cert

More defensive coding around listing our keys in the yubikey.
This commit is contained in:
Diogo Mónica 2015-11-13 08:01:06 -08:00
commit f0ca498474
2 changed files with 6 additions and 0 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -483,6 +483,12 @@ func yubiListKeys(ctx IPKCS11Ctx, session pkcs11.SessionHandle) (keys map[string
}
}
}
// we found nothing
if cert == nil {
continue
}
var ecdsaPubKey *ecdsa.PublicKey
switch cert.PublicKeyAlgorithm {
case x509.ECDSA: