summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src/svcs_rsa.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-30 12:16:44 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-30 12:16:44 +0000
commit25ec54ea27a7099f33573b260a620ed7273176fe (patch)
tree1810a0cb35d23deeed9ccdaf0ab276a4022f9a41 /plugins/SecureIM/src/svcs_rsa.cpp
parenta546606709e6bb72e01eb38b2c8c8756608fd5d6 (diff)
- db_set_blob used everywhere for writing blobs
- DBCONTACTWRITESETTING left only in the event handlers git-svn-id: http://svn.miranda-ng.org/main/trunk@5191 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SecureIM/src/svcs_rsa.cpp')
-rw-r--r--plugins/SecureIM/src/svcs_rsa.cpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp
index a55a393875..1ef0ecbbb0 100644
--- a/plugins/SecureIM/src/svcs_rsa.cpp
+++ b/plugins/SecureIM/src/svcs_rsa.cpp
@@ -68,13 +68,7 @@ int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int
#endif
}
if (v) {
- DBCONTACTWRITESETTING cws;
- cws.szModule = MODULENAME;
- cws.szSetting = "rsa_pub";
- cws.value.type = DBVT_BLOB;
- cws.value.pbVal = pub;
- cws.value.cpbVal = pubLen;
- CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)ptr->hContact, (LPARAM)&cws);
+ db_set_blob(ptr->hContact, MODULENAME, "rsa_pub", pub, pubLen);
ptr->keyLoaded = true;
}
mir_free(cnm);
@@ -155,23 +149,10 @@ void sttGenerateRSA(LPVOID)
char pub_key[4096]; int pub_len;
exp->rsa_gen_keypair(CPP_MODE_RSA_4096);
-
- DBCONTACTWRITESETTING cws;
- cws.szModule = MODULENAME;
- cws.value.type = DBVT_BLOB;
-
exp->rsa_get_keypair(CPP_MODE_RSA_4096,(PBYTE)&priv_key,&priv_len,(PBYTE)&pub_key,&pub_len);
- cws.szSetting = "rsa_priv";
- cws.value.pbVal = (PBYTE)&priv_key;
- cws.value.cpbVal = priv_len;
- CallService(MS_DB_CONTACT_WRITESETTING, 0, (LPARAM)&cws);
-
- cws.szSetting = "rsa_pub";
- cws.value.pbVal = (PBYTE)&pub_key;
- cws.value.cpbVal = pub_len;
- CallService(MS_DB_CONTACT_WRITESETTING, 0, (LPARAM)&cws);
-
+ db_set_blob(NULL, MODULENAME, "rsa_priv", priv_key, priv_len);
+ db_set_blob(NULL, MODULENAME, "rsa_pub", pub_key, pub_len);
rsa_4096 = 1;
}