Skip to content

Commit d4bc717

Browse files
committed
add hmac-sha2-512.
1 parent 3d872d0 commit d4bc717

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-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha2-512" ,"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

@@ -52,6 +53,9 @@ var macModes = map[string]*macMode{
5253
"hmac-sha2-256": {32, false, func(key []byte) hash.Hash {
5354
return hmac.New(sha256.New, key)
5455
}},
56+
"hmac-sha2-512": {64, false, func(key []byte) hash.Hash {
57+
return hmac.New(sha512.New, key)
58+
}},
5559
"hmac-sha1": {20, false, func(key []byte) hash.Hash {
5660
return hmac.New(sha1.New, key)
5761
}},

0 commit comments

Comments
 (0)