diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-01 17:52:05 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-01 17:52:05 +0000 |
commit | 08dc0f0af530f082093315d61ecb2377a410e88c (patch) | |
tree | f81ae60b66ac8008d9ca2d22401b69061d3cb168 /plugins/Db3x_mmap | |
parent | 4bb73e18e6cabf3eece142c504d8533668c53875 (diff) |
fix against buggy key generators in early 0.94.7 builds
git-svn-id: http://svn.miranda-ng.org/main/trunk@7446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r-- | plugins/Db3x_mmap/src/dbcrypt.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/Db3x_mmap/src/dbcrypt.cpp b/plugins/Db3x_mmap/src/dbcrypt.cpp index 96981fb8f0..7aa8a0c046 100644 --- a/plugins/Db3x_mmap/src/dbcrypt.cpp +++ b/plugins/Db3x_mmap/src/dbcrypt.cpp @@ -161,14 +161,18 @@ LBL_SetNewKey: if (dbv.cpbVal != (WORD)iKeyLength)
goto LBL_SetNewKey;
- if (!m_crypto->setKey(dbv.pbVal, iKeyLength))
- if (!EnterPassword(dbv.pbVal, iKeyLength)) { // password protected?
- if (m_dbHeader.version == DB_THIS_VERSION)
- return 4;
+ if (!m_crypto->setKey(dbv.pbVal, iKeyLength)) {
+ if (!m_bEncrypted)
+ goto LBL_SetNewKey;
- // one of the early used version of mmap was replaced then by mmap_sa
- // simply remove old badly generated key
- goto LBL_SetNewKey;
+ if (!EnterPassword(dbv.pbVal, iKeyLength)) { // password protected?
+ if (m_dbHeader.version == DB_THIS_VERSION)
+ return 4;
+
+ // one of the early used version of mmap was replaced then by mmap_sa
+ // simply remove old badly generated key
+ goto LBL_SetNewKey;
+ }
}
FreeVariant(&dbv);
|