X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d1d9452a687184ac6b992fadc77e89c8a308e388..8e6fbfbd7ab27edfb62b3e30c651f67557869430:/stglibs/ia.lib/ia.cpp?ds=sidebyside diff --git a/stglibs/ia.lib/ia.cpp b/stglibs/ia.lib/ia.cpp index 1e4760fc..a05d3061 100644 --- a/stglibs/ia.lib/ia.cpp +++ b/stglibs/ia.lib/ia.cpp @@ -351,18 +351,11 @@ if (!isNetPrepared) } int db = sizeof(HDR_8); -for (int i = 0; i < IA_LOGIN_LEN/8; i++) - { - EncodeString(buffer + db + i * 8, buffer + db + i * 8, &ctxHdr); - } +EncryptString(buffer + db, buffer + db, IA_LOGIN_LEN, &ctxHdr); db += IA_LOGIN_LEN; -int encLen = (len - sizeof(HDR_8) - IA_LOGIN_LEN)/8; -for (int i = 0; i < encLen; i++) - { - EncodeString(buffer + db, buffer + db, &ctxPass); - db += 8; - } +int encLen = (len - sizeof(HDR_8) - IA_LOGIN_LEN); +EncryptString(buffer + db, buffer + db, encLen, &ctxPass); return sendto(sockr, buffer, len, 0, (struct sockaddr*)&servAddr, sizeof(servAddr)); } @@ -383,10 +376,7 @@ if (res == -1) return res; if (strcmp(buffer + 4 + sizeof(HDR_8), "ERR")) - { - for (int i = 0; i < len / 8; i++) - DecodeString(buffer + i * 8, buffer + i * 8, &ctxPass); - } + DecryptString(buffer, buffer, len, &ctxPass); return 0; }