diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-20 16:21:49 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-20 16:21:49 +0000 |
commit | f424a18112032cf61d2871a6b91a5af607c171ae (patch) | |
tree | 88fedc4e28941ceecda7026f0b06eba6271f91d5 /plugins/CryptoPP/src/GPGw/passphrases.c | |
parent | bfe1bd0fc087be44c70904aee0fe4276643d206d (diff) |
CryptoPP:
changed folder structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@1083 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/src/GPGw/passphrases.c')
-rw-r--r-- | plugins/CryptoPP/src/GPGw/passphrases.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/plugins/CryptoPP/src/GPGw/passphrases.c b/plugins/CryptoPP/src/GPGw/passphrases.c new file mode 100644 index 0000000000..5e93936ffc --- /dev/null +++ b/plugins/CryptoPP/src/GPGw/passphrases.c @@ -0,0 +1,50 @@ +#include "commonheaders.h"
+
+// globale variablen
+struct passphrase *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=realloc(passphrases, sizeof(struct passphrase)*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;
+}
+
|