summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--cipher/ChangeLog6
-rw-r--r--cipher/Makefile.am14
-rw-r--r--cipher/md.c2
-rw-r--r--cipher/random.c4
-rw-r--r--cipher/rndunix.c4
-rw-r--r--configure.in42
-rw-r--r--mpi/ChangeLog4
-rw-r--r--mpi/mpi-bit.c2
-rw-r--r--mpi/mpi-cmp.c3
10 files changed, 73 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index f7a5f88a..45630acc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Jan 9 16:02:23 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
+
+ * configure.in: Add a way to statically link rndunix
+
Sun Jan 3 15:28:44 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* acinclude.m4 (GNUPG_CHECK_RDYNAMIC): New.
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index 347d3469..ad7d6f83 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jan 9 16:02:23 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
+
+ * rndunix.c (gather_random): check for setuid.
+
+ * Makefile.am: Add a way to staically link random modules
+
Thu Jan 7 18:00:58 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* md.c (md_stop_debug): Do a flush first.
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
index a27989cb..4a717107 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -1,18 +1,18 @@
## Process this file with automake to produce Makefile.in
-gnupg_extensions = tiger twofish rndunix
-
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
noinst_LIBRARIES = libcipher.a
+
+EXTRA_PROGRAMS = tiger twofish rndunix rndlinux
if ENABLE_GNUPG_EXTENSIONS
-pkglib_PROGRAMS = $(gnupg_extensions)
+pkglib_PROGRAMS = @DYNAMIC_CIPHER_MODS@ @DYNAMIC_RANDOM_MODS@
else
pkglib_PROGRAMS =
endif
-DYNLINK_MOD_CFLAGS = -DIS_MODULE @DYNLINK_MOD_CFLAGS@
+DYNLINK_MOD_CFLAGS = -DIS_MODULE @DYNLINK_MOD_CFLAGS@
libcipher_a_SOURCES = cipher.c \
pubkey.c \
@@ -33,7 +33,6 @@ libcipher_a_SOURCES = cipher.c \
random.h \
random.c \
rand-internal.h \
- rndlinux.c \
rmd.h \
rmd160.c \
sha1.h \
@@ -43,9 +42,14 @@ libcipher_a_SOURCES = cipher.c \
g10c.c \
smallprime.c
+
+EXTRA_libcipher_a_SOURCES = rndlinux.c rndunix.c
EXTRA_tiger_SOURCES = tiger.c
EXTRA_twofish_SOURCES = twofish.c
+libcipher_a_DEPENDENCIES = @STATIC_RANDOM_OBJS@ @STATIC_CIPHER_OBJS@
+libcipher_a_LIBADD = @STATIC_RANDOM_OBJS@ @STATIC_CIPHER_OBJS@
+
tiger: $(srcdir)/tiger.c
`echo $(COMPILE) $(DYNLINK_MOD_CFLAGS) -o tiger $(srcdir)/tiger.c | \
diff --git a/cipher/md.c b/cipher/md.c
index f7be5e4c..6e335db8 100644
--- a/cipher/md.c
+++ b/cipher/md.c
@@ -1,5 +1,5 @@
/* md.c - message digest dispatcher
- * Copyright (C) 1998 Free Software Foundation, Inc.
+ * Copyright (C) 1998,1999 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
diff --git a/cipher/random.c b/cipher/random.c
index 6f8a20aa..1812467a 100644
--- a/cipher/random.c
+++ b/cipher/random.c
@@ -122,13 +122,9 @@ initialize()
#elif USE_RNDUNIX
rndunix_constructor();
#elif USE_RNDW32
- rndw32_constructor();
#elif USE_RNDOS2
- rndos2_constructor();
#elif USE_RNDATARI
- rndatari_constructor();
#elif USE_RNDMVS
- rndmvs_constructor();
#endif
}
diff --git a/cipher/rndunix.c b/cipher/rndunix.c
index c005afba..9e49ebc7 100644
--- a/cipher/rndunix.c
+++ b/cipher/rndunix.c
@@ -2,6 +2,7 @@
* *
* BeOS Randomness-Gathering Code *
* Copyright Peter Gutmann, Paul Kendall, and Chris Wedgwood 1996-1998 *
+ * Copyright (C) 1998, 1999 Werner Koch
* *
****************************************************************************/
@@ -678,6 +679,9 @@ gather_random( void (*add)(const void*, size_t, int), int requester,
size_t n;
if( !gatherer_pid ) {
+ /* make sure we are not setuid */
+ if( getuid() != geteuid() )
+ BUG();
/* time to start the gatherer process */
if( pipe( pipedes ) ) {
g10_log_error("pipe() failed: %s\n", strerror(errno));
diff --git a/configure.in b/configure.in
index f7104866..6fcc58af 100644
--- a/configure.in
+++ b/configure.in
@@ -259,6 +259,48 @@ else
fi
+dnl
+dnl Figure how to link the random modules
+dnl
+if test "$ac_cv_have_dev_random" = yes; then
+ AC_DEFINE(USE_RNDLINUX)
+ STATIC_RANDOM_OBJS="rndlinux.o"
+ DYNAMIC_RANDOM_MODS=""
+else
+ case "${target}" in
+ i386--mingw32)
+ AC_DEFINE(USE_RNDW32)
+ STATIC_RANDOM_OBJS=""
+ DYNAMIC_RANDOM_MODS=""
+ ;;
+ m68k-atari-mint)
+ AC_DEFINE(USE_RNDATARI)
+ STATIC_RANDOM_OBJS=""
+ DYNAMIC_RANDOM_MODS=""
+ ;;
+ *)
+ AC_DEFINE(USE_RNDUNIX)
+ STATIC_RANDOM_OBJS="rndunix.o"
+ DYNAMIC_RANDOM_MODS=""
+ ;;
+ esac
+fi
+
+AC_SUBST(STATIC_RANDOM_OBJS)
+AC_SUBST(DYNAMIC_RANDOM_MODS)
+
+
+dnl
+dnl Figure how to link the cipher modules
+dnl
+dnl (form now these are only dynamic)
+STATIC_CIPHER_OBJS=""
+DYNAMIC_CIPHER_MODS="twofish tiger"
+AC_SUBST(STATIC_CIPHER_OBJS)
+AC_SUBST(DYNAMIC_CIPHER_MODS)
+
+
+
dnl setup assembler stuff
AC_MSG_CHECKING(for mpi assembler functions)
if test -f $srcdir/mpi/config.links ; then
diff --git a/mpi/ChangeLog b/mpi/ChangeLog
index 9d79660e..2a49d403 100644
--- a/mpi/ChangeLog
+++ b/mpi/ChangeLog
@@ -1,3 +1,7 @@
+Sat Jan 9 16:02:23 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
+
+ * mpi-cmp.c (mpi_cmp_ui): Normalized the arg.
+
Thu Jan 7 18:00:58 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* mpi-bit.c (mpi_normalize): New.
diff --git a/mpi/mpi-bit.c b/mpi/mpi-bit.c
index 227a929b..00aa5d08 100644
--- a/mpi/mpi-bit.c
+++ b/mpi/mpi-bit.c
@@ -1,5 +1,5 @@
/* mpi-bit.c - MPI bit level fucntions
- * Copyright (C) 1998 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
diff --git a/mpi/mpi-cmp.c b/mpi/mpi-cmp.c
index 3c3c76b7..2a6cdbf1 100644
--- a/mpi/mpi-cmp.c
+++ b/mpi/mpi-cmp.c
@@ -1,5 +1,5 @@
/* mpi-cmp.c - MPI functions
- * Copyright (C) 1998 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -28,6 +28,7 @@ mpi_cmp_ui( MPI u, unsigned long v )
{
mpi_limb_t limb = v;
+ mpi_normalize( u );
if( !u->nlimbs && !limb )
return 0;
if( u->sign )