MCPcopy Create free account
hub / github.com/Driver-C/tryssh / ClearMasterKey

Function ClearMasterKey

pkg/utils/crypto.go:95–102  ·  view source on GitHub ↗

ClearMasterKey removes the cached master key from memory.

()

Source from the content-addressed store, hash-verified

93
94// ClearMasterKey removes the cached master key from memory.
95func ClearMasterKey() {
96 masterKeyMu.Lock()
97 defer masterKeyMu.Unlock()
98 for i := range masterKey {
99 masterKey[i] = 0
100 }
101 masterKey = nil
102}
103
104// deriveKey derives a 32-byte AES key from a password using iterated HMAC-SHA256.
105func deriveKey(password []byte) ([]byte, error) {

Calls

no outgoing calls