diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 15:58:40 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 15:58:40 +0300 |
commit | fcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (patch) | |
tree | 8807aea6f2afce38b30ce60aa5ebf84a26992b73 /plugins/SecureIM/src | |
parent | af2958f2e82cb68392983da6f7f69fa3cd0c5276 (diff) |
PBYTE -> uint8_t*
Diffstat (limited to 'plugins/SecureIM/src')
-rw-r--r-- | plugins/SecureIM/src/crypt_dll.cpp | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/cryptopp.h | 14 | ||||
-rw-r--r-- | plugins/SecureIM/src/dbevent.cpp | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/main.cpp | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/mmi.cpp | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/mmi.h | 2 | ||||
-rw-r--r-- | plugins/SecureIM/src/options.cpp | 8 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_rsa.cpp | 8 | ||||
-rw-r--r-- | plugins/SecureIM/src/svcs_rsa.h | 6 |
9 files changed, 23 insertions, 23 deletions
diff --git a/plugins/SecureIM/src/crypt_dll.cpp b/plugins/SecureIM/src/crypt_dll.cpp index 0f5e049b9a..4c023ffe0a 100644 --- a/plugins/SecureIM/src/crypt_dll.cpp +++ b/plugins/SecureIM/src/crypt_dll.cpp @@ -80,7 +80,7 @@ BOOL CalculateKeyX(pUinKey ptr, MCONTACT hContact) // do this only if key exchanged is ok
// we use a 192bit key
int keysize = cpp_size_keyx();
- PBYTE buffer = (PBYTE)alloca(keysize); // buffer for hash
+ uint8_t *buffer = (uint8_t*)alloca(keysize); // buffer for hash
// store key
cpp_get_keyx(ptr->cntx, buffer);
diff --git a/plugins/SecureIM/src/cryptopp.h b/plugins/SecureIM/src/cryptopp.h index 3bf3fdd778..f6e8da912b 100644 --- a/plugins/SecureIM/src/cryptopp.h +++ b/plugins/SecureIM/src/cryptopp.h @@ -36,14 +36,14 @@ typedef struct {
int (__cdecl *rsa_gen_keypair)(short); // генерит RSA-ключи для указанной длины (либо тока 2048, либо 2048 и 4096)
- int (__cdecl *rsa_get_keypair)(short,PBYTE,int*,PBYTE,int*); // возвращает пару ключей для указанной длины
- int (__cdecl *rsa_get_keyhash)(short,PBYTE,int*,PBYTE,int*); // возвращает hash пары ключей для указанной длины
- int (__cdecl *rsa_set_keypair)(short,PBYTE,int); // устанавливает ключи, указанной длины
- int (__cdecl *rsa_get_pubkey)(HANDLE,PBYTE,int*); // возвращает паблик ключ из указанного контекста
- int (__cdecl *rsa_set_pubkey)(HANDLE,PBYTE,int); // загружает паблик ключ для указанного контекста
+ int (__cdecl *rsa_get_keypair)(short,uint8_t*,int*,uint8_t*,int*); // возвращает пару ключей для указанной длины
+ int (__cdecl *rsa_get_keyhash)(short,uint8_t*,int*,uint8_t*,int*); // возвращает hash пары ключей для указанной длины
+ int (__cdecl *rsa_set_keypair)(short,uint8_t*,int); // устанавливает ключи, указанной длины
+ int (__cdecl *rsa_get_pubkey)(HANDLE,uint8_t*,int*); // возвращает паблик ключ из указанного контекста
+ int (__cdecl *rsa_set_pubkey)(HANDLE,uint8_t*,int); // загружает паблик ключ для указанного контекста
void (__cdecl *rsa_set_timeout)(int); // установить таймаут для установки секюрного соединения
int (__cdecl *rsa_get_state)(HANDLE); // получить статус указанного контекста
- int (__cdecl *rsa_get_hash)(PBYTE,int,PBYTE,int*); // вычисляет SHA-1 (key)
+ int (__cdecl *rsa_get_hash)(uint8_t*,int,uint8_t*,int*); // вычисляет SHA-1 (key)
int (__cdecl *rsa_connect)(HANDLE); // запускает процесс установки содинения с указанным контекстом
int (__cdecl *rsa_disconnect)(HANDLE); // разрывает соединение с указанным контекстом
int (__cdecl *rsa_disabled)(HANDLE); // разрывает соединение по причине "disabled"
@@ -64,7 +64,7 @@ typedef RSA_EXPORT* pRSA_EXPORT; typedef struct {
int (__cdecl *rsa_inject)(HANDLE,LPCSTR); // вставляет сообщение в очередь на отправку
- int (__cdecl *rsa_check_pub)(HANDLE,PBYTE,int,PBYTE,int); // проверяет интерактивно SHA и сохраняет ключ, если все нормально
+ int (__cdecl *rsa_check_pub)(HANDLE,uint8_t*,int,uint8_t*,int); // проверяет интерактивно SHA и сохраняет ключ, если все нормально
void (__cdecl *rsa_notify)(HANDLE,int); // нотификация о смене состояния
} RSA_IMPORT;
typedef RSA_IMPORT* pRSA_IMPORT;
diff --git a/plugins/SecureIM/src/dbevent.cpp b/plugins/SecureIM/src/dbevent.cpp index a809314640..0905da4a5f 100644 --- a/plugins/SecureIM/src/dbevent.cpp +++ b/plugins/SecureIM/src/dbevent.cpp @@ -8,6 +8,6 @@ void HistoryLog(MCONTACT hContact, LPCSTR szText) dbei.timestamp = time(0);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = (int)mir_strlen(szText) + 1;
- dbei.pBlob = (PBYTE)szText;
+ dbei.pBlob = (uint8_t*)szText;
db_event_add(0, &dbei);
}
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index beeeddc9f0..85fa6178fb 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -95,7 +95,7 @@ static int onModulesLoaded(WPARAM, LPARAM) char priv_key[4096]; int priv_len;
char pub_key[4096]; int pub_len;
- mir_exp->rsa_get_keypair(CPP_MODE_RSA_4096, (PBYTE)&priv_key, &priv_len, (PBYTE)&pub_key, &pub_len);
+ mir_exp->rsa_get_keypair(CPP_MODE_RSA_4096, (uint8_t*)&priv_key, &priv_len, (uint8_t*)&pub_key, &pub_len);
db_set_blob(0, MODULENAME, "rsa_priv", priv_key, priv_len);
db_set_blob(0, MODULENAME, "rsa_pub", &pub_key, pub_len);
g_plugin.delSetting("rsa_priv_2048");
diff --git a/plugins/SecureIM/src/mmi.cpp b/plugins/SecureIM/src/mmi.cpp index aa6e048882..8e77158930 100644 --- a/plugins/SecureIM/src/mmi.cpp +++ b/plugins/SecureIM/src/mmi.cpp @@ -70,7 +70,7 @@ char* m_ustrcat(LPCSTR strA, LPCSTR strB) LPSTR m_hex = nullptr;
-LPSTR to_hex(PBYTE bin, int len)
+LPSTR to_hex(uint8_t *bin, int len)
{
SAFE_FREE(m_hex);
m_hex = (LPSTR)mir_alloc(len * 3 + 1);
diff --git a/plugins/SecureIM/src/mmi.h b/plugins/SecureIM/src/mmi.h index 022de440de..e82f2419ab 100644 --- a/plugins/SecureIM/src/mmi.h +++ b/plugins/SecureIM/src/mmi.h @@ -5,7 +5,7 @@ char *m_wwstrcat(LPCSTR,LPCSTR); char *m_awstrcat(LPCSTR,LPCSTR);
char *m_aastrcat(LPCSTR,LPCSTR);
char *m_ustrcat(LPCSTR,LPCSTR);
-LPSTR to_hex(PBYTE,int);
+LPSTR to_hex(uint8_t*,int);
LPSTR utf8_to_miranda(LPCSTR,DWORD&);
LPSTR miranda_to_utf8(LPCSTR,DWORD);
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 8f9f7e1209..c0b2880147 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -150,8 +150,8 @@ static void setListViewPUB(HWND hLV, UINT iItem, UINT iStatus) pUinKey ptr = (pUinKey)getListViewParam(hLV, iItem);
if (db_get(ptr->hContact, MODULENAME, "rsa_pub", &dbv) == 0) {
int len;
- mir_exp->rsa_get_hash((PBYTE)dbv.pbVal, dbv.cpbVal, (PBYTE)str, &len);
- sha = mir_strdup(to_hex((PBYTE)str, len));
+ mir_exp->rsa_get_hash((uint8_t*)dbv.pbVal, dbv.cpbVal, (uint8_t*)str, &len);
+ sha = mir_strdup(to_hex((uint8_t*)str, len));
db_free(&dbv);
}
}
@@ -773,7 +773,7 @@ static INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wPara if (!LoadImportRSAKeyDlg(hDlg, pub, 0)) return TRUE;
if (mir_exp->rsa_import_pubkey(ptr->cntx, pub)) {
int len;
- mir_exp->rsa_get_pubkey(ptr->cntx, (PBYTE)pub, &len);
+ mir_exp->rsa_get_pubkey(ptr->cntx, (uint8_t*)pub, &len);
db_set_blob(ptr->hContact, MODULENAME, "rsa_pub", pub, len);
setListViewPUB(hLV, idx, 1);
@@ -979,7 +979,7 @@ static void RefreshProtoDlg(HWND hDlg) EnableWindow(GetDlgItem(hDlg, IDC_SPLITON), false);
EnableWindow(GetDlgItem(hDlg, IDC_SPLITOFF), false);
- BYTE sha[64]; int len; mir_exp->rsa_get_keyhash(CPP_MODE_RSA, nullptr, nullptr, (PBYTE)&sha, &len);
+ BYTE sha[64]; int len; mir_exp->rsa_get_keyhash(CPP_MODE_RSA, nullptr, nullptr, (uint8_t*)&sha, &len);
LPSTR txt = mir_strdup(to_hex(sha, len));
SetDlgItemText(hDlg, IDC_RSA_SHA, txt);
mir_free(txt);
diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp index 7518761418..dac6992713 100644 --- a/plugins/SecureIM/src/svcs_rsa.cpp +++ b/plugins/SecureIM/src/svcs_rsa.cpp @@ -28,7 +28,7 @@ int __cdecl rsa_inject(HANDLE context, LPCSTR msg) #define MSGSIZE 1024
-int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int sigLen)
+int __cdecl rsa_check_pub(HANDLE context, uint8_t *pub, int pubLen, PBYTE sig, int sigLen)
{
int v = 0, k = 0;
pUinKey ptr = getUinCtx(context); if (!ptr) return 0;
@@ -44,8 +44,8 @@ int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int dbv.type = DBVT_BLOB;
if (db_get(ptr->hContact, MODULENAME, "rsa_pub", &dbv) == 0) {
k = 1;
- PBYTE buf = (PBYTE)alloca(sigLen); int len;
- mir_exp->rsa_get_hash((PBYTE)dbv.pbVal, dbv.cpbVal, (PBYTE)buf, &len);
+ uint8_t *buf = (uint8_t*)alloca(sigLen); int len;
+ mir_exp->rsa_get_hash((uint8_t*)dbv.pbVal, dbv.cpbVal, (uint8_t*)buf, &len);
sha_old = mir_strdup(to_hex(buf, len));
db_free(&dbv);
}
@@ -153,7 +153,7 @@ void sttGenerateRSA(LPVOID) char pub_key[4096]; int pub_len;
mir_exp->rsa_gen_keypair(CPP_MODE_RSA_4096);
- mir_exp->rsa_get_keypair(CPP_MODE_RSA_4096, (PBYTE)&priv_key, &priv_len, (PBYTE)&pub_key, &pub_len);
+ mir_exp->rsa_get_keypair(CPP_MODE_RSA_4096, (uint8_t*)&priv_key, &priv_len, (uint8_t*)&pub_key, &pub_len);
db_set_blob(0, MODULENAME, "rsa_priv", priv_key, priv_len);
db_set_blob(0, MODULENAME, "rsa_pub", pub_key, pub_len);
diff --git a/plugins/SecureIM/src/svcs_rsa.h b/plugins/SecureIM/src/svcs_rsa.h index f076d3bd8b..c6c84e4c20 100644 --- a/plugins/SecureIM/src/svcs_rsa.h +++ b/plugins/SecureIM/src/svcs_rsa.h @@ -5,9 +5,9 @@ extern pRSA_EXPORT mir_exp; extern RSA_IMPORT imp;
extern BOOL rsa_4096;
-int __cdecl rsa_inject(HANDLE,LPCSTR);
-int __cdecl rsa_check_pub(HANDLE,PBYTE,int,PBYTE,int);
-void __cdecl rsa_notify(HANDLE,int);
+int __cdecl rsa_inject(HANDLE, LPCSTR);
+int __cdecl rsa_check_pub(HANDLE, uint8_t*, int, uint8_t*, int);
+void __cdecl rsa_notify(HANDLE, int);
void sttGenerateRSA(LPVOID);
BYTE loadRSAkey(pUinKey);
|