Skip to content

Commit 712b88d

Browse files
committed
ssh: add hmac-sha2-512.
1 parent 85f9870 commit 712b88d

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
@@ -67,7 +67,7 @@ var supportedHostKeyAlgos = []string{
6767
// This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed
6868
// because they have reached the end of their useful life.
6969
var supportedMACs = []string{
70-
"[email protected]", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96",
70+
"[email protected]", "hmac-sha2-512", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96",
7171
}
7272

7373
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

@@ -49,6 +50,9 @@ var macModes = map[string]*macMode{
4950
"[email protected]": {32, true, func(key []byte) hash.Hash {
5051
return hmac.New(sha256.New, key)
5152
}},
53+
"hmac-sha2-512": {64, false, func(key []byte) hash.Hash {
54+
return hmac.New(sha512.New, key)
55+
}},
5256
"hmac-sha2-256": {32, false, func(key []byte) hash.Hash {
5357
return hmac.New(sha256.New, key)
5458
}},

0 commit comments

Comments
 (0)