mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-28 16:24:39 +02:00
upstream commit
avoid fatal() for PKCS11 tokens that present empty key IDs bz#1773, ok markus@ Upstream-ID: 044a764fee526f2c4a9d530bd10695422d01fc54
This commit is contained in:
parent
e4c918a6c7
commit
d2d772f55b
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: ssh-pkcs11.c,v 1.21 2015/07/18 08:02:17 djm Exp $ */
|
/* $OpenBSD: ssh-pkcs11.c,v 1.22 2016/02/12 00:20:30 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010 Markus Friedl. All rights reserved.
|
* Copyright (c) 2010 Markus Friedl. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -322,8 +322,10 @@ pkcs11_rsa_wrap(struct pkcs11_provider *provider, CK_ULONG slotidx,
|
|||||||
k11->slotidx = slotidx;
|
k11->slotidx = slotidx;
|
||||||
/* identify key object on smartcard */
|
/* identify key object on smartcard */
|
||||||
k11->keyid_len = keyid_attrib->ulValueLen;
|
k11->keyid_len = keyid_attrib->ulValueLen;
|
||||||
k11->keyid = xmalloc(k11->keyid_len);
|
if (k11->keyid_len > 0) {
|
||||||
memcpy(k11->keyid, keyid_attrib->pValue, k11->keyid_len);
|
k11->keyid = xmalloc(k11->keyid_len);
|
||||||
|
memcpy(k11->keyid, keyid_attrib->pValue, k11->keyid_len);
|
||||||
|
}
|
||||||
k11->orig_finish = def->finish;
|
k11->orig_finish = def->finish;
|
||||||
memcpy(&k11->rsa_method, def, sizeof(k11->rsa_method));
|
memcpy(&k11->rsa_method, def, sizeof(k11->rsa_method));
|
||||||
k11->rsa_method.name = "pkcs11";
|
k11->rsa_method.name = "pkcs11";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user