summaryrefslogtreecommitdiff
path: root/protocols/JabberG/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 /protocols/JabberG/src
parentfcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff)
BYTE -> uint8_t
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp2
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp6
-rwxr-xr-xprotocols/JabberG/src/jabber_caps.cpp4
-rw-r--r--protocols/JabberG/src/jabber_ft.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_iqid.cpp14
-rwxr-xr-xprotocols/JabberG/src/jabber_misc.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.h2
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_roster.cpp4
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp74
-rw-r--r--protocols/JabberG/src/jabber_secur.h2
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp8
-rw-r--r--protocols/JabberG/src/jabber_treelist.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp8
-rw-r--r--protocols/JabberG/src/jabber_vcard.cpp4
-rw-r--r--protocols/JabberG/src/jabber_xml.cpp4
-rw-r--r--protocols/JabberG/src/jabber_zstream.cpp2
-rwxr-xr-xprotocols/JabberG/src/stdafx.h4
19 files changed, 75 insertions, 75 deletions
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp
index 2968c14f18..ddbb71ae94 100644
--- a/protocols/JabberG/src/jabber_archive.cpp
+++ b/protocols/JabberG/src/jabber_archive.cpp
@@ -257,7 +257,7 @@ void CJabberProto::OnIqResultGetCollection(const TiXmlElement *iqNode, CJabberIq
dbei.szModule = m_szModuleName;
dbei.cbBlob = (DWORD)mir_strlen(tszBody) + 1;
dbei.flags = DBEF_READ + DBEF_UTF + from;
- dbei.pBlob = (BYTE*)tszBody;
+ dbei.pBlob = (uint8_t*)tszBody;
dbei.timestamp = tmStart + atol(tszSecs);
if (!IsDuplicateEvent(hContact, dbei))
db_event_add(hContact, &dbei);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index a7ff8e6b11..13691315d6 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -321,7 +321,7 @@ void CJabberProto::ByteInitiateResult(const TiXmlElement *iqNode, CJabberIqInfo
int CJabberProto::ByteSendParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt, char* buffer, int datalen)
{
int nMethods;
- BYTE data[10];
+ uint8_t data[10];
int i;
switch (jbt->state) {
@@ -497,7 +497,7 @@ int CJabberProto::ByteSendProxyParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jb
// 04-44 dst.addr (41 bytes: 1-byte length, 40-byte SHA1 hash of [sid,srcJID,dstJID])
// 45-46 dst.port (0)
if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
- BYTE data[47];
+ uint8_t data[47];
memset(data, 0, sizeof(data));
*((DWORD*)data) = 0x03000105;
data[4] = 40;
@@ -684,7 +684,7 @@ int CJabberProto::ByteReceiveParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt,
// 04-44 dst.addr (41 bytes: 1-byte length, 40-byte SHA1 hash of [sid,srcJID,dstJID])
// 45-46 dst.port (0)
if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
- BYTE data[47];
+ uint8_t data[47];
memset(data, 0, sizeof(data));
*((DWORD*)data) = 0x03000105;
data[4] = 40;
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index d9f2652dde..0ae90f8877 100755
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -456,8 +456,8 @@ void CJabberProto::UpdateFeatHash()
feat_buf.Append(os); feat_buf.AppendChar('<');
}
- BYTE hash[MIR_SHA1_HASH_SIZE];
- mir_sha1_hash((BYTE *)feat_buf.c_str(), feat_buf.GetLength(), hash);
+ uint8_t hash[MIR_SHA1_HASH_SIZE];
+ mir_sha1_hash((uint8_t *)feat_buf.c_str(), feat_buf.GetLength(), hash);
ptrA szHash(mir_base64_encode(&hash, sizeof(hash)));
m_szFeaturesCrc = szHash;
}
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp
index 3ca2bae57e..daf69dac02 100644
--- a/protocols/JabberG/src/jabber_ft.cpp
+++ b/protocols/JabberG/src/jabber_ft.cpp
@@ -851,7 +851,7 @@ bool CJabberProto::FtHandleCidRequest(const TiXmlElement*, CJabberIqInfo *pInfo)
if (fileId < 0)
goto LBL_Error;
- mir_ptr<BYTE> buf((BYTE *)mir_alloc(data.nFileSizeLow));
+ mir_ptr<uint8_t> buf((uint8_t *)mir_alloc(data.nFileSizeLow));
_read(fileId, buf, data.nFileSizeLow);
_close(fileId);
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 9cd88f246e..32449881be 100755
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -506,10 +506,10 @@ void CJabberProto::OnIqResultGetVcardPhoto(const TiXmlElement *n, MCONTACT hCont
if (szPicType == nullptr)
return;
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha1ctx;
mir_sha1_init(&sha1ctx);
- mir_sha1_append(&sha1ctx, (BYTE *)buffer.get(), bufferLen);
+ mir_sha1_append(&sha1ctx, (uint8_t *)buffer.get(), bufferLen);
mir_sha1_finish(&sha1ctx, digest);
char digestHex[MIR_SHA1_HASH_SIZE*2 + 1];
@@ -704,8 +704,8 @@ void CJabberProto::OnIqResultGetVcard(const TiXmlElement *iqNode, CJabberIqInfo*
if (sscanf(n->GetText(), "%d-%d-%d", &nYear, &nMonth, &nDay) == 3) {
hasBday = true;
setWord(hContact, "BirthYear", (WORD)nYear);
- setByte(hContact, "BirthMonth", (BYTE)nMonth);
- setByte(hContact, "BirthDay", (BYTE)nDay);
+ setByte(hContact, "BirthMonth", (uint8_t)nMonth);
+ setByte(hContact, "BirthDay", (uint8_t)nDay);
SYSTEMTIME sToday = { 0 };
GetLocalTime(&sToday);
@@ -728,7 +728,7 @@ void CJabberProto::OnIqResultGetVcard(const TiXmlElement *iqNode, CJabberIqInfo*
if (hContact != 0) {
if (n->GetText()[0] && strchr("mMfF", n->GetText()[0]) != nullptr) {
hasGender = true;
- setByte(hContact, "Gender", (BYTE)toupper(n->GetText()[0]));
+ setByte(hContact, "Gender", (uint8_t)toupper(n->GetText()[0]));
}
}
else {
@@ -1291,10 +1291,10 @@ void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, const char *pszText, c
setByte(hContact, "AvatarType", pictureType);
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha;
mir_sha1_init(&sha);
- mir_sha1_append(&sha, (BYTE*)(char*)body, resultLen);
+ mir_sha1_append(&sha, (uint8_t*)(char*)body, resultLen);
mir_sha1_finish(&sha, digest);
GetAvatarFileName(hContact, tszFileName, _countof(tszFileName));
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 0350f28ad3..692510e09b 100755
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -101,7 +101,7 @@ MCONTACT CJabberProto::DBCreateContact(const char *jid, const char *nick, bool t
return hNewContact;
}
-bool CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType)
+bool CJabberProto::AddDbPresenceEvent(MCONTACT hContact, uint8_t btEventType)
{
if (!hContact)
return false;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index e479a1ca1b..4ac9cf3ee3 100755
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -687,7 +687,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void AddContactToRoster(const char *jid, const char *nick, const char *grpName);
void DBAddAuthRequest(const char *jid, const char *nick);
- bool AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType);
+ bool AddDbPresenceEvent(MCONTACT hContact, uint8_t btEventType);
MCONTACT DBCreateContact(const char *jid, const char *nick, bool temporary, bool stripResource);
void GetAvatarFileName(MCONTACT hContact, wchar_t *pszDest, size_t cbLen);
void ResolveTransportNicks(const char *jid);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 0a1f196cfd..ea35d49de9 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -373,7 +373,7 @@ int CJabberProto::AdhocSetStatusHandler(const TiXmlElement*, CJabberIqInfo *pInf
SetAwayMsg(status, Utf2T(szStatusMessage));
// return NoDlg setting
- db_set_b(0, "SRAway", StatusModeToDbSetting(status, "NoDlg"), (BYTE)nNoDlg);
+ db_set_b(0, "SRAway", StatusModeToDbSetting(status, "NoDlg"), (uint8_t)nNoDlg);
return JABBER_ADHOC_HANDLER_STATUS_COMPLETED;
}
diff --git a/protocols/JabberG/src/jabber_roster.cpp b/protocols/JabberG/src/jabber_roster.cpp
index 399cd91a91..25f53f0664 100644
--- a/protocols/JabberG/src/jabber_roster.cpp
+++ b/protocols/JabberG/src/jabber_roster.cpp
@@ -141,11 +141,11 @@ class CRosterEditorDlg : public CJabberDlgBase
friend struct CJabberProto;
typedef CJabberDlgBase CSuper;
- BYTE m_bRRAction;
+ uint8_t m_bRRAction;
BOOL m_bReadyToDownload = true;
BOOL m_bReadyToUpload = false;
- void _RosterSendRequest(BYTE rrAction)
+ void _RosterSendRequest(uint8_t rrAction)
{
m_bRRAction = rrAction;
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index f04c105b3c..e04321e669 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -158,38 +158,38 @@ char* TMD5Auth::getChallenge(const char *challenge)
ptrA serv(mir_utf8encode(info->conn.server));
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (BYTE*)info->conn.username, (int)mir_strlen(info->conn.username));
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)realm, (int)mir_strlen(realm));
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)info->conn.password, (int)mir_strlen(info->conn.password));
- mir_md5_finish(&ctx, (BYTE*)hash1);
+ mir_md5_append(&ctx, (uint8_t*)info->conn.username, (int)mir_strlen(info->conn.username));
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)realm, (int)mir_strlen(realm));
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)info->conn.password, (int)mir_strlen(info->conn.password));
+ mir_md5_finish(&ctx, (uint8_t*)hash1);
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (BYTE*)hash1, 16);
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce));
- mir_md5_finish(&ctx, (BYTE*)hash1);
+ mir_md5_append(&ctx, (uint8_t*)hash1, 16);
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)nonce, (int)mir_strlen(nonce));
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)cnonce, (int)mir_strlen(cnonce));
+ mir_md5_finish(&ctx, (uint8_t*)hash1);
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (BYTE*)"AUTHENTICATE:xmpp/", 18);
- mir_md5_append(&ctx, (BYTE*)(char*)serv, (int)mir_strlen(serv));
- mir_md5_finish(&ctx, (BYTE*)hash2);
+ mir_md5_append(&ctx, (uint8_t*)"AUTHENTICATE:xmpp/", 18);
+ mir_md5_append(&ctx, (uint8_t*)(char*)serv, (int)mir_strlen(serv));
+ mir_md5_finish(&ctx, (uint8_t*)hash2);
mir_md5_init(&ctx);
mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3]));
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
+ mir_md5_append(&ctx, (uint8_t*)tmpBuf, (int)mir_strlen(tmpBuf));
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)nonce, (int)mir_strlen(nonce));
mir_snprintf(tmpBuf, ":%08d:", iCallCount);
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
- mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce));
- mir_md5_append(&ctx, (BYTE*)":auth:", 6);
+ mir_md5_append(&ctx, (uint8_t*)tmpBuf, (int)mir_strlen(tmpBuf));
+ mir_md5_append(&ctx, (uint8_t*)cnonce, (int)mir_strlen(cnonce));
+ mir_md5_append(&ctx, (uint8_t*)":auth:", 6);
mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3]));
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
- mir_md5_finish(&ctx, (BYTE*)digest);
+ mir_md5_append(&ctx, (uint8_t*)tmpBuf, (int)mir_strlen(tmpBuf));
+ mir_md5_finish(&ctx, (uint8_t*)digest);
char *buf = (char*)alloca(8000);
int cbLen = mir_snprintf(buf, 8000,
@@ -230,17 +230,17 @@ TScramAuth::~TScramAuth()
mir_free(serverSignature);
}
-void TScramAuth::Hi(BYTE *res, char *passw, size_t passwLen, char *salt, size_t saltLen, int ind)
+void TScramAuth::Hi(uint8_t *res, char *passw, size_t passwLen, char *salt, size_t saltLen, int ind)
{
size_t bufLen = saltLen + sizeof(UINT32);
- BYTE *u = (BYTE*)_alloca(max(bufLen, EVP_MAX_MD_SIZE));
+ uint8_t *u = (uint8_t*)_alloca(max(bufLen, EVP_MAX_MD_SIZE));
memcpy(u, salt, saltLen); *(UINT32*)(u + saltLen) = htonl(1);
memset(res, 0, EVP_MAX_MD_SIZE);
for (int i = 0; i < ind; i++) {
unsigned int len;
- HMAC(hashMethod, (BYTE*)passw, (unsigned)passwLen, u, (unsigned)bufLen, u, &len);
+ HMAC(hashMethod, (uint8_t*)passw, (unsigned)passwLen, u, (unsigned)bufLen, u, &len);
bufLen = EVP_MD_size(hashMethod);
for (size_t j = 0; j < bufLen; j++)
@@ -292,14 +292,14 @@ char* TScramAuth::getChallenge(const char *challenge)
int hashSize = EVP_MD_size(hashMethod);
- BYTE saltedPassw[EVP_MAX_MD_SIZE];
+ uint8_t saltedPassw[EVP_MAX_MD_SIZE];
Hi(saltedPassw, info->conn.password, mir_strlen(info->conn.password), salt, saltLen, ind);
- BYTE clientKey[EVP_MAX_MD_SIZE];
+ uint8_t clientKey[EVP_MAX_MD_SIZE];
unsigned int len;
- HMAC(hashMethod, saltedPassw, hashSize, (BYTE*)"Client Key", 10, clientKey, &len);
+ HMAC(hashMethod, saltedPassw, hashSize, (uint8_t*)"Client Key", 10, clientKey, &len);
- BYTE storedKey[EVP_MAX_MD_SIZE];
+ uint8_t storedKey[EVP_MAX_MD_SIZE];
{
EVP_MD_CTX *pctx = EVP_MD_CTX_new();
EVP_DigestInit(pctx, hashMethod);
@@ -308,20 +308,20 @@ char* TScramAuth::getChallenge(const char *challenge)
EVP_MD_CTX_free(pctx);
}
- BYTE clientSig[EVP_MAX_MD_SIZE];
+ uint8_t clientSig[EVP_MAX_MD_SIZE];
CMStringA authmsg(FORMAT, "%s,%s,c=%s,r=%s", msg1, chl.get(), cbd.get(), snonce.get());
- HMAC(hashMethod, storedKey, hashSize, (BYTE*)authmsg.c_str(), authmsg.GetLength(), clientSig, &len);
+ HMAC(hashMethod, storedKey, hashSize, (uint8_t*)authmsg.c_str(), authmsg.GetLength(), clientSig, &len);
- BYTE clientProof[EVP_MAX_MD_SIZE];
+ uint8_t clientProof[EVP_MAX_MD_SIZE];
for (int j = 0; j < hashSize; j++)
clientProof[j] = clientKey[j] ^ clientSig[j];
/* Calculate the server signature */
- BYTE serverKey[EVP_MAX_MD_SIZE];
- HMAC(hashMethod, saltedPassw, hashSize, (BYTE*)"Server Key", 10, serverKey, &len);
+ uint8_t serverKey[EVP_MAX_MD_SIZE];
+ HMAC(hashMethod, saltedPassw, hashSize, (uint8_t*)"Server Key", 10, serverKey, &len);
- BYTE srvSig[EVP_MAX_MD_SIZE];
- HMAC(hashMethod, serverKey, hashSize, (BYTE*)authmsg.c_str(), authmsg.GetLength(), srvSig, &len);
+ uint8_t srvSig[EVP_MAX_MD_SIZE];
+ HMAC(hashMethod, serverKey, hashSize, (uint8_t*)authmsg.c_str(), authmsg.GetLength(), srvSig, &len);
serverSignature = mir_base64_encode(srvSig, hashSize);
ptrA encproof(mir_base64_encode(clientProof, hashSize));
diff --git a/protocols/JabberG/src/jabber_secur.h b/protocols/JabberG/src/jabber_secur.h
index ab6c5bb6cc..e17d0c03e6 100644
--- a/protocols/JabberG/src/jabber_secur.h
+++ b/protocols/JabberG/src/jabber_secur.h
@@ -100,7 +100,7 @@ public:
char* getChallenge(const char *challenge) override;
bool validateLogin(const char *challenge) override;
- void Hi(BYTE* res , char* passw, size_t passwLen, char* salt, size_t saltLen, int ind);
+ void Hi(uint8_t* res , char* passw, size_t passwLen, char* salt, size_t saltLen, int ind);
};
// ntlm auth - LanServer based authorization
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index 1197453440..d6ffefc7ab 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -256,10 +256,10 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam)
_read(fileIn, pResult, dwPngSize);
_close(fileIn);
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha1ctx;
mir_sha1_init(&sha1ctx);
- mir_sha1_append(&sha1ctx, (BYTE*)pResult, dwPngSize);
+ mir_sha1_append(&sha1ctx, (uint8_t*)pResult, dwPngSize);
mir_sha1_finish(&sha1ctx, digest);
wchar_t tFileName[MAX_PATH];
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index e012da46cd..cff0eb6468 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1225,7 +1225,7 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info)
// chatstates gone event
if (hContact && XmlGetChildByTag(node, "gone", "xmlns", JABBER_FEAT_CHATSTATES) && m_bLogChatstates) {
- BYTE bEventType = JABBER_DB_EVENT_CHATSTATES_GONE; // gone event
+ uint8_t bEventType = JABBER_DB_EVENT_CHATSTATES_GONE; // gone event
DBEVENTINFO dbei = {};
dbei.pBlob = &bEventType;
dbei.cbBlob = 1;
@@ -1439,8 +1439,8 @@ void CJabberProto::OnProcessPresenceCapabilites(const TiXmlElement *node, pResou
const char *szHash = XmlGetAttr(n, "hash");
if (szHash == nullptr) { // old version
- BYTE hashOut[MIR_SHA1_HASH_SIZE];
- mir_sha1_hash((BYTE*)szVer, mir_strlen(szVer), hashOut);
+ uint8_t hashOut[MIR_SHA1_HASH_SIZE];
+ mir_sha1_hash((uint8_t*)szVer, mir_strlen(szVer), hashOut);
char szHashOut[MIR_SHA1_HASH_SIZE*2 + 1];
r->m_pCaps = g_clientCapsManager.GetPartialCaps(szNode, bin2hex(hashOut, _countof(hashOut), szHashOut));
@@ -2050,7 +2050,7 @@ int ThreadData::send_no_strm_mgmt(TiXmlElement *node)
// strip forbidden control characters from outgoing XML stream
char *q = buf.GetBuffer();
for (char *p = buf.GetBuffer(); *p; ++p) {
- int c = *(BYTE*)p;
+ int c = *(uint8_t*)p;
if (c < 32 && c != '\t' && c != '\n' && c != '\r')
continue;
diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp
index b92b688525..5113ee35b1 100644
--- a/protocols/JabberG/src/jabber_treelist.cpp
+++ b/protocols/JabberG/src/jabber_treelist.cpp
@@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct TTreeList_ItemInfo
{
- BYTE flags;
+ uint8_t flags;
int indent, sortIndex;
struct TTreeList_ItemInfo *parent;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index d952602c46..b2d1856ce9 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -166,10 +166,10 @@ char* JabberPrepareJid(const char *jid)
char* JabberSha1(const char *str, JabberShaStrBuf buf)
{
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha;
mir_sha1_init(&sha);
- mir_sha1_append(&sha, (BYTE*)str, (int)mir_strlen(str));
+ mir_sha1_append(&sha, (uint8_t*)str, (int)mir_strlen(str));
mir_sha1_finish(&sha, digest);
bin2hex(digest, sizeof(digest), buf);
@@ -947,10 +947,10 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param)
setByte(ai.hContact, "AvatarType", pictureType);
char buffer[2 * MIR_SHA1_HASH_SIZE + 1];
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha;
mir_sha1_init(&sha);
- mir_sha1_append(&sha, (BYTE*)res->pData, res->dataLength);
+ mir_sha1_append(&sha, (uint8_t*)res->pData, res->dataLength);
mir_sha1_finish(&sha, digest);
bin2hex(digest, sizeof(digest), buffer);
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp
index 391a237ff7..f2c75e7112 100644
--- a/protocols/JabberG/src/jabber_vcard.cpp
+++ b/protocols/JabberG/src/jabber_vcard.cpp
@@ -1140,10 +1140,10 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t *szPhotoFileName)
n << XCHILD("BINVAL", str);
// NEED TO UPDATE OUR AVATAR HASH:
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha1ctx;
mir_sha1_init(&sha1ctx);
- mir_sha1_append(&sha1ctx, (BYTE*)(LPSTR)buffer, nRead);
+ mir_sha1_append(&sha1ctx, (uint8_t*)(LPSTR)buffer, nRead);
mir_sha1_finish(&sha1ctx, digest);
char buf[MIR_SHA1_HASH_SIZE * 2 + 1];
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp
index bdc64479d5..d7392b19d0 100644
--- a/protocols/JabberG/src/jabber_xml.cpp
+++ b/protocols/JabberG/src/jabber_xml.cpp
@@ -52,12 +52,12 @@ bool XmlNodeHash::VisitEnter(const TiXmlElement &pNode, const tinyxml2::XMLAttri
void XmlNodeHash::add(const char *str)
{
if (str)
- mir_md5_append(&state, (const BYTE *)str, strlen(str));
+ mir_md5_append(&state, (const uint8_t *)str, strlen(str));
}
CMStringA XmlNodeHash::getResult()
{
- BYTE digest[16];
+ uint8_t digest[16];
mir_md5_finish(&state, digest);
CMStringA res;
diff --git a/protocols/JabberG/src/jabber_zstream.cpp b/protocols/JabberG/src/jabber_zstream.cpp
index 9909027782..1e9534a5c2 100644
--- a/protocols/JabberG/src/jabber_zstream.cpp
+++ b/protocols/JabberG/src/jabber_zstream.cpp
@@ -105,7 +105,7 @@ retry:
}
zStreamIn.avail_out = datalen;
- zStreamIn.next_out = (BYTE*)data;
+ zStreamIn.next_out = (uint8_t*)data;
switch (inflate(&zStreamIn, Z_NO_FLUSH)) {
case Z_OK: proto->debugLogA("Inflate: Z_OK"); break;
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h
index 30263973f0..c007b351a7 100755
--- a/protocols/JabberG/src/stdafx.h
+++ b/protocols/JabberG/src/stdafx.h
@@ -447,9 +447,9 @@ struct filetransfer : public MZeroedObject
struct JABBER_GCLOG_FONT
{
char face[LF_FACESIZE]; // LF_FACESIZE is from LOGFONT struct
- BYTE style;
+ uint8_t style;
char size; // signed
- BYTE charset;
+ uint8_t charset;
COLORREF color;
};