From bdb57491b80e74a40d9eebf36b0be08bfd0fd320 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 28 Feb 2016 08:59:43 +0000 Subject: dbx_lmdb: fix events deletion; some fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@16367 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbcrypt.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'plugins/Dbx_mdb/src/dbcrypt.cpp') diff --git a/plugins/Dbx_mdb/src/dbcrypt.cpp b/plugins/Dbx_mdb/src/dbcrypt.cpp index e55d7f38aa..66d74ebf67 100644 --- a/plugins/Dbx_mdb/src/dbcrypt.cpp +++ b/plugins/Dbx_mdb/src/dbcrypt.cpp @@ -25,9 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ///////////////////////////////////////////////////////////////////////////////////////// -#define DBKEY_PROVIDER "Provider" -#define DBKEY_KEY "Key" -#define DBKEY_IS_ENCRYPTED "EncryptedDB" +#define DBKEY_PROVIDER "Provider" +#define DBKEY_KEY "Key" +#define DBKEY_IS_ENCRYPTED "EncryptedDB" CRYPTO_PROVIDER* CDbxMdb::SelectProvider() { @@ -101,8 +101,25 @@ int CDbxMdb::InitCrypt() else { if (!m_crypto->setKey((const BYTE*)value.mv_data, value.mv_size)) - if (!EnterPassword((const BYTE*)value.mv_data, value.mv_size)) // password protected? - return 4; + { + DlgChangePassParam param = { this }; + CEnterPasswordDialog dlg(¶m); + while (true) + { + if (-128 != dlg.DoModal()) + return 4; + + m_crypto->setPassword(pass_ptrA(mir_utf8encodeT(param.newPass))); + if (m_crypto->setKey((const BYTE*)value.mv_data, value.mv_size)) + { + m_bUsesPassword = true; + SecureZeroMemory(¶m, sizeof(param)); + break; + } + + param.wrongPass++; + } + } } } else -- cgit v1.2.3