summaryrefslogtreecommitdiff
path: root/ssh-pkcs11.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-07-18 08:00:21 +0000
committerDamien Miller <djm@mindrot.org>2015-07-20 10:32:25 +1000
commitb15fd989c8c62074397160147a8d5bc34b3f3c63 (patch)
tree780ba64cc9c5d2514520e7414f4d0dd9a77c15a1 /ssh-pkcs11.c
parent5b64f85bb811246c59ebab70aed331f26ba37b18 (diff)
upstream commit
skip uninitialised PKCS#11 slots; patch from Jakub Jelen in bz#2427 ok markus@ Upstream-ID: 744c1e7796e237ad32992d0d02148e8a18f27d29
Diffstat (limited to 'ssh-pkcs11.c')
-rw-r--r--ssh-pkcs11.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ssh-pkcs11.c b/ssh-pkcs11.c
index e074175bb..4156d0886 100644
--- a/ssh-pkcs11.c
+++ b/ssh-pkcs11.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-pkcs11.c,v 1.19 2015/05/27 05:15:02 djm Exp $ */ 1/* $OpenBSD: ssh-pkcs11.c,v 1.20 2015/07/18 08:00:21 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2010 Markus Friedl. All rights reserved. 3 * Copyright (c) 2010 Markus Friedl. All rights reserved.
4 * 4 *
@@ -631,6 +631,11 @@ pkcs11_add_provider(char *provider_id, char *pin, struct sshkey ***keyp)
631 error("C_GetTokenInfo failed: %lu", rv); 631 error("C_GetTokenInfo failed: %lu", rv);
632 continue; 632 continue;
633 } 633 }
634 if ((token->flags & CKF_TOKEN_INITIALIZED) == 0) {
635 debug2("%s: ignoring uninitialised token in slot %lu",
636 __func__, (unsigned long)i);
637 continue;
638 }
634 rmspace(token->label, sizeof(token->label)); 639 rmspace(token->label, sizeof(token->label));
635 rmspace(token->manufacturerID, sizeof(token->manufacturerID)); 640 rmspace(token->manufacturerID, sizeof(token->manufacturerID));
636 rmspace(token->model, sizeof(token->model)); 641 rmspace(token->model, sizeof(token->model));