summaryrefslogtreecommitdiff
path: root/plugins/CryptoPP/src/GPGw/passphrases.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-11 17:48:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-11 17:48:18 +0000
commit2fbe1d2262383b272ef887d712f308f787cf33f1 (patch)
tree772a78df1caf0be843d8778344e02ac750ba7a03 /plugins/CryptoPP/src/GPGw/passphrases.cpp
parent48fc03aa394f4506c6053323386c040fede13a29 (diff)
64-bit compatible version of CryptoPP
git-svn-id: http://svn.miranda-ng.org/main/trunk@4917 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/src/GPGw/passphrases.cpp')
-rw-r--r--plugins/CryptoPP/src/GPGw/passphrases.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/CryptoPP/src/GPGw/passphrases.cpp b/plugins/CryptoPP/src/GPGw/passphrases.cpp
new file mode 100644
index 0000000000..847472f5ac
--- /dev/null
+++ b/plugins/CryptoPP/src/GPGw/passphrases.cpp
@@ -0,0 +1,51 @@
+#include "../commonheaders.h"
+#include "gpgw.h"
+
+// globale variablen
+struct passphrase_t *passphrases;
+int passphrasecount;
+
+
+void initPassphrases(void)
+{
+ passphrasecount=0;
+ passphrases=NULL;
+}
+
+
+void releasePassphrases(void)
+{
+ int i;
+
+ for(i=0; i<passphrasecount; i++)
+ ZeroMemory(passphrases[i].passphrase, sizeof(passphrases[i].passphrase));
+
+ free(passphrases);
+}
+
+
+void addPassphrase(const char *akeyuserid, const char *apassphrase)
+{
+ passphrasecount++;
+ passphrases = (passphrase_t*)realloc(passphrases, sizeof(struct passphrase_t)*passphrasecount);
+
+ strcpy(passphrases[passphrasecount-1].keyuserid, akeyuserid);
+ strcpy(passphrases[passphrasecount-1].passphrase, apassphrase);
+}
+
+
+char *getPassphrase(const char *akeyuserid)
+{
+ int i;
+ char *result;
+
+ result=NULL;
+ for(i=0; i<passphrasecount; i++)
+ {
+ if(strcmp(passphrases[i].keyuserid, akeyuserid)==0)
+ result=passphrases[i].passphrase;
+ }
+
+ return result;
+}
+