summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-09-14 15:49:50 +0000
committerWerner Koch <wk@gnupg.org>1998-09-14 15:49:50 +0000
commit91e0657206cc084d6877d6da26e3475f8f82c612 (patch)
treef2928a468eaf4919e716cdd6896a1b2a2171c634
parent4301e92fe95887a7ecab8206eb1ed7eea77a766c (diff)
downloadlibgcrypt-91e0657206cc084d6877d6da26e3475f8f82c612.tar.gz
New release
-rw-r--r--AUTHORS18
-rw-r--r--INSTALL8
-rw-r--r--Makefile.am7
-rw-r--r--THANKS4
-rw-r--r--acinclude.m438
-rw-r--r--cipher/ChangeLog8
-rw-r--r--cipher/Makefile.am2
-rw-r--r--cipher/blowfish.c21
-rw-r--r--cipher/blowfish.h2
-rw-r--r--cipher/cast5.c9
-rw-r--r--cipher/cast5.h2
-rw-r--r--cipher/cipher.c12
-rw-r--r--cipher/dynload.c9
-rw-r--r--cipher/dynload.h2
-rw-r--r--cipher/twofish.c8
-rw-r--r--configure.in9
16 files changed, 98 insertions, 61 deletions
diff --git a/AUTHORS b/AUTHORS
index 35e7049a..56668891 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -3,19 +3,23 @@ Authors of GNU Privacy Guard (gnupg).
Werner Koch. Designed and implemented gnupg.
-TRANSLATIONS Marco d'Itri 1997-02-22
-Disclaim
-
-GPG Matthew Skala 1998-08-10
+GPG Matthew Skala 1998-08-10
Disclaims changes (Twofish code).
mskala@ansuz.sooke.bc.ca
-GPG Natural Resources Canada 1998-08-11
+GPG Natural Resources Canada 1998-08-11
Disclaims changes by Matthew Skala.
-TRANSLATIONS Gaël Quéri ?????????????
+GPG Niklas Hernaeus ??????????
+(Weak key patches)
+
+
+TRANSLATIONS Marco d'Itri 1997-02-22
+Disclaim
+
+TRANSLATIONS Gaël Quéri ??????????
fr.po
-TRANSLATIONS Walter Koch ???????????
+TRANSLATIONS Walter Koch ??????????
de.po
diff --git a/INSTALL b/INSTALL
index 23fa6b98..7829ec5a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -33,8 +33,12 @@ Configure options for GNUPG
Problems
========
-If you have compile problems, try the configure options "--with-included-zlib",
-"--disable-nls" (See ABOUT-NLS) or --disable-dynload.
+If you get unresolved externals "gettext" you should run configure again
+with the option "--with-included-gettext".
+
+If you have other compile problems, try the configure options
+"--with-included-zlib" or "--disable-nls" (See ABOUT-NLS)
+or --disable-dynload.
I can't check all assembler files, so if you have problems assembling them
(or the program crashes), simply delete the files in the mpi/<cpu> directory.
diff --git a/Makefile.am b/Makefile.am
index b8f6282b..258ec700 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,10 +4,6 @@ SUBDIRS = intl po zlib util mpi cipher tools g10 doc checks
EXTRA_DIST = VERSION
-tar: clean
- cd ..; tar czvf ~/bkup/g10-`date +%d%m`.tar.gz src
-
-
dist-hook:
@set -e; \
for file in `find $(srcdir) -type f -name distfiles`; do \
@@ -17,8 +13,5 @@ dist-hook:
|| cp -p $(srcdir)/$$dir/$$i $(distdir)/$$dir/$$i; \
done ; \
done
- for file in po/cat-id-tbl.c po/gnupg.pot; do \
- rm $(distdir)/$$file || true ; \
- done
diff --git a/THANKS b/THANKS
index 054c6a3a..c19d23a9 100644
--- a/THANKS
+++ b/THANKS
@@ -9,6 +9,7 @@ Brian Warner warner@lothar.com
Caskey L. Dickson caskey@technocage.com
Charles Levert charles@comm.polymtl.ca
Christian von Roques roques@pond.sub.org
+Christopher Oliver oliver@fritz.traverse.net
Daniel Eisenbud eisenbud@cs.swarthmore.edu
Detlef Lannert lannert@lannert.rz.uni-duesseldorf.de
Ed Boraas ecxjo@esperanto.org
@@ -27,9 +28,12 @@ Martin Schulte schulte@thp.uni-koeln.de
Matthew Skala mskala@ansuz.sooke.bc.ca
Max Valianskiy maxcom@maxcom.ml.org
Nicolas Graner Nicolas.Graner@cri.u-psud.fr
+Niklas Hernaeus nh@sleipner.df.lth.se
Nimrod Zimerman zimerman@forfree.at
Oskari Jääskeläinen f33003a@cc.hut.fi
+Paul D. Smith psmith@baynetworks.com
Peter Gutmann pgut001@cs.auckland.ac.nz
+QingLong qinglong@bolizm.ihep.su
Ralph Gillen gillen@theochem.uni-duesseldorf.de
Serge Munhoven munhoven@mema.ucl.ac.be
Steffen Ullrich ccrlphr@xensei.com
diff --git a/acinclude.m4 b/acinclude.m4
index 5f7c5621..6fe4337f 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -155,12 +155,12 @@ define(WK_CHECK_IPC,
######################################################################
-# progtest.m4 from gettext 0.32
+# progtest.m4 from gettext 0.35
######################################################################
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
#
-# This file file be copied and used freely without restrictions. It can
+# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
@@ -205,14 +205,13 @@ fi
AC_SUBST($1)dnl
])
-
######################################################################
-# lcmessage.m4 from gettext 0.32
+# lcmessage.m4 from gettext 0.35
######################################################################
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
-# This file file be copied and used freely without restrictions. It can
+# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
@@ -229,20 +228,18 @@ AC_DEFUN(AM_LC_MESSAGES,
fi
fi])
-
-
######################################################################
-# gettext.m4 from gettext 0.32
+# gettext.m4 from gettext 0.35
######################################################################
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
-# This file file be copied and used freely without restrictions. It can
+# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
-# serial 3
+# serial 5
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
@@ -284,9 +281,10 @@ AC_DEFUN(AM_WITH_NLS,
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
- [AC_TRY_LINK([], [return (int) gettext ("")],
- gt_cv_func_gettext_libintl=yes,
- gt_cv_func_gettext_libintl=no)])])
+ [AC_CHECK_LIB(intl, gettext,
+ gt_cv_func_gettext_libintl=yes,
+ gt_cv_func_gettext_libintl=no)],
+ gt_cv_func_gettext_libintl=no)])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
@@ -380,7 +378,7 @@ AC_DEFUN(AM_WITH_NLS,
: ;
else
AC_MSG_RESULT(
- [found xgettext programs is not GNU xgettext; ignore it])
+ [found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
@@ -392,6 +390,12 @@ AC_DEFUN(AM_WITH_NLS,
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
+ AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+ AC_OUTPUT_COMMANDS(
+ [case "$CONFIG_FILES" in *po/Makefile.in*)
+ sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+ esac])
+
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
@@ -436,9 +440,9 @@ AC_DEFUN(AM_GNU_GETTEXT,
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
-unistd.h values.h sys/param.h])
+unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
-__argz_count __argz_stringify __argz_next])
+strdup __argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
@@ -543,5 +547,3 @@ __argz_count __argz_stringify __argz_next])
< $srcdir/po/POTFILES.in > po/POTFILES
])
-
-
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index 7b16f121..da0c03ef 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,11 @@
+Mon Sep 14 11:10:55 1998 Werner Koch (wk@(none))
+
+ * blowfish.c (bf_setkey): Niklas Hernaeus patch to detect weak keys.
+
+Mon Sep 14 09:19:25 1998 Werner Koch (wk@(none))
+
+ * dynload.c (RTLD_NOW): Now defined to 1 if it is undefined.
+
Mon Sep 7 17:04:33 1998 Werner Koch (wk@(none))
* Makefile.am: Fixes to allow a different build directory
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
index a9d5a5ca..a96694ce 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -46,7 +46,7 @@ EXTRA_twofish_SOURCES = twofish.c
tiger: $(srcdir)/tiger.c
- $(COMPILE) -shared -fPIC -o tiger $(srcdir)/tiger.c
+ $(COMPILE) -shared -fPIC -O1 -o tiger $(srcdir)/tiger.c
twofish: $(srcdir)/twofish.c
$(COMPILE) -shared -fPIC -o twofish $(srcdir)/twofish.c
diff --git a/cipher/blowfish.c b/cipher/blowfish.c
index 3ed2ed85..f5c29c6a 100644
--- a/cipher/blowfish.c
+++ b/cipher/blowfish.c
@@ -41,7 +41,7 @@
#define CIPHER_ALGO_BLOWFISH 4 /* blowfish 128 bit key */
#define CIPHER_ALGO_BLOWFISH160 42 /* blowfish 160 bit key (not in OpenPGP)*/
-#define FNCCAST_SETKEY(f) (void(*)(void*, byte*, unsigned))(f)
+#define FNCCAST_SETKEY(f) (int(*)(void*, byte*, unsigned))(f)
#define FNCCAST_CRYPT(f) (void(*)(void*, byte*, byte*))(f)
#define BLOWFISH_BLOCKSIZE 8
@@ -55,7 +55,7 @@ typedef struct {
u32 p[BLOWFISH_ROUNDS+2];
} BLOWFISH_context;
-static void bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen );
+static int bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen );
static void encrypt_block( BLOWFISH_context *bc, byte *outbuf, byte *inbuf );
static void decrypt_block( BLOWFISH_context *bc, byte *outbuf, byte *inbuf );
@@ -480,7 +480,7 @@ selftest()
-static void
+static int
bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen )
{
int i, j;
@@ -543,6 +543,19 @@ bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen )
c->s3[i] = datal;
c->s3[i+1] = datar;
}
+
+
+ /* Check for weak key. A weak key is a key in which a value in */
+ /* the P-array (here c) occurs more than once per table. */
+ for(i=0; i < 255; i++ ) {
+ for( j=i+1; j < 256; j++) {
+ if( (c->s0[i] == c->s0[j]) || (c->s1[i] == c->s1[j]) ||
+ (c->s2[i] == c->s2[j]) || (c->s3[i] == c->s3[j]) )
+ return G10ERR_WEAK_KEY;
+ }
+ }
+
+ return 0;
}
@@ -555,7 +568,7 @@ bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen )
const char *
blowfish_get_info( int algo, size_t *keylen,
size_t *blocksize, size_t *contextsize,
- void (**r_setkey)( void *c, byte *key, unsigned keylen ),
+ int (**r_setkey)( void *c, byte *key, unsigned keylen ),
void (**r_encrypt)( void *c, byte *outbuf, byte *inbuf ),
void (**r_decrypt)( void *c, byte *outbuf, byte *inbuf )
)
diff --git a/cipher/blowfish.h b/cipher/blowfish.h
index e328415f..d3848aae 100644
--- a/cipher/blowfish.h
+++ b/cipher/blowfish.h
@@ -26,7 +26,7 @@
const char *
blowfish_get_info( int algo, size_t *keylen,
size_t *blocksize, size_t *contextsize,
- void (**setkey)( void *c, byte *key, unsigned keylen ),
+ int (**setkey)( void *c, byte *key, unsigned keylen ),
void (**encrypt)( void *c, byte *outbuf, byte *inbuf ),
void (**decrypt)( void *c, byte *outbuf, byte *inbuf )
);
diff --git a/cipher/cast5.c b/cipher/cast5.c
index 6b2e5a96..64866ba7 100644
--- a/cipher/cast5.c
+++ b/cipher/cast5.c
@@ -47,7 +47,7 @@
#define CIPHER_ALGO_CAST5 3
-#define FNCCAST_SETKEY(f) (void(*)(void*, byte*, unsigned))(f)
+#define FNCCAST_SETKEY(f) (int(*)(void*, byte*, unsigned))(f)
#define FNCCAST_CRYPT(f) (void(*)(void*, byte*, byte*))(f)
#define CAST5_BLOCKSIZE 8
@@ -57,7 +57,7 @@ typedef struct {
byte Kr[16];
} CAST5_context;
-static void cast_setkey( CAST5_context *c, byte *key, unsigned keylen );
+static int cast_setkey( CAST5_context *c, byte *key, unsigned keylen );
static void encrypt_block( CAST5_context *bc, byte *outbuf, byte *inbuf );
static void decrypt_block( CAST5_context *bc, byte *outbuf, byte *inbuf );
@@ -549,7 +549,7 @@ key_schedule( u32 *x, u32 *z, u32 *k )
}
-static void
+static int
cast_setkey( CAST5_context *c, byte *key, unsigned keylen )
{
static int initialized;
@@ -582,6 +582,7 @@ cast_setkey( CAST5_context *c, byte *key, unsigned keylen )
#undef xi
#undef zi
+ return 0;
}
@@ -594,7 +595,7 @@ cast_setkey( CAST5_context *c, byte *key, unsigned keylen )
const char *
cast5_get_info( int algo, size_t *keylen,
size_t *blocksize, size_t *contextsize,
- void (**r_setkey)( void *c, byte *key, unsigned keylen ),
+ int (**r_setkey)( void *c, byte *key, unsigned keylen ),
void (**r_encrypt)( void *c, byte *outbuf, byte *inbuf ),
void (**r_decrypt)( void *c, byte *outbuf, byte *inbuf )
)
diff --git a/cipher/cast5.h b/cipher/cast5.h
index 070255c6..ea6fa9e4 100644
--- a/cipher/cast5.h
+++ b/cipher/cast5.h
@@ -25,7 +25,7 @@
const char *
cast5_get_info( int algo, size_t *keylen,
size_t *blocksize, size_t *contextsize,
- void (**setkey)( void *c, byte *key, unsigned keylen ),
+ int (**setkey)( void *c, byte *key, unsigned keylen ),
void (**encrypt)( void *c, byte *outbuf, byte *inbuf ),
void (**decrypt)( void *c, byte *outbuf, byte *inbuf )
);
diff --git a/cipher/cipher.c b/cipher/cipher.c
index 049207bf..2326d1dd 100644
--- a/cipher/cipher.c
+++ b/cipher/cipher.c
@@ -43,7 +43,7 @@ struct cipher_table_s {
size_t blocksize;
size_t keylen;
size_t contextsize; /* allocate this amount of context */
- void (*setkey)( void *c, byte *key, unsigned keylen );
+ int (*setkey)( void *c, byte *key, unsigned keylen );
void (*encrypt)( void *c, byte *outbuf, byte *inbuf );
void (*decrypt)( void *c, byte *outbuf, byte *inbuf );
};
@@ -58,15 +58,15 @@ struct cipher_handle_s {
byte iv[MAX_BLOCKSIZE]; /* (this should be ulong aligned) */
byte lastiv[MAX_BLOCKSIZE];
int unused; /* in IV */
- void (*setkey)( void *c, byte *key, unsigned keylen );
+ int (*setkey)( void *c, byte *key, unsigned keylen );
void (*encrypt)( void *c, byte *outbuf, byte *inbuf );
void (*decrypt)( void *c, byte *outbuf, byte *inbuf );
byte context[1];
};
-static void
-dummy_setkey( void *c, byte *key, unsigned keylen ) { }
+static int
+dummy_setkey( void *c, byte *key, unsigned keylen ) { return 0; }
static void
dummy_encrypt_block( void *c, byte *outbuf, byte *inbuf ) { BUG(); }
static void
@@ -346,10 +346,10 @@ cipher_close( CIPHER_HANDLE c )
}
-void
+int
cipher_setkey( CIPHER_HANDLE c, byte *key, unsigned keylen )
{
- (*c->setkey)( &c->context, key, keylen );
+ return (*c->setkey)( &c->context, key, keylen );
}
diff --git a/cipher/dynload.c b/cipher/dynload.c
index a8c01f25..0cbbda2c 100644
--- a/cipher/dynload.c
+++ b/cipher/dynload.c
@@ -30,6 +30,11 @@
#include "cipher.h"
#include "dynload.h"
+
+#ifndef RTLD_NOW
+ #define RTLD_NOW 1
+#endif
+
typedef struct ext_list {
struct ext_list *next;
void *handle; /* handle from dlopen() */
@@ -234,7 +239,7 @@ enum_gnupgext_digests( void **enum_context,
const char *
enum_gnupgext_ciphers( void **enum_context, int *algo,
size_t *keylen, size_t *blocksize, size_t *contextsize,
- void (**setkey)( void *c, byte *key, unsigned keylen ),
+ int (**setkey)( void *c, byte *key, unsigned keylen ),
void (**encrypt)( void *c, byte *outbuf, byte *inbuf ),
void (**decrypt)( void *c, byte *outbuf, byte *inbuf )
)
@@ -242,7 +247,7 @@ enum_gnupgext_ciphers( void **enum_context, int *algo,
EXTLIST r;
ENUMCONTEXT *ctx;
const char * (*finfo)(int, size_t*, size_t*, size_t*,
- void (**)( void *, byte *, unsigned),
+ int (**)( void *, byte *, unsigned),
void (**)( void *, byte *, byte *),
void (**)( void *, byte *, byte *));
diff --git a/cipher/dynload.h b/cipher/dynload.h
index fd87bbee..ad22a824 100644
--- a/cipher/dynload.h
+++ b/cipher/dynload.h
@@ -31,7 +31,7 @@ enum_gnupgext_digests( void **enum_context,
const char *
enum_gnupgext_ciphers( void **enum_context, int *algo,
size_t *keylen, size_t *blocksize, size_t *contextsize,
- void (**setkey)( void *c, byte *key, unsigned keylen ),
+ int (**setkey)( void *c, byte *key, unsigned keylen ),
void (**encrypt)( void *c, byte *outbuf, byte *inbuf ),
void (**decrypt)( void *c, byte *outbuf, byte *inbuf )
);
diff --git a/cipher/twofish.c b/cipher/twofish.c
index b244e952..d93c145e 100644
--- a/cipher/twofish.c
+++ b/cipher/twofish.c
@@ -29,7 +29,7 @@
static void selftest(void);
/* Macros used by the info function. */
-#define FNCCAST_SETKEY(f) ((void(*)(void*, byte*, unsigned))(f))
+#define FNCCAST_SETKEY(f) ((int(*)(void*, byte*, unsigned))(f))
#define FNCCAST_CRYPT(f) ((void(*)(void*, byte*, byte*))(f))
/* Structure for an expanded Twofish key. s contains the key-dependent
@@ -443,7 +443,7 @@ static const byte exp_to_poly[492] = {
/* Perform the key setup. Note that this works *only* with 128-bit keys,
* despite the API that makes it look like it might support other sizes. */
-static void
+static int
twofish_setkey (TWOFISH_context *ctx, const byte *key, const unsigned keylen)
{
/* Temporaries for CALC_K. */
@@ -577,6 +577,8 @@ twofish_setkey (TWOFISH_context *ctx, const byte *key, const unsigned keylen)
CALC_K (k, 26, 0x8B, 0xAE, 0x30, 0x5B);
CALC_K (k, 28, 0x84, 0x8A, 0x54, 0x00);
CALC_K (k, 30, 0xDF, 0xBC, 0x23, 0x9D);
+
+ return 0;
}
/* Macros to compute the g() function in the encryption and decryption
@@ -825,7 +827,7 @@ main()
static const char *
twofish_get_info (int algo, size_t *keylen,
size_t *blocksize, size_t *contextsize,
- void (**r_setkey) (void *c, byte *key, unsigned keylen),
+ int (**r_setkey) (void *c, byte *key, unsigned keylen),
void (**r_encrypt) (void *c, byte *outbuf, byte *inbuf),
void (**r_decrypt) (void *c, byte *outbuf, byte *inbuf)
)
diff --git a/configure.in b/configure.in
index fc6d3db4..0ee39a5d 100644
--- a/configure.in
+++ b/configure.in
@@ -79,7 +79,11 @@ AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
dnl AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_PROG_CC
+AC_PROG_CPP
AC_ISC_POSIX
+AC_PROG_RANLIB
+AC_PROG_INSTALL
case "${target}" in
i386--mingw32)
@@ -93,10 +97,6 @@ case "${target}" in
GNUPG_LIBDIR="c:/lib/gnupg"
;;
*)
-AC_PROG_RANLIB
-AC_PROG_INSTALL
-AC_PROG_CC
-AC_PROG_CPP
AC_DEFINE(USE_RAND_UNIX)
GNUPG_LIBDIR="$g10_prefix/lib/gnupg"
;;
@@ -182,6 +182,7 @@ dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strerror stpcpy strlwr tcgetattr rand strtoul mlock mmap)
AC_CHECK_FUNCS(memmove gettimeofday getrusage gethrtime setrlimit)
+AC_CHECK_FUNCS(atexit raise getpagesize)
WK_CHECK_IPC
if test "$ac_cv_header_sys_shm_h" = "yes"; then