mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-23 00:29:20 +02:00
Fix login_calculate on wrong endian
This commit is contained in:
parent
2a860e3528
commit
eed9e7063d
|
@ -23,6 +23,7 @@ void login_calculate(char *out, int len, char *pass, int seed) {
|
||||||
char temp[32];
|
char temp[32];
|
||||||
md5_state_t ctx;
|
md5_state_t ctx;
|
||||||
int i;
|
int i;
|
||||||
|
int k;
|
||||||
int *ix;
|
int *ix;
|
||||||
|
|
||||||
if (len < 16) {
|
if (len < 16) {
|
||||||
|
@ -32,7 +33,9 @@ void login_calculate(char *out, int len, char *pass, int seed) {
|
||||||
memcpy(temp, pass, 32);
|
memcpy(temp, pass, 32);
|
||||||
ix = (int*) temp;
|
ix = (int*) temp;
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
*ix++ ^= seed;
|
k = ntohl(*ix);
|
||||||
|
k ^= seed;
|
||||||
|
*ix++ = htonl(k);
|
||||||
}
|
}
|
||||||
md5_init(&ctx);
|
md5_init(&ctx);
|
||||||
md5_append(&ctx, temp, 32);
|
md5_append(&ctx, temp, 32);
|
||||||
|
|
Loading…
Reference in New Issue