(randomKey string, sharedKey string)
| 76 | } |
| 77 | |
| 78 | func 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 | |
| 94 | func newSocketCtl( |
| 95 | commonCfg configuration.Common, |
no test coverage detected