summaryrefslogtreecommitdiff
path: root/ssh-pkcs11.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2017-05-30 14:15:17 +0000
committerDamien Miller <djm@mindrot.org>2017-05-31 10:47:31 +1000
commitff7371afd08ac0bbd957d90451d4dcd0da087ef5 (patch)
tree0586904d32f3e12a7b30a042c3d6188f9ed5f8dd /ssh-pkcs11.c
parentbeb965bbc5a984fa69fb1e2b45ebe766ae09d1ef (diff)
downloadopenssh-git-ff7371afd08ac0bbd957d90451d4dcd0da087ef5.tar.gz
upstream commit
sshkey_new() might return NULL (pkcs#11 code only); ok djm@ Upstream-ID: de9f2ad4a42c0b430caaa7d08dea7bac943075dd
Diffstat (limited to 'ssh-pkcs11.c')
-rw-r--r--ssh-pkcs11.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ssh-pkcs11.c b/ssh-pkcs11.c
index aaf712d9..ea97508f 100644
--- a/ssh-pkcs11.c
+++ b/ssh-pkcs11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-pkcs11.c,v 1.23 2016/10/28 03:33:52 djm Exp $ */
+/* $OpenBSD: ssh-pkcs11.c,v 1.24 2017/05/30 14:15:17 markus Exp $ */
/*
* Copyright (c) 2010 Markus Friedl. All rights reserved.
*
@@ -537,7 +537,8 @@ pkcs11_fetch_keys_filter(struct pkcs11_provider *p, CK_ULONG slotidx,
}
if (rsa && rsa->n && rsa->e &&
pkcs11_rsa_wrap(p, slotidx, &attribs[0], rsa) == 0) {
- key = sshkey_new(KEY_UNSPEC);
+ if ((key = sshkey_new(KEY_UNSPEC)) == NULL)
+ fatal("sshkey_new failed");
key->rsa = rsa;
key->type = KEY_RSA;
key->flags |= SSHKEY_FLAG_EXT;