MCPcopy
hub / github.com/nirui/sshwifty / getSocketAuthKey

Function getSocketAuthKey

application/controller/socket.go:78–92  ·  view source on GitHub ↗
(randomKey string, sharedKey string)

Source from the content-addressed store, hash-verified

76}
77
78func getSocketAuthKey(randomKey string, sharedKey string) []byte {
79 var k []byte
80
81 if len(sharedKey) > 0 {
82 k = []byte(sharedKey)
83 } else {
84 k = []byte(randomKey)
85 }
86
87 h := hmac.New(sha512.New, k)
88
89 h.Write([]byte(randomKey))
90
91 return h.Sum(nil)
92}
93
94func newSocketCtl(
95 commonCfg configuration.Common,

Callers 2

newSocketCtlFunction · 0.70
buildCipherKeyMethod · 0.70

Calls 2

NewMethod · 0.80
WriteMethod · 0.65

Tested by

no test coverage detected