summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2015-07-18 08:00:21 +0000
committerdjm <djm@openbsd.org>2015-07-18 08:00:21 +0000
commiteea3c97ad9628e52a5cee677b3831e227cc56753 (patch)
tree6fe8f0b269296931324dddd3cee34d0ccd548fa4
parentonly query each keyboard-interactive device once per authentication (diff)
downloadwireguard-openbsd-eea3c97ad9628e52a5cee677b3831e227cc56753.tar.xz
wireguard-openbsd-eea3c97ad9628e52a5cee677b3831e227cc56753.zip
skip uninitialised PKCS#11 slots; patch from Jakub Jelen in bz#2427
ok markus@
-rw-r--r--usr.bin/ssh/ssh-pkcs11.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-pkcs11.c b/usr.bin/ssh/ssh-pkcs11.c
index ab296b66c7c..1e4c145f799 100644
--- a/usr.bin/ssh/ssh-pkcs11.c
+++ b/usr.bin/ssh/ssh-pkcs11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-pkcs11.c,v 1.19 2015/05/27 05:15:02 djm Exp $ */
+/* $OpenBSD: ssh-pkcs11.c,v 1.20 2015/07/18 08:00:21 djm Exp $ */
/*
* Copyright (c) 2010 Markus Friedl. All rights reserved.
*
@@ -621,6 +621,11 @@ pkcs11_add_provider(char *provider_id, char *pin, struct sshkey ***keyp)
error("C_GetTokenInfo failed: %lu", rv);
continue;
}
+ if ((token->flags & CKF_TOKEN_INITIALIZED) == 0) {
+ debug2("%s: ignoring uninitialised token in slot %lu",
+ __func__, (unsigned long)i);
+ continue;
+ }
rmspace(token->label, sizeof(token->label));
rmspace(token->manufacturerID, sizeof(token->manufacturerID));
rmspace(token->model, sizeof(token->model));