summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-04-24 14:05:14 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-04-24 14:05:14 +0000
commite6025ae37081310f2bd0bf2e5a1aec8d06d06f82 (patch)
tree43ed713a034d3c65243c222a13b1b38cd09b7a5d /plugins/New_GPG/src
parent6fb6adb873fdf453a9c712c5ec8cdfa3182d1973 (diff)
New GPG:
- minor fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@13082 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src')
-rwxr-xr-xplugins/New_GPG/src/main.cpp19
-rwxr-xr-xplugins/New_GPG/src/messages.cpp4
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp2
3 files changed, 13 insertions, 12 deletions
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index e2981a0344..ddd12c5cdb 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -1296,7 +1296,7 @@ static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wPara
SetDlgItemText(hwndDlg, ID_IMPORT, tmp[0]?TranslateT("Replace"):TranslateT("Accept"));
mir_free(tmp);
tmp = new TCHAR [256];
- mir_sntprintf(tmp, 255,TranslateT("Received key from %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
+ mir_sntprintf(tmp, 255*sizeof(TCHAR),TranslateT("Received key from %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
SetDlgItemText(hwndDlg, IDC_KEY_FROM, tmp);
delete [] tmp;
}
@@ -2086,7 +2086,8 @@ void InitCheck()
PROTOACCOUNT **accounts;
ProtoEnumAccounts(&count, &accounts);
string question;
- char *keyid = nullptr, *key = nullptr;
+ //char *keyid = nullptr, *key = nullptr;
+ char *keyid = nullptr;
for(int i = 0; i < count; i++)
{
if(StriStr(accounts[i]->szModuleName, "metacontacts"))
@@ -2104,7 +2105,7 @@ void InitCheck()
question = Translate("Your secret key with ID: ");
mir_free(keyid);
keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
- key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "");
+ //key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "");
if((p = out.find(keyid)) == string::npos)
{
question += keyid;
@@ -2167,7 +2168,7 @@ void InitCheck()
}
question = Translate("Your secret key with ID: ");
keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
- key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "");
+ char *key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "");
if(!db_get_b(NULL, szGPGModuleName, "FirstRun", 1) && (!keyid[0] || !key[0]))
{
question = Translate("You didn't set a private key.\nWould you like to set it now?");
@@ -2225,7 +2226,7 @@ void InitCheck()
}
//TODO: check for expired key
mir_free(keyid);
- mir_free(key);
+ //mir_free(key);
}
{
TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
@@ -2245,8 +2246,8 @@ void InitCheck()
ICQ_CUSTOMCAP cap;
cap.cbSize = sizeof(ICQ_CUSTOMCAP);
cap.hIcon = 0;
- strncpy(cap.name, "GPG Key AutoExchange", MAX_CAPNAME-1);
- strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)-1);
+ strncpy(cap.name, "GPG Key AutoExchange", MAX_CAPNAME);
+ strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps));
for(int i = 0; i < count; i++)
if( ProtoServiceExists(accounts[i]->szProtoName, PS_ICQ_ADDCAPABILITY))
@@ -2260,8 +2261,8 @@ void InitCheck()
ICQ_CUSTOMCAP cap;
cap.cbSize = sizeof(ICQ_CUSTOMCAP);
cap.hIcon = 0;
- strncpy(cap.name, "GPG Encrypted FileTransfers", MAX_CAPNAME-1);
- strncpy(cap.caps, "GPGFileTransfer", sizeof(cap.caps)-1);
+ strncpy(cap.name, "GPG Encrypted FileTransfers", MAX_CAPNAME);
+ strncpy(cap.caps, "GPGFileTransfer", sizeof(cap.caps));
for(int i = 0; i < count; i++)
if( ProtoServiceExists(accounts[i]->szProtoName, PS_ICQ_ADDCAPABILITY))
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index 0971b32335..27d6258d50 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -538,7 +538,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
if(uin) {
if( ProtoServiceExists(proto, PS_ICQ_CHECKCAPABILITY)) {
ICQ_CUSTOMCAP cap = {0};
- strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)-1);
+ strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps));
if(ProtoCallService(proto, PS_ICQ_CHECKCAPABILITY, (WPARAM)ccs->hContact, (LPARAM)&cap)) {
CallContactService(ccs->hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)"-----PGP KEY REQUEST-----");
return 0;
@@ -846,7 +846,7 @@ int HookSendMsg(WPARAM w, LPARAM l)
if(bDebugLog)
debuglog<<std::string(time_str()+": info(autoexchange, icq): checking for autoexchange icq capability, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR)));
ICQ_CUSTOMCAP cap = {0};
- strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)-1);
+ strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps));
if( ProtoCallService(proto, PS_ICQ_CHECKCAPABILITY, hContact, (LPARAM)&cap)) {
if(bDebugLog)
debuglog<<std::string(time_str()+": info(autoexchange, icq): sending key requiest, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR)));
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index eb48e37e08..349fd98e04 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -544,7 +544,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l)
if( ProtoServiceExists(proto, PS_ICQ_CHECKCAPABILITY)) {
supported_proto = true;
ICQ_CUSTOMCAP cap = {0};
- strncpy(cap.caps, "GPGFileTransfer",sizeof(cap.caps)-1);
+ strncpy(cap.caps, "GPGFileTransfer",sizeof(cap.caps));
if( ProtoCallService(proto, PS_ICQ_CHECKCAPABILITY, (WPARAM)ccs->hContact, (LPARAM)&cap))
cap_found = true;
}