summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/ssh-pkcs11.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2017-05-30 14:15:18 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2017-05-30 14:15:18 +0000
commit7b27cc8cb805b17466b0f023796303a58734f0d5 (patch)
treea233ccd03c654e3d09c078c8eff5a4d1388e25a1 /usr.bin/ssh/ssh-pkcs11.c
parent2bc5731c871f6b2442c7378b8e3e246dafa47e1e (diff)
sshkey_new() might return NULL (pkcs#11 code only); ok djm@
Diffstat (limited to 'usr.bin/ssh/ssh-pkcs11.c')
-rw-r--r--usr.bin/ssh/ssh-pkcs11.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh-pkcs11.c b/usr.bin/ssh/ssh-pkcs11.c
index edbb343923a..d4b2be45820 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.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.
*
@@ -526,7 +526,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;