Skip to content

Add credential prompts for PKCS11-based SSH keys #4646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

Jadeiin
Copy link
Contributor

@Jadeiin Jadeiin commented Jun 15, 2025

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@@ -391,6 +391,7 @@ func (self *cmdObjRunner) getCheckForCredentialRequestFunc() func([]byte) (Crede
`Username\s*for\s*'.+':`: Username,
`Enter\s*passphrase\s*for\s*key\s*'.+':`: Passphrase,
`Enter\s*PIN\s*for\s*.+\s*key\s*.+:`: PIN,
`Enter\s*PIN\s*for\s*'.+':`: PIN,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the problem domain at all, so not sure this makes sense, but do we have to match the single quotes explicitly, or the "key" in the previous pattern? Just wondering if we should combine the two PIN patterns into one, e.g. Enter\s*PIN\s*for\s*.+:.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are many cases which match Enter\s*PIN\s*for\s*.+: in OpenSSH, such as Enter PIN for CA key and Enter PIN for authenticator. Although these situations are not common during the SSH connection process established by git,, it is still worth considering handling different input conditions separately.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in #4018 I choose *(key\s*.+|'.+') to either match key ... or '...'

@stefanhaller stefanhaller added the enhancement New feature or request label Jun 17, 2025
@oliverpool
Copy link

Similar to #4018

@Jadeiin
Copy link
Contributor Author

Jadeiin commented Jun 18, 2025

Similar to #4018

I noticed that your PR was submitted a long time ago. Why hasn't it been merged yet?

@stefanhaller
Copy link
Collaborator

I noticed that your PR was submitted a long time ago. Why hasn't it been merged yet?

Because it fell through the cracks, apparently. Happens all the time when open source maintainers have little time next to their day jobs. I hope this will happen less often in the future, but do feel free to ping next time something seems to get stuck for no reason.

In this case I'd tend to merge this PR, and close #4018 as superseded by this. Does this work for both of you?

@Jadeiin
Copy link
Contributor Author

Jadeiin commented Jun 19, 2025

I'm ok with it.

@stefanhaller stefanhaller enabled auto-merge June 20, 2025 06:24
@stefanhaller stefanhaller merged commit ef6f96b into jesseduffield:master Jun 20, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants