X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/72229403aae25f742c07d07d625bdc1e313b401d..4b6cb30ae7c85d6ca9d2defb4e6d8f5cae309eeb:/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; }