Skip to content

Commit 1622238

Browse files
s-k2gopherbot
authored andcommitted
Add support for "hmac-sha2-512-etm@openssh.com"
Change-Id: I0203881afd7ad72e68f76650817451d7e292c91b GitHub-Last-Rev: 42b4119 GitHub-Pull-Request: #129 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/226982 Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> Reviewed-by: Han-Wen Nienhuys <hanwen@google.com> Auto-Submit: Han-Wen Nienhuys <hanwen@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
1 parent a4e9841 commit 1622238

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ssh/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var supportedHostKeyAlgos = []string{
8585
// This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed
8686
// because they have reached the end of their useful life.
8787
var supportedMACs = []string{
88-
"hmac-sha2-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96",
88+
"hmac-sha2-512-etm@openssh.com", "hmac-sha2-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96",
8989
}
9090

9191
var supportedCompressions = []string{compressionNone}

ssh/mac.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"crypto/hmac"
1111
"crypto/sha1"
1212
"crypto/sha256"
13+
"crypto/sha512"
1314
"hash"
1415
)
1516

@@ -46,6 +47,9 @@ func (t truncatingMAC) Size() int {
4647
func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() }
4748

4849
var macModes = map[string]*macMode{
50+
"hmac-sha2-512-etm@openssh.com": {64, true, func(key []byte) hash.Hash {
51+
return hmac.New(sha512.New, key)
52+
}},
4953
"hmac-sha2-256-etm@openssh.com": {32, true, func(key []byte) hash.Hash {
5054
return hmac.New(sha256.New, key)
5155
}},

0 commit comments

Comments
 (0)