core: change database encryption API to require current passphrase on all changes (#1019)

This commit is contained in:
Evgeny Poberezkin
2022-09-05 14:54:39 +01:00
committed by GitHub
parent 229f385f42
commit 082e12683b
8 changed files with 88 additions and 71 deletions
+4 -4
View File
@@ -2769,11 +2769,11 @@ testDatabaseEncryption = withTmpFiles $ do
bob <# "alice> hi"
alice ##> "/db encrypt mykey"
alice <## "error: chat not stopped"
alice ##> "/db decrypt"
alice ##> "/db decrypt mykey"
alice <## "error: chat not stopped"
alice ##> "/_stop"
alice <## "chat stopped"
alice ##> "/db decrypt"
alice ##> "/db decrypt mykey"
alice <## "error: chat database is not encrypted"
alice ##> "/db encrypt mykey"
alice <## "ok"
@@ -2785,7 +2785,7 @@ testDatabaseEncryption = withTmpFiles $ do
testChatWorking alice bob
alice ##> "/_stop"
alice <## "chat stopped"
alice ##> "/db encrypt nextkey"
alice ##> "/db password mykey nextkey"
alice <## "ok"
withTestChatOpts testOpts {maintenance = True, dbKey = "nextkey"} "alice" $ \alice -> do
alice ##> "/_start"
@@ -2793,7 +2793,7 @@ testDatabaseEncryption = withTmpFiles $ do
testChatWorking alice bob
alice ##> "/_stop"
alice <## "chat stopped"
alice ##> "/db decrypt"
alice ##> "/db decrypt nextkey"
alice <## "ok"
withTestChat "alice" $ \alice -> testChatWorking alice bob