diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-15 14:21:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-15 14:21:16 +0000 |
commit | 21c56b9074fbfdacba112a51ae3b54edfa243e59 (patch) | |
tree | 9880c23569b1012e2ae78b43a45b661a0742d616 /protocols/MRA/src/Mra_proto.cpp | |
parent | 7651a0799879e5af9a6831551c1c73f6e4890143 (diff) |
custom base64 & sha1 libs removed from MRA
git-svn-id: http://svn.miranda-ng.org/main/trunk@5702 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src/Mra_proto.cpp')
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index a733c433bf..08f933154d 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -1759,14 +1759,14 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *pl // pre processing - extracting/decoding
if (dwFlags & MESSAGE_FLAG_AUTHORIZE) { // extract auth message из обычного текста
- size_t dwAuthPartsCount, dwAuthBuffSize = (plpsText->dwSize+32), dwAuthDataSize;
- LPBYTE lpbAuthData, lpbDataCurrent;
+ size_t dwAuthPartsCount, dwAuthBuffSize = (plpsText->dwSize+32);
+ LPBYTE lpbDataCurrent;
MRA_LPS lpsAuthFrom, lpsAuthMessage;
- lpbAuthData = (LPBYTE)mir_calloc(dwAuthBuffSize);
+ LPS2ANSI(szText, plpsText->lpszData, plpsText->dwSize);
+ unsigned dwAuthDataSize;
+ LPBYTE lpbAuthData = (LPBYTE)mir_base64_decode(szText, &dwAuthDataSize);
if (lpbAuthData) {
- BASE64DecodeFormated(plpsText->lpszData, plpsText->dwSize, lpbAuthData, dwAuthBuffSize, &dwAuthDataSize);
-
lpbDataCurrent = lpbAuthData;
dwAuthPartsCount = GetUL(&lpbDataCurrent);
if ( !GetLPS(lpbAuthData, dwAuthDataSize, &lpbDataCurrent, &lpsAuthFrom))
@@ -1809,14 +1809,15 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *pl else {
if ((dwFlags & MESSAGE_FLAG_RTF) && plpsRFTText) //MESSAGE_FLAG_FLASH there
if (plpsRFTText->lpszData && plpsRFTText->dwSize) { // decode RTF
- size_t dwRTFPartsCount, dwCompressedSize, dwRFTBuffSize = ((plpsRFTText->dwSize*16)+8192), dwRTFDataSize;
- LPBYTE lpbRTFData, lpbCompressed, lpbDataCurrent;
+ size_t dwRTFPartsCount, dwRFTBuffSize = ((plpsRFTText->dwSize*16)+8192), dwRTFDataSize;
+ LPBYTE lpbDataCurrent;
MRA_LPS lpsRTFString, lpsBackColour, lpsString;
- lpbRTFData = (LPBYTE)mir_calloc(dwRFTBuffSize);
- lpbCompressed = (LPBYTE)mir_calloc((plpsRFTText->dwSize+32));
- if (lpbRTFData && lpbCompressed) {
- BASE64DecodeFormated(plpsRFTText->lpszData, plpsRFTText->dwSize, lpbCompressed, (plpsRFTText->dwSize+32), &dwCompressedSize);
+ mir_ptr<BYTE> lpbRTFData((LPBYTE)mir_calloc(dwRFTBuffSize));
+ if (lpbRTFData) {
+ LPS2ANSI(szRtf, plpsRFTText->lpszData, plpsRFTText->dwSize);
+ unsigned dwCompressedSize;
+ mir_ptr<BYTE> lpbCompressed((LPBYTE)mir_base64_decode(szRtf, &dwCompressedSize));
dwRTFDataSize = dwRFTBuffSize;
if ( uncompress(lpbRTFData, (DWORD*)&dwRTFDataSize, lpbCompressed, dwCompressedSize) == Z_OK) {
lpbDataCurrent = lpbRTFData;
@@ -1867,8 +1868,6 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *pl DebugBreak();
}
}
- mir_free(lpbCompressed);
- mir_free(lpbRTFData);
}
}
}
|