macaroons: don't zero mem if never unlocked
This commit is contained in:
parent
0c1b619e53
commit
92eebff64e
@ -196,6 +196,8 @@ func (r *RootKeyStorage) RootKey(_ context.Context) ([]byte, []byte, error) {
|
|||||||
// Close closes the underlying database and zeroes the encryption key stored
|
// Close closes the underlying database and zeroes the encryption key stored
|
||||||
// in memory.
|
// in memory.
|
||||||
func (r *RootKeyStorage) Close() error {
|
func (r *RootKeyStorage) Close() error {
|
||||||
r.encKey.Zero()
|
if r.encKey != nil {
|
||||||
|
r.encKey.Zero()
|
||||||
|
}
|
||||||
return r.DB.Close()
|
return r.DB.Close()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user