mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-22 16:19: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];
|
||||
md5_state_t ctx;
|
||||
int i;
|
||||
int k;
|
||||
int *ix;
|
||||
|
||||
if (len < 16) {
|
||||
|
@ -32,7 +33,9 @@ void login_calculate(char *out, int len, char *pass, int seed) {
|
|||
memcpy(temp, pass, 32);
|
||||
ix = (int*) temp;
|
||||
for (i = 0; i < 8; i++) {
|
||||
*ix++ ^= seed;
|
||||
k = ntohl(*ix);
|
||||
k ^= seed;
|
||||
*ix++ = htonl(k);
|
||||
}
|
||||
md5_init(&ctx);
|
||||
md5_append(&ctx, temp, 32);
|
||||
|
|
Loading…
Reference in New Issue