diff options
Diffstat (limited to 'cipher')
-rw-r--r-- | cipher/ChangeLog | 14 | ||||
-rw-r--r-- | cipher/random.c | 12 | ||||
-rw-r--r-- | cipher/rndunix.c | 8 | ||||
-rw-r--r-- | cipher/sha1.c | 4 |
4 files changed, 31 insertions, 7 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index e0e8f917c..4cd2a0490 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,17 @@ +Thu Mar 2 15:37:46 CET 2000 Werner Koch <[email protected]> + + * random.c (fast_random_poll): Add clock_gettime() as fallback for + system which support this POSIX.4 fucntion. By Sam Roberts. + + * rndunix.c: Add some more headers for QNX. By Sam Roberts. + + * random.c (read_seed_file): Removed the S_ISLNK test becuase it + is already covered by !S_ISREG and is not defined in Unixware. + Reported by Dave Dykstra. + + * sha1.c (sha1_get_info): Removed those stupid double lines. Dave + is really a good lint. + Wed Feb 23 10:07:57 CET 2000 Werner Koch <[email protected]> * twofish.c (twofish_get_info): Add some const to the casts. By Martin diff --git a/cipher/random.c b/cipher/random.c index 852936dba..f047f6829 100644 --- a/cipher/random.c +++ b/cipher/random.c @@ -43,6 +43,9 @@ #ifdef HAVE_GETTIMEOFDAY #include <sys/times.h> #endif +#ifdef HAVE_CLOCK_GETTIME + #include <time.h> +#endif #ifdef HAVE_GETRUSAGE #include <sys/resource.h> #endif @@ -306,7 +309,7 @@ read_seed_file() close(fd); return 0; } - if( !S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode) ) { + if( !S_ISREG(sb.st_mode) ) { log_info(_("`%s' is not a regular file - ignored\n"), seed_file_name ); close(fd); return 0; @@ -557,6 +560,13 @@ fast_random_poll() add_randomness( &tv.tv_sec, sizeof(tv.tv_sec), 1 ); add_randomness( &tv.tv_usec, sizeof(tv.tv_usec), 1 ); } + #elif HAVE_CLOCK_GETTIME + { struct timespec tv; + if( clock_gettime( CLOCK_REALTIME, &tv ) == -1 ) + BUG(); + add_randomness( &tv.tv_sec, sizeof(tv.tv_sec), 1 ); + add_randomness( &tv.tv_nsec, sizeof(tv.tv_nsec), 1 ); + } #else /* use times */ #ifndef HAVE_DOSISH_SYSTEM { struct tms buf; diff --git a/cipher/rndunix.c b/cipher/rndunix.c index 9f60b3cf8..59a924e00 100644 --- a/cipher/rndunix.c +++ b/cipher/rndunix.c @@ -75,9 +75,9 @@ #ifndef __QNX__ #include <sys/resource.h> #endif /* __QNX__ */ -#ifdef _AIX +#if defined( _AIX ) || defined( __QNX__ ) #include <sys/select.h> -#endif /* _AIX */ +#endif /* _AIX || __QNX__ */ #ifndef __QNX__ #include <sys/shm.h> #include <sys/signal.h> @@ -89,6 +89,10 @@ #endif /* __hpux 9.x, after that it's in unistd.h */ #include <sys/wait.h> /* #include <kitchensink.h> */ +#ifdef __QNX__ +#include <signal.h> +#include <process.h> +#endif /* __QNX__ */ #include <errno.h> #include "types.h" /* for byte and u32 typedefs */ diff --git a/cipher/sha1.c b/cipher/sha1.c index e47cc5e60..2c2a10a7b 100644 --- a/cipher/sha1.c +++ b/cipher/sha1.c @@ -337,10 +337,6 @@ sha1_get_info( int algo, size_t *contextsize, *r_asnoid = asn; *r_asnlen = DIM(asn); *r_mdlen = 20; - *r_init = (void (*)(void *))sha1_init; - *r_write = (void (*)(void *, byte*, size_t))sha1_write; - *r_final = (void (*)(void *))sha1_final; - *r_read = (byte *(*)(void *))sha1_read; *(void (**)(SHA1_CONTEXT *))r_init = sha1_init; *(void (**)(SHA1_CONTEXT *, byte*, size_t))r_write = sha1_write; *(void (**)(SHA1_CONTEXT *))r_final = sha1_final; |