mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-30 09:14:59 +02:00
- (djm) Bug #591: use PKCS#15 private key label as a comment in case
of OpenSC. Report and patch from larsch@trustcenter.de
This commit is contained in:
parent
f4f36f30f5
commit
4a8e284855
@ -1,3 +1,7 @@
|
||||
20030628
|
||||
- (djm) Bug #591: use PKCS#15 private key label as a comment in case
|
||||
of OpenSC. Report and patch from larsch@trustcenter.de
|
||||
|
||||
20030628
|
||||
- (dtucker) OpenBSD CVS Sync
|
||||
- markus@cvs.openbsd.org 2003/06/23 09:02:44
|
||||
@ -603,4 +607,4 @@
|
||||
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
|
||||
Report from murple@murple.net, diagnosis from dtucker@zip.com.au
|
||||
|
||||
$Id: ChangeLog,v 1.2829 2003/06/28 02:54:33 dtucker Exp $
|
||||
$Id: ChangeLog,v 1.2830 2003/06/28 08:02:47 djm Exp $
|
||||
|
@ -474,4 +474,30 @@ sc_put_key(Key *prv, const char *id)
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *
|
||||
sc_get_key_label(Key *key)
|
||||
{
|
||||
int r;
|
||||
const struct sc_priv_data *priv;
|
||||
struct sc_pkcs15_object *key_obj;
|
||||
|
||||
priv = (const struct sc_priv_data *) RSA_get_app_data(key->rsa);
|
||||
if (priv == NULL || p15card == NULL) {
|
||||
logit("SmartCard key not loaded");
|
||||
/* internal error => return default label */
|
||||
return xstrdup("smartcard key");
|
||||
}
|
||||
r = sc_pkcs15_find_prkey_by_id(p15card, &priv->cert_id, &key_obj);
|
||||
if (r) {
|
||||
logit("Unable to find private key from SmartCard: %s",
|
||||
sc_strerror(r));
|
||||
return xstrdup("smartcard key");
|
||||
}
|
||||
if (key_obj == NULL || key_obj->label == NULL)
|
||||
/* the optional PKCS#15 label does not exists
|
||||
* => return the default label */
|
||||
return xstrdup("smartcard key");
|
||||
return xstrdup(key_obj->label);
|
||||
}
|
||||
|
||||
#endif /* SMARTCARD */
|
||||
|
Loading…
x
Reference in New Issue
Block a user