| Summary: | ssh-keygen and tools should be able to get public part directly from private key (portability) | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Jakub Jelen <jjelen> | ||||||
| Component: | Smartcard | Assignee: | Assigned to nobody <unassigned-bugs> | ||||||
| Status: | CLOSED INVALID | ||||||||
| Severity: | enhancement | CC: | djm | ||||||
| Priority: | P5 | Keywords: | pkcs11 | ||||||
| Version: | 6.9p1 | ||||||||
| Hardware: | Other | ||||||||
| OS: | Linux | ||||||||
| Attachments: |
|
||||||||
|
Description
Jakub Jelen
2015-07-20 23:33:34 AEST
Created attachment 2677 [details]
read public part from private key in (not only in ssh-keygen).
First approach for reading private keys doesn't look too much painful.
As I stated before, we need to have interactive login in ssh-keygen, which is the first part of the patch.
Second thing is that I extracted interactive prompt for PIN from pkcs11_rsa_private_encrypt into its own function pkcs11_do_login.
I use this function in pkcs11_open_session if I don't have pin provided and the pkcs11 session is interactive. The failure is not fatal, since in many cases you can proceed also without login.
The last thing is the filter itself, where I added filter for CKA_PRIVATE_KEY. with according attributes. The rest is handled by existing code since attributes are the same as for public keys.
Future possible improvement or modification can be the switch in ssh-keygen that would force this interactive login (by default would be 0) to make the user experience the same:
+ pkcs11_init(force_login);
Created attachment 3278 [details]
revised diff?
I think with the recent changes, we might only need to query the CKO_PRIVATE_KEY object class.
I don't have any way of testing this unfortunately.
After the years, I do no longer thing this is a very useful thing to do. This would work nicely with RSA keys, but not with ECDSA, where the public part is not always available in the private key object. Additionally the need to login for most of the private keys makes its use more complicated. Moreover, all the sane smart cards have at least the public and private keys available. Having only private ones I would consider a misconfiguration. I am sorry for the confusion. closing resolved bugs as of 8.6p1 release |