-
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.
ssh: Add the [email protected] algorithm
Fixes golang/go#17676 Change-Id: I96c51431b174898a6bc0f6bec7f4561d5d64819f Reviewed-on: https://go-review.googlesource.com/35513 Reviewed-by: Han-Wen Nienhuys <[email protected]> Run-TryBot: Han-Wen Nienhuys <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
- Loading branch information
Showing
5 changed files
with
99 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ var supportedHostKeyAlgos = []string{ | |
// This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed | ||
// because they have reached the end of their useful life. | ||
var supportedMACs = []string{ | ||
"hmac-sha2-256", "hmac-sha1", "hmac-sha1-96", | ||
"hmac-sha2-256[email protected]", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96", | ||
} | ||
|
||
var supportedCompressions = []string{compressionNone} | ||
|
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ import ( | |
|
||
type macMode struct { | ||
keySize int | ||
etm bool | ||
new func(key []byte) hash.Hash | ||
} | ||
|
||
|
@@ -45,13 +46,16 @@ func (t truncatingMAC) Size() int { | |
func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } | ||
|
||
var macModes = map[string]*macMode{ | ||
"hmac-sha2-256": {32, func(key []byte) hash.Hash { | ||
"hmac-sha2-256[email protected]": {32, true, func(key []byte) hash.Hash { | ||
return hmac.New(sha256.New, key) | ||
}}, | ||
"hmac-sha1": {20, func(key []byte) hash.Hash { | ||
"hmac-sha2-256": {32, false, func(key []byte) hash.Hash { | ||
return hmac.New(sha256.New, key) | ||
}}, | ||
"hmac-sha1": {20, false, func(key []byte) hash.Hash { | ||
return hmac.New(sha1.New, key) | ||
}}, | ||
"hmac-sha1-96": {20, func(key []byte) hash.Hash { | ||
"hmac-sha1-96": {20, false, func(key []byte) hash.Hash { | ||
return truncatingMAC{12, hmac.New(sha1.New, key)} | ||
}}, | ||
} |
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