PowerShell / PowerShell/Win32-OpenSSH
ssh-add -s fails
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 8.3k
- Forks
- 819
- PR merge metrics
- No merged PRs in 30d
Description
"OpenSSH for Windows" version
8.1.0.0
Client OperatingSystem
Windows 10 Enterprise
What is failing
ssh-add -s 'C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll'
Using the -s "Add keys from PKCS#11 provider", i.e. using ssh-agent with smart cards does not work.
Expected output
Identity added ...
Actual output
Enter passphrase for PKCS#11:
Could not add card "C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll": communication with agent failed
ssh-add is able to communicate with the agent. ssh-add without any options adds the default .ssh/id_rsa file, ssh-add -l is able to list it. ssh-add -s PKCS#11 does not work, although it does prompt for a PIN, so it obviously recognizes the -s option.
FWIW, ssh.exe is able to use a smart card with the option -I 'C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll', it's just ssh-agent that is failing.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Windows 10 failure with ssh-add -s and the provided OpenSC PKCS#11 DLL, then compare it with ssh-add -l and ssh -I using the same provider. Trace the ssh-add and ssh-agent communication path involved in PKCS#11 loading; done means the provider is added successfully and the smart card can be used through ssh-agent.
Written by the indexing model from the issue text.
Assessment
- Domain
- authentication, operating-systems, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100