summaryrefslogtreecommitdiff
path: root/src/core/stdcrypt
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-12-01 21:50:29 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-12-01 21:50:29 +0000
commitf0dd963ab37b2ff412b4b1e0b9459d61d42ab9d4 (patch)
treecd685e29b724e79f34bcc085e224069658d0451e /src/core/stdcrypt
parent9966d00cb781bae925ed367edf94c2772e3a8c5e (diff)
method for checking a password
git-svn-id: http://svn.miranda-ng.org/main/trunk@7027 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdcrypt')
-rw-r--r--src/core/stdcrypt/encrypt.cpp6
-rw-r--r--src/core/stdcrypt/stdcrypt.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/core/stdcrypt/encrypt.cpp b/src/core/stdcrypt/encrypt.cpp
index 5be76f1c54..1616ac376f 100644
--- a/src/core/stdcrypt/encrypt.cpp
+++ b/src/core/stdcrypt/encrypt.cpp
@@ -104,6 +104,12 @@ void CStdCrypt::purgeKey(void)
m_valid = false;
}
+// checks the master password (in utf-8)
+bool CStdCrypt::checkPassword(const char *pszPassword)
+{
+ return m_password == pszPassword;
+}
+
// sets the master password (in utf-8)
void CStdCrypt::setPassword(const char *pszPassword)
{
diff --git a/src/core/stdcrypt/stdcrypt.h b/src/core/stdcrypt/stdcrypt.h
index 6129cabcc8..7b3df473d5 100644
--- a/src/core/stdcrypt/stdcrypt.h
+++ b/src/core/stdcrypt/stdcrypt.h
@@ -45,6 +45,7 @@ struct CStdCrypt : public MICryptoEngine, public MZeroedObject
STDMETHODIMP_(void) purgeKey(void); // purges a key from memory
// sets the master password (in utf-8)
+ STDMETHODIMP_(bool) checkPassword(const char *pszPassword);
STDMETHODIMP_(void) setPassword(const char *pszPassword);
// result must be freed using mir_free or assigned to mir_ptr<BYTE>