forked from golang/go
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ssh: reject unencrypted keys from ParsePrivateKeyWithPassphrase
The behavior of ParsePrivateKeyWithPassphrase when the key is unencrypted is unspecified. Currently, it just parses them like ParsePrivateKey, which is unlikely to be what anyone wants: for us to ignore a passphrase that they explicitly passed. It also makes the implementation of encrypted OpenSSH keys in the next CL more confused. Instead, make ParsePrivateKey return a PassphraseNeededError, so the application logic can be ParsePrivateKey -> detect encrypted key -> obtain passphrase -> ParsePrivateKeyWithPassphrase. That error will also let us return the public key for OpenSSH keys. Change-Id: Ife4fb2499ae538bef36e353adf9bc8e902662386
- Loading branch information
1 parent
497ca9f
commit 178fe9c
Showing
2 changed files
with
31 additions
and
22 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