File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ var supportedHostKeyAlgos = []string{
53
53
// This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed
54
54
// because they have reached the end of their useful life.
55
55
var supportedMACs = []string {
56
- "hmac-sha1" , "hmac-sha1-96" ,
56
+ "hmac-sha2-256" , "hmac- sha1" , "hmac-sha1-96" ,
57
57
}
58
58
59
59
var supportedCompressions = []string {compressionNone }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ package ssh
9
9
import (
10
10
"crypto/hmac"
11
11
"crypto/sha1"
12
+ "crypto/sha256"
12
13
"hash"
13
14
)
14
15
@@ -44,6 +45,9 @@ func (t truncatingMAC) Size() int {
44
45
func (t truncatingMAC ) BlockSize () int { return t .hmac .BlockSize () }
45
46
46
47
var macModes = map [string ]* macMode {
48
+ "hmac-sha2-256" : {32 , func (key []byte ) hash.Hash {
49
+ return hmac .New (sha256 .New , key )
50
+ }},
47
51
"hmac-sha1" : {20 , func (key []byte ) hash.Hash {
48
52
return hmac .New (sha1 .New , key )
49
53
}},
You can’t perform that action at this time.
0 commit comments