Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Robust, optional remembering of SSH passphrases
Existing logic for remembering SSH passphrases was extremely fragile and complicated due to SSH_ASKPASS not working on Windows, because we weren't detaching the process correctly. Now that we do detach correctly, we can get rid of the existing complicated machinery and replace it with something much simpler, more robust, and optional. Previously we used GIT_SSH to intercept calls to SSH, then we'd preemptively start ssh-agent and add what we thought was the key the user would need to use. If that key was encrypted with a passphrase, we used an SSH_ASKPASS override (that worked for ssh-add, but not ssh, due to differing logic between them for when they would invoke SSH_ASKPASS). Now we no longer set GIT_SSH, but rather rely solely on SSH_ASKPASS. If the passphrase prompt we're given looks like it's for a key file, then we ask the user for a passphrase and also ask if the passphrase should be remembered. If so, we run ssh-agent (if it's not already running) and persist the key, this time overriding SSH_ASKPASS to a different script that just outputs the passphrase.
- Loading branch information
Showing
20 changed files
with
313 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.