1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-09-21 15:01:41 +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,15 @@
2001-08-23 Werner Koch <wk@gnupg.org>
* configure.in (AC_FUNC_FSEEKO): Add.
(AC_CHECK_FUNCS): Remove fseeko. By Paul Eggert <eggert@twinsun.com>.
2001-08-22 Werner Koch <wk@gnupg.org>
* configure.ac (gethrtime): Enhanced the test by running a test
program.
* INSTALL: Removed the note about Solaris problems because the
above test should catch this.
2001-08-20 Werner Koch <wk@gnupg.org>
* acinclude.m4: Add check for plock if mlock is broken.

View File

@ -102,13 +102,6 @@ Specific problems on some machines
not build. In this case try to run configure using:
CFLAGS="-g -O2 -mcpu=powerpc" ./configure
* Solaris
There are reports that the function gethrtime() as used in
cipher/random.c raised a SIGILL. It seems that is due to
a header/lib miscmatch. Solution is to fix the Solaris
installation or comment the call to gethrtime().
The Random Device

5
TODO
View File

@ -78,6 +78,11 @@
* Check that the way we select cipher and digest algorithms w/o
preferences is okay and make AES the default.
* Concatenated encryption messages don't work corectly - only the
first one is processes.
* Add status message for reasons why a key was not selected.
Scheduled for 1.1
-----------------
* export by user-IDs does only export the first matching name which leads

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 );
}

View File

@ -485,20 +485,49 @@ if test "$ac_cv_sizeof_unsigned_short" = "0" \
AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
fi
dnl Checks for library functions.
AC_FUNC_FSEEKO
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strerror stpcpy strlwr stricmp tcgetattr rand strtoul mmap)
AC_CHECK_FUNCS(memmove gettimeofday getrusage setrlimit clock_gettime)
AC_CHECK_FUNCS(memicmp atexit raise getpagesize strftime nl_langinfo)
AC_CHECK_FUNCS(waitpid wait4 sigaction sigprocmask fseeko)
AC_CHECK_FUNCS(waitpid wait4 sigaction sigprocmask)
AC_MSG_CHECKING(for gethrtime)
AC_TRY_LINK([#include <sys/times.h>],[
hrtime_t tv;
tv = gethrtime();
],[AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GETHRTIME)], AC_MSG_RESULT(no))
#
# check for gethrtime and run a testprogram to see whether
# it is brogen. It has been reported that some Solris and HP UX systems
# raise an SIGILL
#
AC_CACHE_CHECK([for gethrtime],
[gnupg_cv_func_gethrtime],
[AC_TRY_LINK([#include <sys/times.h>],[
hrtime_t tv;
tv = gethrtime();
],
[gnupg_cv_func_gethrtime=yes],
[gnupg_cv_func_gethrtime=no])
])
if test $gnupg_cv_func_gethrtime = yes; then
AC_DEFINE([HAVE_GETHRTIME], 1,
[Define if you have the `gethrtime(2)' function.])
AC_CACHE_CHECK([whether gethrtime is broken],
[gnupg_cv_func_broken_gethrtime],
[AC_TRY_RUN([
#include <sys/times.h>
int main () {
hrtime_t tv;
tv = gethrtime();
}
],
[gnupg_cv_func_broken_gethrtime=no],
[gnupg_cv_func_broken_gethrtime=yes],
[gnupg_cv_func_broken_gethrtime=assume-no])
])
if test $gnupg_cv_func_broken_gethrtime = yes; then
AC_DEFINE([HAVE_BROKEN_GETHRTIME], 1,
[Define if `gethrtime(2)' does not work correctly i.e. issues a SIGILL.])
fi
fi
GNUPG_CHECK_MLOCK
@ -880,4 +909,5 @@ fi
if test -n "$show_extraasm"; then
echo " Extra cpu specific functions:$show_extraasm"
fi
echo

View File

@ -1,3 +1,7 @@
2001-08-24 Werner Koch <wk@gnupg.org>
* cipher.h (md_write): Made buf arg const.
2001-08-20 Werner Koch <wk@gnupg.org>
* cipher.h (DEK): Added algo_info_printed;

View File

@ -116,7 +116,7 @@ void md_enable( MD_HANDLE hd, int algo );
MD_HANDLE md_copy( MD_HANDLE a );
void md_reset( MD_HANDLE a );
void md_close(MD_HANDLE a);
void md_write( MD_HANDLE a, byte *inbuf, size_t inlen);
void md_write( MD_HANDLE a, const byte *inbuf, size_t inlen);
void md_final(MD_HANDLE a);
byte *md_read( MD_HANDLE a, int algo );
int md_digest( MD_HANDLE a, int algo, byte *buffer, int buflen );