# HG changeset patch # User Matt Johnston # Date 1155141905 0 # Node ID c61bd8f9e32dfdde1468d5ab73c5981d6c6d9757 # Parent 0e38c039a9c890619d5e02106bc7af6529b656f2 make sure that random number generator is correct endian diff -r 0e38c039a9c8 -r c61bd8f9e32d options.h --- a/options.h Wed Aug 09 16:37:18 2006 +0000 +++ b/options.h Wed Aug 09 16:45:05 2006 +0000 @@ -127,8 +127,8 @@ * but there's an interface via a PAM module - don't bother using it otherwise. * You can't enable both PASSWORD and PAM. */ -#define ENABLE_SVR_PASSWORD_AUTH -/*#define ENABLE_SVR_PAM_AUTH */ +/*#define ENABLE_SVR_PASSWORD_AUTH*/ +#define ENABLE_SVR_PAM_AUTH #define ENABLE_SVR_PUBKEY_AUTH #define ENABLE_CLI_PASSWORD_AUTH diff -r 0e38c039a9c8 -r c61bd8f9e32d random.c --- a/random.c Wed Aug 09 16:37:18 2006 +0000 +++ b/random.c Wed Aug 09 16:45:05 2006 +0000 @@ -73,6 +73,7 @@ unsigned int copylen; const unsigned int total_len = len; unsigned char* start_buf = buf; + unsigned char counter_buf[4]; if (!donerandinit) { dropbear_exit("seedrandom not done"); @@ -81,7 +82,8 @@ while (len > 0) { sha1_init(&hs); sha1_process(&hs, (void*)hashpool, sizeof(hashpool)); - sha1_process(&hs, (void*)&counter, sizeof(counter)); + STORE32H(counter, counter_buf); + sha1_process(&hs, (void*)counter_buf, sizeof(counter)); sha1_done(&hs, hash); counter++;