Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed execKey generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ferzkopp committed Aug 6, 2011
1 parent 03b3608 commit 3d75df9
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions test/test-automation/src/libSDLtest/fuzzer/fuzzer.c
Expand Up @@ -79,25 +79,13 @@ GenerateExecKey(char *runSeed, char *suiteName,

MD5_CTX md5Context;
utl_md5Init(&md5Context);

utl_md5Update(&md5Context, buffer, entireString);
utl_md5Final(&md5Context);

SDL_free(buffer);

const char *execKey = md5Context.digest;

//printf("Debug: digest = %s\n", execKey);

// Casting fixes compiler warnings
Uint64 key = ((Uint64) execKey[8]) << 56 |
((Uint64) execKey[9]) << 48 |
((Uint64) execKey[10]) << 40 |
((Uint64) execKey[11]) << 32 |
((Uint64) execKey[12]) << 24 |
((Uint64) execKey[13]) << 16 |
((Uint64) execKey[14]) << 8 |
((Uint64) execKey[15]) << 0;
Uint64 *keys = (Uint64 *)md5Context.digest;
Uint64 key = keys[0];

return key;
}
Expand All @@ -107,10 +95,6 @@ InitFuzzer(Uint64 execKey)
{
Uint32 a = (execKey >> 32) & 0x00000000FFFFFFFF;
Uint32 b = execKey & 0x00000000FFFFFFFF;

//printf("Debug: execKey: %llx\n", execKey);
//printf("Debug: a = %x - b = %x\n", a, b);

utl_randomInit(&rndContext, a, b);
}

Expand Down

0 comments on commit 3d75df9

Please sign in to comment.