summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-01 17:52:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-01 17:52:05 +0000
commit08dc0f0af530f082093315d61ecb2377a410e88c (patch)
treef81ae60b66ac8008d9ca2d22401b69061d3cb168 /plugins
parent4bb73e18e6cabf3eece142c504d8533668c53875 (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')
-rw-r--r--plugins/Db3x_mmap/src/dbcrypt.cpp18
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);