ClearMasterKey removes the cached master key from memory.
()
| 93 | |
| 94 | // ClearMasterKey removes the cached master key from memory. |
| 95 | func 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. |
| 105 | func deriveKey(password []byte) ([]byte, error) { |
no outgoing calls