Skip to content

Commit ef6f96b

Browse files
authored
Add credential prompts for PKCS11-based SSH keys (#4646)
- **PR Description** Similar to #2239, add credential prompts for PKCS11-based SSH keys. OpenSSH code reference is [here](https://github.com/openssh/openssh-portable/blob/2827b6ac304ded8f99e8fbc12e7299133fadb2c2/ssh-pkcs11.c#L263).
2 parents 80887f5 + b5c2524 commit ef6f96b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/commands/oscommands/cmd_obj_runner.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ func (self *cmdObjRunner) getCheckForCredentialRequestFunc() func([]byte) (Crede
391391
`Username\s*for\s*'.+':`: Username,
392392
`Enter\s*passphrase\s*for\s*key\s*'.+':`: Passphrase,
393393
`Enter\s*PIN\s*for\s*.+\s*key\s*.+:`: PIN,
394+
`Enter\s*PIN\s*for\s*'.+':`: PIN,
394395
`.*2FA Token.*`: Token,
395396
}
396397

pkg/commands/oscommands/cmd_obj_runner_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,17 @@ func TestProcessOutput(t *testing.T) {
8989
expectedToWrite: "passphrase",
9090
},
9191
{
92-
name: "pin prompt",
92+
name: "security key pin prompt",
9393
promptUserForCredential: defaultPromptUserForCredential,
9494
output: "Enter PIN for key '123':",
9595
expectedToWrite: "pin",
9696
},
97+
{
98+
name: "pkcs11 key pin prompt",
99+
promptUserForCredential: defaultPromptUserForCredential,
100+
output: "Enter PIN for '123':",
101+
expectedToWrite: "pin",
102+
},
97103
{
98104
name: "2FA token prompt",
99105
promptUserForCredential: defaultPromptUserForCredential,

0 commit comments

Comments
 (0)