1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Random changes

This commit is contained in:
Werner Koch 2001-08-25 09:35:43 +00:00
parent 93654f5289
commit 64d586ef17
10 changed files with 76 additions and 21 deletions

View file

@ -1,3 +1,11 @@
2001-08-24 Werner Koch <wk@gnupg.org>
* md.c (md_write): Made buf arg const.
2001-08-22 Werner Koch <wk@gnupg.org>
* random.c (fast_random_poll): Don't use gethrtime if it is broken.
2001-08-20 Werner Koch <wk@gnupg.org>
Applied patches from Stefan Bellon <sbellon@sbellon.de> to support

View file

@ -317,7 +317,7 @@ md_close(MD_HANDLE a)
void
md_write( MD_HANDLE a, byte *inbuf, size_t inlen)
md_write( MD_HANDLE a, const byte *inbuf, size_t inlen)
{
struct md_digest_list_s *r;
@ -329,7 +329,8 @@ md_write( MD_HANDLE a, byte *inbuf, size_t inlen)
}
for(r=a->list; r; r = r->next ) {
(*r->write)( &r->context.c, a->buffer, a->bufcount );
(*r->write)( &r->context.c, inbuf, inlen );
/* Fixme: all ->write fnc should take a const byte* */
(*r->write)( &r->context.c, (byte*)inbuf, inlen );
}
a->bufcount = 0;
}

View file

@ -568,8 +568,10 @@ fast_random_poll()
}
/* fall back to the generic function */
#ifdef HAVE_GETHRTIME
#if defined(HAVE_GETHRTIME) && !defined(HAVE_BROKEN_GETHRTIME)
{ hrtime_t tv;
/* On some Solaris and HPUX system gethrtime raises an SIGILL, but we
* checked this with configure */
tv = gethrtime();
add_randomness( &tv, sizeof(tv), 1 );
}