summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
commit62a186697df33c96dc1a6dac0f4dfc38652fb96f (patch)
tree1437d0906218fae8827aed384026f2b7e656f4ac /plugins/SecureIM/src
parentfcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff)
BYTE -> uint8_t
Diffstat (limited to 'plugins/SecureIM/src')
-rw-r--r--plugins/SecureIM/src/commonheaders.cpp2
-rw-r--r--plugins/SecureIM/src/commonheaders.h2
-rw-r--r--plugins/SecureIM/src/crypt.h12
-rw-r--r--plugins/SecureIM/src/crypt_check.cpp4
-rw-r--r--plugins/SecureIM/src/crypt_dll.cpp2
-rw-r--r--plugins/SecureIM/src/crypt_icons.cpp2
-rw-r--r--plugins/SecureIM/src/images.cpp24
-rw-r--r--plugins/SecureIM/src/loadicons.cpp4
-rw-r--r--plugins/SecureIM/src/loadlib.h8
-rw-r--r--plugins/SecureIM/src/options.cpp4
-rw-r--r--plugins/SecureIM/src/popupOptions.cpp12
-rw-r--r--plugins/SecureIM/src/secureim.h2
-rw-r--r--plugins/SecureIM/src/svcs_menu.cpp6
-rw-r--r--plugins/SecureIM/src/svcs_rsa.cpp2
-rw-r--r--plugins/SecureIM/src/svcs_rsa.h2
15 files changed, 44 insertions, 44 deletions
diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp
index b0e258eadd..8355b59a75 100644
--- a/plugins/SecureIM/src/commonheaders.cpp
+++ b/plugins/SecureIM/src/commonheaders.cpp
@@ -18,7 +18,7 @@ int iBmpDepth;
BOOL bPGPloaded = false, bPGPkeyrings = false, bUseKeyrings = false, bPGPprivkey = false;
BOOL bGPGloaded = false, bGPGkeyrings = false, bSavePass = false;
BOOL bSFT, bSOM, bASI, bMCD, bSCM, bDGP, bAIP, bNOL, bAAK, bMCM;
-BYTE bPGP, bGPG;
+uint8_t bPGP, bGPG;
mir_cs localQueueMutex;
LPSTR myDBGetStringDecode(MCONTACT hContact, const char *szModule, const char *szSetting)
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h
index bbd2c7e47d..50c84cf18b 100644
--- a/plugins/SecureIM/src/commonheaders.h
+++ b/plugins/SecureIM/src/commonheaders.h
@@ -86,7 +86,7 @@ extern int iBmpDepth;
extern BOOL bPGPloaded, bPGPkeyrings, bUseKeyrings, bPGPprivkey;
extern BOOL bGPGloaded, bGPGkeyrings, bSavePass;
extern BOOL bSFT, bSOM, bASI, bMCD, bSCM, bDGP, bAIP, bNOL, bAAK, bMCM;
-extern BYTE bPGP, bGPG;
+extern uint8_t bPGP, bGPG;
extern mir_cs localQueueMutex;
__forceinline int SendBroadcast(MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
diff --git a/plugins/SecureIM/src/crypt.h b/plugins/SecureIM/src/crypt.h
index a40d3c501c..f774dc9f44 100644
--- a/plugins/SecureIM/src/crypt.h
+++ b/plugins/SecureIM/src/crypt.h
@@ -42,8 +42,8 @@ struct UinKey
MCONTACT hContact; // handle of contact
u_int header; // HEADER
pSupPro proto; // proto struct
- BYTE mode,tmode; // mode: Native,PGP,GPG,RSA/AES,RSA [0..4]
- BYTE status,tstatus; // status: Disabled,Enabled,AlwaysTry [0..2] for Native mode
+ uint8_t mode,tmode; // mode: Native,PGP,GPG,RSA/AES,RSA [0..4]
+ uint8_t status,tstatus; // status: Disabled,Enabled,AlwaysTry [0..2] for Native mode
LPSTR msgSplitted; // message to combine
pPM msgPart; // parts of message
pWM msgQueue; // last messages not sended or to resend;
@@ -56,8 +56,8 @@ struct UinKey
BOOL decoded; // false on decode error
short features;
HANDLE cntx; // crypto context
- BYTE keyLoaded; // ( 1-PGP, 2-GPG ) | 1-RSA
- BYTE gpgMode,tgpgMode; // 0-UTF8, 1-ANSI
+ uint8_t keyLoaded; // ( 1-PGP, 2-GPG ) | 1-RSA
+ uint8_t gpgMode,tgpgMode; // 0-UTF8, 1-ANSI
char *lastFileRecv;
char *lastFileSend;
char **fileSend;
@@ -105,7 +105,7 @@ void getContactUinA(MCONTACT hContact, LPSTR szUIN);
int getContactStatus(MCONTACT);
bool isSecureProtocol(MCONTACT hContact);
-BYTE isContactSecured(MCONTACT hContact);
+uint8_t isContactSecured(MCONTACT hContact);
bool isClientMiranda(pUinKey ptr, BOOL emptyMirverAsMiranda=FALSE);
bool isClientMiranda(MCONTACT hContact, BOOL emptyMirverAsMiranda=FALSE);
bool isProtoSmallPackets(MCONTACT);
@@ -144,7 +144,7 @@ void showPopupRM(MCONTACT);
// crypt_dll.cpp
LPSTR InitKeyA(pUinKey, int);
int InitKeyB(pUinKey, LPCSTR);
-void InitKeyX(pUinKey, BYTE*);
+void InitKeyX(pUinKey, uint8_t*);
BOOL CalculateKeyX(pUinKey, MCONTACT);
LPSTR encodeMsg(pUinKey, LPARAM);
LPSTR decodeMsg(pUinKey, LPARAM, LPSTR);
diff --git a/plugins/SecureIM/src/crypt_check.cpp b/plugins/SecureIM/src/crypt_check.cpp
index 1cf85abbff..802b82c32e 100644
--- a/plugins/SecureIM/src/crypt_check.cpp
+++ b/plugins/SecureIM/src/crypt_check.cpp
@@ -18,7 +18,7 @@ bool isSecureProtocol(MCONTACT hContact)
return ptr->inspecting != 0;
}
-BYTE isContactSecured(MCONTACT hContact)
+uint8_t isContactSecured(MCONTACT hContact)
{
// нужна проверка на Offline и в этом случае другие статусы
if (!arClist.getCount()) return 0;
@@ -30,7 +30,7 @@ BYTE isContactSecured(MCONTACT hContact)
if (!p || !p->proto || !p->proto->inspecting)
return false;
- BYTE res = p->mode;
+ uint8_t res = p->mode;
DBVARIANT dbv;
switch (p->mode) {
case MODE_NATIVE:
diff --git a/plugins/SecureIM/src/crypt_dll.cpp b/plugins/SecureIM/src/crypt_dll.cpp
index 4c023ffe0a..dbf655111f 100644
--- a/plugins/SecureIM/src/crypt_dll.cpp
+++ b/plugins/SecureIM/src/crypt_dll.cpp
@@ -63,7 +63,7 @@ int InitKeyB(pUinKey ptr, LPCSTR key)
// store KeyX into context
-void InitKeyX(pUinKey ptr, BYTE *key)
+void InitKeyX(pUinKey ptr, uint8_t *key)
{
if (!ptr->cntx)
ptr->cntx = cpp_create_context(isProtoSmallPackets(ptr->hContact) ? CPP_MODE_BASE64 : 0);
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp
index bed0d48ad4..d660c51479 100644
--- a/plugins/SecureIM/src/crypt_icons.cpp
+++ b/plugins/SecureIM/src/crypt_icons.cpp
@@ -96,7 +96,7 @@ void ShowStatusIcon(MCONTACT hContact)
void ShowStatusIconNotify(MCONTACT hContact)
{
- BYTE mode = isContactSecured(hContact);
+ uint8_t mode = isContactSecured(hContact);
NotifyEventHooks(g_hEvent[(mode&SECURED) != 0], hContact, 0);
ShowStatusIcon(hContact, mode);
}
diff --git a/plugins/SecureIM/src/images.cpp b/plugins/SecureIM/src/images.cpp
index 60a1af63d1..acf8c3ac7c 100644
--- a/plugins/SecureIM/src/images.cpp
+++ b/plugins/SecureIM/src/images.cpp
@@ -8,7 +8,7 @@ void HalfBitmap32Alpha(HBITMAP hBitmap)
return;
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- BYTE *p = (BYTE *)malloc(dwLen);
+ uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
memset(p, 0, dwLen);
@@ -16,7 +16,7 @@ void HalfBitmap32Alpha(HBITMAP hBitmap)
GetBitmapBits(hBitmap, dwLen, p);
for (int y = 0; y < bmp.bmHeight; ++y) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (int x = 0; x < bmp.bmWidth; ++x) {
px[3] >>= 1;
@@ -38,7 +38,7 @@ void MakeBmpTransparent(HBITMAP hBitmap)
return;
DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- BYTE *p = (BYTE *)malloc(dwLen);
+ uint8_t *p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
@@ -53,7 +53,7 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force)
{
BITMAP bmp;
DWORD dwLen;
- BYTE *p;
+ uint8_t *p;
int x, y;
BOOL fixIt;
@@ -63,7 +63,7 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force)
return;
dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
- p = (BYTE *)malloc(dwLen);
+ p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return;
memset(p, 0, dwLen);
@@ -72,7 +72,7 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force)
fixIt = TRUE;
for (y = 0; fixIt && y < bmp.bmHeight; ++y) {
- BYTE *px = p + bmp.bmWidth * 4 * y;
+ uint8_t *px = p + bmp.bmWidth * 4 * y;
for (x = 0; fixIt && x < bmp.bmWidth; ++x) {
if (px[3] != 0 && !force) {
@@ -96,16 +96,16 @@ void CorrectBitmap32Alpha(HBITMAP hBitmap, BOOL force)
HBITMAP CopyBitmapTo32(HBITMAP hBitmap)
{
- BYTE * ptPixels;
+ uint8_t * ptPixels;
BITMAP bmp;
DWORD dwLen;
- BYTE *p;
+ uint8_t *p;
GetObject(hBitmap, sizeof(bmp), &bmp);
dwLen = bmp.bmWidth * bmp.bmHeight * 4;
- p = (BYTE *)malloc(dwLen);
+ p = (uint8_t *)malloc(dwLen);
if (p == nullptr)
return nullptr;
@@ -197,8 +197,8 @@ BOOL MakeBitmap32(HBITMAP *hBitmap)
BOOL MakeGrayscale(HBITMAP *hBitmap)
{
- BYTE *p = nullptr;
- BYTE *p1;
+ uint8_t *p = nullptr;
+ uint8_t *p1;
DWORD dwLen;
int width, height, x, y;
BITMAP bmp;
@@ -208,7 +208,7 @@ BOOL MakeGrayscale(HBITMAP *hBitmap)
height = bmp.bmHeight;
dwLen = width * height * 4;
- p = (BYTE *)malloc(dwLen);
+ p = (uint8_t *)malloc(dwLen);
if (p == nullptr) {
return FALSE;
}
diff --git a/plugins/SecureIM/src/loadicons.cpp b/plugins/SecureIM/src/loadicons.cpp
index 5a1eea67a3..3ab3b30c77 100644
--- a/plugins/SecureIM/src/loadicons.cpp
+++ b/plugins/SecureIM/src/loadicons.cpp
@@ -3,8 +3,8 @@
struct
{
int key; // Resource ID
- BYTE tbl; // Table NUM
- BYTE idx; // Table IDX
+ uint8_t tbl; // Table NUM
+ uint8_t idx; // Table IDX
char *section;
char *name;
char *text;
diff --git a/plugins/SecureIM/src/loadlib.h b/plugins/SecureIM/src/loadlib.h
index bed84c019d..cbdab9789a 100644
--- a/plugins/SecureIM/src/loadlib.h
+++ b/plugins/SecureIM/src/loadlib.h
@@ -22,11 +22,11 @@ typedef int (__cdecl * _cpp_get_features) (HANDLE);
typedef int (__cdecl * _cpp_get_error) (HANDLE);
typedef int (__cdecl * _cpp_get_version) (void);
typedef int (__cdecl * _cpp_size_keyx) (void);
-typedef void (__cdecl * _cpp_get_keyx) (HANDLE,BYTE*);
-typedef void (__cdecl * _cpp_set_keyx) (HANDLE,BYTE*);
+typedef void (__cdecl * _cpp_get_keyx) (HANDLE,uint8_t*);
+typedef void (__cdecl * _cpp_set_keyx) (HANDLE,uint8_t*);
typedef int (__cdecl * _cpp_size_keyp) (void);
-typedef void (__cdecl * _cpp_get_keyp) (HANDLE,BYTE*);
-typedef void (__cdecl * _cpp_set_keyp) (HANDLE,BYTE*);
+typedef void (__cdecl * _cpp_get_keyp) (HANDLE,uint8_t*);
+typedef void (__cdecl * _cpp_set_keyp) (HANDLE,uint8_t*);
typedef int (__cdecl * _cpp_keya) (HANDLE);
typedef int (__cdecl * _cpp_keyb) (HANDLE);
typedef int (__cdecl * _cpp_keyx) (HANDLE);
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp
index c0b2880147..a4d6312d95 100644
--- a/plugins/SecureIM/src/options.cpp
+++ b/plugins/SecureIM/src/options.cpp
@@ -255,7 +255,7 @@ void ListView_Sort(HWND hLV, LPARAM lParamSort)
if ((lParamSort & 0x0F) == 0)
lParamSort = (int)g_plugin.getByte(t, lParamSort + 1);
- g_plugin.setByte(t, (BYTE)lParamSort);
+ g_plugin.setByte(t, (uint8_t)lParamSort);
// restore sort order
mir_snprintf(t, "os%02x", (UINT)lParamSort);
@@ -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, (uint8_t*)&sha, &len);
+ uint8_t 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/popupOptions.cpp b/plugins/SecureIM/src/popupOptions.cpp
index 2091d6294c..5d66fb436f 100644
--- a/plugins/SecureIM/src/popupOptions.cpp
+++ b/plugins/SecureIM/src/popupOptions.cpp
@@ -108,27 +108,27 @@ INT_PTR CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l
break;
case IDC_EC:
//set ec checkbox value
- g_plugin.setByte("ec", (BYTE)(SendMessage(hec, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("ec", (uint8_t)(SendMessage(hec, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_DC:
//set dc checkbox value
- g_plugin.setByte("dc", (BYTE)(SendMessage(hdc, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("dc", (uint8_t)(SendMessage(hdc, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_SS:
//set ss checkbox value
- g_plugin.setByte("ss", (BYTE)(SendMessage(hss, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("ss", (uint8_t)(SendMessage(hss, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_SR:
//set sr checkbox value
- g_plugin.setByte("sr", (BYTE)(SendMessage(hsr, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("sr", (uint8_t)(SendMessage(hsr, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_KS:
//set indicator checkbox value
- g_plugin.setByte("ks", (BYTE)(SendMessage(hks, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("ks", (uint8_t)(SendMessage(hks, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_KR:
//set indicator checkbox value
- g_plugin.setByte("kr", (BYTE)(SendMessage(hkr, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
+ g_plugin.setByte("kr", (uint8_t)(SendMessage(hkr, BM_GETCHECK, 0L, 0L) == BST_CHECKED));
break;
case IDC_TIMEKEY:
//set timeout value
diff --git a/plugins/SecureIM/src/secureim.h b/plugins/SecureIM/src/secureim.h
index 8962a4a058..41f9f40cad 100644
--- a/plugins/SecureIM/src/secureim.h
+++ b/plugins/SecureIM/src/secureim.h
@@ -37,7 +37,7 @@
struct SIG {
char *sig;
- BYTE len;
+ uint8_t len;
char key;
};
diff --git a/plugins/SecureIM/src/svcs_menu.cpp b/plugins/SecureIM/src/svcs_menu.cpp
index b99b2409fb..ba11869bac 100644
--- a/plugins/SecureIM/src/svcs_menu.cpp
+++ b/plugins/SecureIM/src/svcs_menu.cpp
@@ -25,7 +25,7 @@ INT_PTR __cdecl Service_Status(WPARAM wParam, LPARAM lParam)
case STATUS_ALWAYSTRY:
pUinKey ptr = getUinKey(wParam);
if (ptr) {
- ptr->status = ptr->tstatus = (BYTE)lParam;
+ ptr->status = ptr->tstatus = (uint8_t)lParam;
if (ptr->status == STATUS_ENABLED)
db_unset(ptr->hContact, MODULENAME, "StatusID");
else
@@ -165,8 +165,8 @@ INT_PTR __cdecl Service_Mode(WPARAM wParam, LPARAM lParam)
ptr->cntx = nullptr;
ptr->keyLoaded = 0;
}
- ptr->mode = (BYTE)lParam;
- db_set_b(wParam, MODULENAME, "mode", (BYTE)lParam);
+ ptr->mode = (uint8_t)lParam;
+ db_set_b(wParam, MODULENAME, "mode", (uint8_t)lParam);
}
ShowStatusIcon(wParam);
break;
diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp
index dac6992713..abf697eee7 100644
--- a/plugins/SecureIM/src/svcs_rsa.cpp
+++ b/plugins/SecureIM/src/svcs_rsa.cpp
@@ -161,7 +161,7 @@ void sttGenerateRSA(LPVOID)
}
// загружает паблик-ключ в RSA контекст
-BYTE loadRSAkey(pUinKey ptr)
+uint8_t loadRSAkey(pUinKey ptr)
{
if (!ptr->keyLoaded) {
DBVARIANT dbv;
diff --git a/plugins/SecureIM/src/svcs_rsa.h b/plugins/SecureIM/src/svcs_rsa.h
index c6c84e4c20..5edb7b7af4 100644
--- a/plugins/SecureIM/src/svcs_rsa.h
+++ b/plugins/SecureIM/src/svcs_rsa.h
@@ -10,7 +10,7 @@ int __cdecl rsa_check_pub(HANDLE, uint8_t*, int, uint8_t*, int);
void __cdecl rsa_notify(HANDLE, int);
void sttGenerateRSA(LPVOID);
-BYTE loadRSAkey(pUinKey);
+uint8_t loadRSAkey(pUinKey);
void createRSAcntx(pUinKey);
void resetRSAcntx(pUinKey);
void deleteRSAcntx(pUinKey);