-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x/crypto/ssh: add support for ed25519 keys
Added support for parsing the "new" openssh private key format. (ed25519 keys only in this format for now) Signing and verifying functions now work with ed25519 keys. ed25519 can now be accepted by the server to authenticate a client. ed25519 can now be accepted by a client as a server host key. Related documentation used: https://www.ietf.org/archive/id/draft-bjh21-ssh-ed25519-02.txt Change-Id: I84385f24d666fea08de21f980f78623f7bff8007 Reviewed-on: https://go-review.googlesource.com/22512 Reviewed-by: Han-Wen Nienhuys <[email protected]> Run-TryBot: Han-Wen Nienhuys <[email protected]>
- Loading branch information
Showing
9 changed files
with
178 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ const ( | |
CertAlgoECDSA256v01 = "[email protected]" | ||
CertAlgoECDSA384v01 = "[email protected]" | ||
CertAlgoECDSA521v01 = "[email protected]" | ||
CertAlgoED25519v01 = "[email protected]" | ||
) | ||
|
||
// Certificate types distinguish between host and user | ||
|
@@ -401,6 +402,7 @@ var certAlgoNames = map[string]string{ | |
KeyAlgoECDSA256: CertAlgoECDSA256v01, | ||
KeyAlgoECDSA384: CertAlgoECDSA384v01, | ||
KeyAlgoECDSA521: CertAlgoECDSA521v01, | ||
KeyAlgoED25519: CertAlgoED25519v01, | ||
} | ||
|
||
// certToPrivAlgo returns the underlying algorithm for a certificate algorithm. | ||
|
@@ -459,7 +461,7 @@ func (c *Certificate) Marshal() []byte { | |
func (c *Certificate) Type() string { | ||
algo, ok := certAlgoNames[c.Key.Type()] | ||
if !ok { | ||
panic("unknown cert key type") | ||
panic("unknown cert key type " + c.Key.Type()) | ||
} | ||
return algo | ||
} | ||
|
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
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