From 8a273d3310f5b8862430b312096f63d7198289cc Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Sat, 18 Dec 2021 16:55:14 -0800 Subject: [PATCH] Rekey comment --- peer/cwtchprofilestorage.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/peer/cwtchprofilestorage.go b/peer/cwtchprofilestorage.go index 8d12571..d859c67 100644 --- a/peer/cwtchprofilestorage.go +++ b/peer/cwtchprofilestorage.go @@ -763,6 +763,9 @@ func (cps *CwtchProfileStorage) Delete() { } } +// Rekey re-encrypts the datastore with the new key. +// **note* this is technically a very dangerous API and should only be called after +// checks on the current password and the derived new password. func (cps *CwtchProfileStorage) Rekey(newkey [32]byte) error { // PRAGMA queries don't allow subs... _, err := cps.db.Exec(fmt.Sprintf(`PRAGMA rekey="x'%x'";`, newkey))