Bugzilla – Attachment 3278 Details for
Bug 2432
ssh-keygen and tools should be able to get public part directly from private key (portability)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
revised diff?
bz2432.diff (text/plain), 1.43 KB, created by
Damien Miller
on 2019-05-10 13:48:06 AEST
(
hide
)
Description:
revised diff?
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2019-05-10 13:48:06 AEST
Size:
1.43 KB
patch
obsolete
>diff --git a/ssh-pkcs11.c b/ssh-pkcs11.c >index 2d52ae4..b4bb596 100644 >--- a/ssh-pkcs11.c >+++ b/ssh-pkcs11.c >@@ -1146,10 +1146,9 @@ fail: > */ > static int > pkcs11_fetch_keys(struct pkcs11_provider *p, CK_ULONG slotidx, >- struct sshkey ***keysp, int *nkeys) >+ CK_OBJECT_CLASS key_class, struct sshkey ***keysp, int *nkeys) > { > struct sshkey *key = NULL; >- CK_OBJECT_CLASS key_class; > CK_ATTRIBUTE key_attr[1]; > CK_SESSION_HANDLE session; > CK_FUNCTION_LIST *f = NULL; >@@ -1161,7 +1160,6 @@ pkcs11_fetch_keys(struct pkcs11_provider *p, CK_ULONG slotidx, > memset(&key_attr, 0, sizeof(key_attr)); > memset(&obj, 0, sizeof(obj)); > >- key_class = CKO_PUBLIC_KEY; > key_attr[0].type = CKA_CLASS; > key_attr[0].pValue = &key_class; > key_attr[0].ulValueLen = sizeof(key_class); >@@ -1540,12 +1538,12 @@ pkcs11_register_provider(char *provider_id, char *pin, struct sshkey ***keyp, > * open session, login with pin and retrieve public > * keys (if keyp is provided) > */ >- if ((ret = pkcs11_open_session(p, i, pin, user)) == 0) { >- if (keyp == NULL) >- continue; >- pkcs11_fetch_keys(p, i, keyp, &nkeys); >- pkcs11_fetch_certs(p, i, keyp, &nkeys); >- } >+ if ((ret = pkcs11_open_session(p, i, pin, user)) != 0 || >+ keyp == NULL) >+ continue; >+ pkcs11_fetch_keys(p, i, keyp, CKO_PUBLIC_KEY, &nkeys); >+ pkcs11_fetch_keys(p, i, keyp, CKO_PRIVATE_KEY, &nkeys); >+ pkcs11_fetch_certs(p, i, keyp, &nkeys); > } > > /* now owned by caller */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2432
:
2677
| 3278