summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src/main.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/main.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/main.cpp')
-rw-r--r--plugins/SecureIM/src/main.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index c4c22653af..e07e91669c 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -161,24 +161,11 @@ int onModulesLoaded(WPARAM, LPARAM)
char priv_key[4096]; int priv_len;
char pub_key[4096]; int pub_len;
- 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_unset(0, MODULENAME, "rsa_priv_2048");
- db_unset(0, MODULENAME, "rsa_pub_2048");
+ db_set_blob(NULL, MODULENAME, "rsa_priv", priv_key, priv_len);
+ db_set_blob(NULL, MODULENAME, "rsa_pub", &pub_key, pub_len);
+ db_unset(NULL, MODULENAME, "rsa_priv_2048");
+ db_unset(NULL, MODULENAME, "rsa_pub_2048");
rsa_4096 = 1;
}