Page MenuHomePhabricator

Fix an issue where passphrase-protected private keys were stored without discarding passphrases

Authored by epriestley on Wed, May 13, 3:05 PM.



Ref T13454. See

After changes to distinguish between invalid and passphrase-protected keys, SSH private key management code incorrectly uses "-y ..." ("print public key") when it means "-p ..." ("modify input file, removing passphrase"). This results in the command having no effect, and Passphrase stores the raw input credential, not the stripped version.

We can't recover the keys because we don't store the passphrase, so no migration here is really possible. (We could add more code to detect this case, but it's presumably rare.)

Also, correct the behavior of the "Show Public Key" action: this is available for users who can see the credential and does not require edit permission.

Test Plan
  • Created a new credential with a passphrase, then showed the public key.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Wed, May 13, 3:05 PM
epriestley requested review of this revision.Wed, May 13, 3:06 PM
This revision was not accepted when it landed; it landed in state Needs Review.Wed, May 13, 3:14 PM
This revision was automatically updated to reflect the committed changes.