Rekey comment
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2021-12-18 16:55:14 -08:00
parent aa98ef0e5e
commit 8a273d3310
1 changed files with 3 additions and 0 deletions

View File

@ -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))