From f6d53c90114069402b549aa7c0bc79044aace51d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 6 Jan 2014 16:27:44 +0000 Subject: huh, finally: total database encryption, including histories git-svn-id: http://svn.miranda-ng.org/main/trunk@7522 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbintf.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbintf.h') diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index eb0b67535f..3e76d9a49a 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -54,6 +54,16 @@ DBHeader #define DBVT_ENCRYPTED 250 +#define NeedBytes(n) if (bytesRemaining<(n)) pBlob = (PBYTE)DBRead(ofsBlobPtr,(n),&bytesRemaining) +#define MoveAlong(n) {int x = n; pBlob += (x); ofsBlobPtr += (x); bytesRemaining -= (x);} + +DWORD __forceinline GetSettingValueLength(PBYTE pSetting) +{ + if (pSetting[0] & DBVTF_VARIABLELENGTH) + return 2 + *(PWORD)(pSetting + 1); + return pSetting[0]; +} + struct DBSignature { char name[15]; @@ -142,8 +152,6 @@ struct DBEvent #include -#define MAXCACHEDREADSIZE 65536 - struct CDb3Base : public MIDatabase, public MIDatabaseChecker, public MZeroedObject { CDb3Base(const TCHAR* tszFileName); @@ -318,6 +326,7 @@ struct CDb3Mmap : public CDb3Base int Load(bool bSkipInit); + void ToggleEncryption(void); void StoreKey(void); void SetPassword(const TCHAR *ptszPassword); void UpdateMenuItem(void); @@ -326,6 +335,8 @@ struct CDb3Mmap : public CDb3Base protected: int InitCrypt(void); + void ToggleEventsEncryption(HANDLE hContact); + void ToggleSettingsEncryption(HANDLE hContact); protected: void InitDialogs(); -- cgit v1.2.3