Skip to content

Commit 42b4119

Browse files
committed
Add support for "hmac-sha2-512-etm@openssh.com"
1 parent 0ec3e99 commit 42b4119

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
@@ -82,7 +82,7 @@ var supportedHostKeyAlgos = []string{
8282
// This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed
8383
// because they have reached the end of their useful life.
8484
var supportedMACs = []string{
85-
"hmac-sha2-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96",
85+
"hmac-sha2-512-etm@openssh.com", "hmac-sha2-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96",
8686
}
8787

8888
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)