diff options
author | Matt Johnston <matt@ucc.asn.au> | 2006-03-25 12:57:44 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2006-03-25 12:57:44 +0000 |
commit | 52617a6786daf9ea769bc18626be1a0c2edf2ac1 (patch) | |
tree | d8d5f8da1637f9a2e1919d8b7d6614fb6f89893d | |
parent | 85e85c6acfc9eefc119c3d5fc1a47915183a5cc6 (diff) | |
parent | e42df7344817c1ac3209c6eacaacae1916bcef24 (diff) | |
download | dropbear-52617a6786daf9ea769bc18626be1a0c2edf2ac1.tar.gz |
merge of 6ace12c71fc2773210f2f3d374c96622ca54fe48
and 84eb6fedc6df0666f8053b9018bf16635dbfb257
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | random.c | 4 | ||||
-rw-r--r-- | scpmisc.h | 21 | ||||
-rw-r--r-- | svr-main.c | 1 |
4 files changed, 28 insertions, 2 deletions
@@ -1,3 +1,7 @@ +0.48.1 - Sat 11 March 2006 + +- Compile fix for scp + 0.48 - Thurs 9 March 2006 - Check that the circular buffer is properly empty before @@ -31,7 +31,8 @@ static int donerandinit = 0; /* this is used to generate unique output from the same hashpool */ static uint32_t counter = 0; -#define MAX_COUNTER 1<<31 /* the max value for the counter, so it won't loop */ +/* the max value for the counter, so it won't integer overflow */ +#define MAX_COUNTER 1<<30 static unsigned char hashpool[SHA1_HASH_SIZE]; @@ -167,7 +168,6 @@ void reseedrandom() { gettimeofday(&tv, NULL); hash_state hs; - unsigned char hash[SHA1_HASH_SIZE]; sha1_init(&hs); sha1_process(&hs, (void*)hashpool, sizeof(hashpool)); sha1_process(&hs, (void*)&pid, sizeof(pid)); @@ -46,3 +46,24 @@ char *xstrdup(const char *); char *ssh_get_progname(char *); void fatal(char* fmt,...); void sanitise_stdfd(void); + +/* Required for non-BSD platforms, from OpenSSH's defines.h */ +#ifndef timersub +#define timersub(a, b, result) \ + do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((result)->tv_usec < 0) { \ + --(result)->tv_sec; \ + (result)->tv_usec += 1000000; \ + } \ + } while (0) +#endif + +#ifndef TIMEVAL_TO_TIMESPEC +#define TIMEVAL_TO_TIMESPEC(tv, ts) { \ + (ts)->tv_sec = (tv)->tv_sec; \ + (ts)->tv_nsec = (tv)->tv_usec * 1000; \ +} +#endif + @@ -28,6 +28,7 @@ #include "buffer.h" #include "signkey.h" #include "runopts.h" +#include "random.h" static size_t listensockets(int *sock, size_t sockcount, int *maxfd); static void sigchld_handler(int dummy); |