diff options
author | Werner Koch <wk@gnupg.org> | 1999-07-07 11:28:22 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-07-07 11:28:22 +0000 |
commit | f00b093b7fbc5d828f5d0c795d11ca62a975a1bb (patch) | |
tree | ac3527d21507b358b6a5efcf4378043c9e9dbc15 | |
parent | 745415540374611ab1a944a1ee376c814adb9318 (diff) | |
download | libgcrypt-f00b093b7fbc5d828f5d0c795d11ca62a975a1bb.tar.gz |
See ChangeLog: Wed Jul 7 13:23:40 CEST 1999 Werner Koch
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | Makefile.am | 5 | ||||
-rw-r--r-- | cipher/ChangeLog | 5 | ||||
-rw-r--r-- | cipher/Makefile.am | 9 | ||||
-rw-r--r-- | configure.in | 24 | ||||
-rw-r--r-- | mpi/ChangeLog | 7 | ||||
-rw-r--r-- | mpi/Makefile.am | 33 | ||||
-rw-r--r-- | mpi/mpicoder.c | 10 | ||||
-rwxr-xr-x | scripts/autogen.sh | 2 | ||||
-rw-r--r-- | scripts/distfiles | 2 | ||||
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/Makefile.am | 14 | ||||
-rw-r--r-- | src/gcrypt.h | 35 | ||||
-rw-r--r-- | src/mpiapi.c | 19 | ||||
-rw-r--r-- | src/symapi.c | 2 |
15 files changed, 126 insertions, 52 deletions
@@ -1,3 +1,9 @@ +Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> + + + * Makefile.am: Support for libtool. + * configure.in: Ditto. + Tue Jun 29 21:44:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> diff --git a/Makefile.am b/Makefile.am index b07b909f..d825afc6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,9 +23,11 @@ dist-hook: sed -e 's/@pkg_version@/$(VERSION)/g' \ $(top_srcdir)/scripts/gnupg.spec.in \ > $(distdir)/scripts/gnupg.spec + rm $(distdir)/gcrypt/*.[ch] -# maintainer only +if MAINTAINER_MODE +# This is only useful within my local environment (wk) cvs-get: rsync -Cavuzb --exclude scratch --exclude .deps \ wkoch@sigtrap.guug.de:work/gnupg . @@ -36,6 +38,7 @@ cvs-put: cvs-sync: cvs-get cvs-put +endif .PHONY: cvs-get cvs-put cvs-sync diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 2ce644a4..91a27704 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> + + + * Makefile.am: Support for libtool. + Fri Jul 2 11:45:54 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> diff --git a/cipher/Makefile.am b/cipher/Makefile.am index af6d8024..164a99b0 100644 --- a/cipher/Makefile.am +++ b/cipher/Makefile.am @@ -3,7 +3,7 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl -noinst_LIBRARIES = libcipher.a +noinst_LTLIBRARIES = libcipher.la # The configure script greps the module names from the following lines. # You must also add all these names to EXTRA_PROGRAMS some lines below @@ -33,7 +33,8 @@ endif DYNLINK_MOD_CFLAGS = -DIS_MODULE @DYNLINK_MOD_CFLAGS@ -libcipher_a_SOURCES = cipher.c \ +libcipher_la_LDFLAGS = +libcipher_la_SOURCES = cipher.c \ pubkey.c \ md.c \ dynload.c \ @@ -62,8 +63,8 @@ libcipher_a_SOURCES = cipher.c \ BUILT_SOURCES = construct.c -libcipher_a_DEPENDENCIES = @STATIC_CIPHER_OBJS@ -libcipher_a_LIBADD = @STATIC_CIPHER_OBJS@ +libcipher_la_DEPENDENCIES = @STATIC_CIPHER_OBJS@ +libcipher_la_LIBADD = @STATIC_CIPHER_OBJS@ # If I remember it correct, automake 1.4 has a feature to set diff --git a/configure.in b/configure.in index e5d79389..d94a76a6 100644 --- a/configure.in +++ b/configure.in @@ -109,8 +109,18 @@ AC_MSG_CHECKING([whether compilation of libgcrypt is requested]) AC_ARG_ENABLE(libgcrypt, [ --enable-libgcrypt compile the libgcrypt [default=no]], [compile_libgcrypt="$enableval"],[compile_libgcrypt=no]) -AM_CONDITIONAL(COMPILE_LIBGCRYPT, test x$compile_libgcrypt = xyes) AC_MSG_RESULT($compile_libgcrypt) +if test x$compile_libgcrypt = xyes ; then + if test -f $srcdir/gcrypt/gcrypt.h; then + : + else + compile_libgcrypt=no + AC_MSG_WARN([[ +*** LIBGCRYPT is not yet ready for public testing. +*** Maybe you have more luck with the next release of GnuPG]]) + fi +fi +AM_CONDITIONAL(COMPILE_LIBGCRYPT, test x$compile_libgcrypt = xyes) dnl @@ -123,6 +133,8 @@ AC_ARG_WITH(capabilities, AC_MSG_RESULT($use_capabilities) +AM_MAINTAINER_MODE + dnl Checks for programs. AC_CANONICAL_SYSTEM @@ -139,15 +151,17 @@ AC_PROG_CC AC_PROG_CPP AC_ISC_POSIX AC_PROG_INSTALL -AC_PROG_RANLIB +AC_PROG_AWK AC_CHECK_PROG(DOCBOOK_TO_MAN, docbook-to-man, yes, no) AM_CONDITIONAL(HAVE_DOCBOOK_TO_MAN, test "$ac_cv_prog_DOCBOOK_TO_MAN" = yes) dnl -dnl Don't default to build shared libs +dnl Build shared libraries only when compilation of libgcrypt +dnl has been requested dnl AM_DISABLE_SHARED +enable_shared="$compile_libgcrypt" AM_PROG_LIBTOOL @@ -486,7 +500,7 @@ for name in $MODULES_IN_CIPHER; do done; if test $x = yes; then STATIC_CIPHER_NAMES="$STATIC_CIPHER_NAMES $name" - STATIC_CIPHER_OBJS="$STATIC_CIPHER_OBJS $name.o" + STATIC_CIPHER_OBJS="$STATIC_CIPHER_OBJS $name.lo" else DYNAMIC_CIPHER_MODS="$DYNAMIC_CIPHER_MODS $name" GNUPG_MSG_PRINT([$name]) @@ -556,7 +570,7 @@ if test "$ac_cv_mpi_extra_asm_modules" != ""; then GNUPG_MSG_PRINT([mpi extra asm functions:]) for i in $ac_cv_mpi_extra_asm_modules; do GNUPG_MSG_PRINT([$i]) - MPI_EXTRA_ASM_OBJS="$MPI_EXTRA_ASM_OBJS $i.o" + MPI_EXTRA_ASM_OBJS="$MPI_EXTRA_ASM_OBJS $i.lo" done AC_MSG_RESULT() fi diff --git a/mpi/ChangeLog b/mpi/ChangeLog index 1951dd3a..cce6ee56 100644 --- a/mpi/ChangeLog +++ b/mpi/ChangeLog @@ -1,3 +1,10 @@ +Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> + + + * mpicoder.c (g10_log_mpidump): New. + + * Makefile.am: Support for libtool. + Fri Jul 2 11:45:54 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> diff --git a/mpi/Makefile.am b/mpi/Makefile.am index 42acb55f..fc25bbb8 100644 --- a/mpi/Makefile.am +++ b/mpi/Makefile.am @@ -10,11 +10,11 @@ DISTCLEANFILES = mpih-add1.S mpih-mul1.S mpih-mul2.S mpih-mul3.S \ CLEANFILES = tmp-*.s -noinst_LIBRARIES = libmpi.a -# noinst_HEADERS = +noinst_LTLIBRARIES = libmpi.la -libmpi_a_SOURCES = longlong.h \ +libmpi_la_LDFLAGS = +libmpi_la_SOURCES = longlong.h \ mpi-add.c \ mpi-bit.c \ mpi-cmp.c \ @@ -37,16 +37,16 @@ libmpi_a_SOURCES = longlong.h \ # Note this objects are actually links, the sourcefiles are # distributed by special code in dist-hook -common_asm_objects = mpih-mul1.o \ - mpih-mul2.o \ - mpih-mul3.o \ - mpih-add1.o \ - mpih-sub1.o \ - mpih-lshift.o \ - mpih-rshift.o +common_asm_objects = mpih-mul1.lo \ + mpih-mul2.lo \ + mpih-mul3.lo \ + mpih-add1.lo \ + mpih-sub1.lo \ + mpih-lshift.lo \ + mpih-rshift.lo -libmpi_a_DEPENDENCIES = $(common_asm_objects) @MPI_EXTRA_ASM_OBJS@ -libmpi_a_LIBADD = $(common_asm_objects) @MPI_EXTRA_ASM_OBJS@ +libmpi_la_DEPENDENCIES = $(common_asm_objects) @MPI_EXTRA_ASM_OBJS@ +libmpi_la_LIBADD = $(common_asm_objects) @MPI_EXTRA_ASM_OBJS@ SUFFIXES = .S @@ -56,3 +56,12 @@ SUFFIXES = .S mv tmp-$*.o $@ rm -f tmp-$*.s +.S.lo: + $(CPP) $(INCLUDES) $(DEFS) $< | grep -v '^#' >tmp-$*.s + if test -f tmp-$*.lo; then rm tmp-$*.lo; fi + if test -f tmp-$*.o ; then rm tmp-$*.o ; fi + $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(SFLAGS) -c tmp-$*.s + if test -f tmp-$*.lo; then mv tmp-$*.lo $*.lo; fi + if test -f tmp-$*.o ; then mv tmp-$*.o $*.o ; fi + rm -f tmp-$*.s + diff --git a/mpi/mpicoder.c b/mpi/mpicoder.c index 2ef4c141..dae6eb4e 100644 --- a/mpi/mpicoder.c +++ b/mpi/mpicoder.c @@ -286,6 +286,16 @@ mpi_print( FILE *fp, MPI a, int mode ) } +void +g10_log_mpidump( const char *text, MPI a ) +{ + FILE *fp = log_stream(); + + g10_log_print_prefix(text); + mpi_print(fp, a, 1 ); + fputc('\n', fp); +} + /**************** * Special function to get the low 8 bytes from an mpi. * This can be used as a keyid; KEYID is an 2 element array. diff --git a/scripts/autogen.sh b/scripts/autogen.sh index 266eb75b..045716b8 100755 --- a/scripts/autogen.sh +++ b/scripts/autogen.sh @@ -7,7 +7,7 @@ DIE=no autoconf_vers=2.13 automake_vers=1.4 aclocal_vers=1.4 -libtool_vers=1.2 +libtool_vers=1.3 if (autoconf --version) < /dev/null > /dev/null 2>&1 ; then if (autoconf --version | awk 'NR==1 { if( $3 >= '$autoconf_vers') \ diff --git a/scripts/distfiles b/scripts/distfiles index 13127323..804b73f8 100644 --- a/scripts/distfiles +++ b/scripts/distfiles @@ -7,4 +7,6 @@ missing gnupg.spec.in autogen.sh ChangeLog +ltconfig +ltmain.sh diff --git a/src/ChangeLog b/src/ChangeLog index ee0f83d2..01862f02 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> + + + * sexp.c: New. + Tue Dec 8 13:15:16 CET 1998 Werner Koch <wk@isil.d.shuttle.de> * gcrypt.h: New diff --git a/src/Makefile.am b/src/Makefile.am index d8f8beca..5a047100 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,19 +1,31 @@ ## Process this file with automake to produce Makefile.in +EXTRA_DIST = README INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl lib_LTLIBRARIES = libgcrypt.la -libgcrypt_la_LDFLAGS = -version-info 0:0:0 +libgcrypt_la_LDFLAGS = -version-info 0:0:0 -export-symbols libgcrypt.sym libgcrypt_la_SOURCES = gcrypt.h \ g10lib.h \ misc.c \ + sexp.c \ global.c \ mpiapi.c \ symapi.c \ mdapi.c \ pkapi.c +libgcrypt_la_DEPENDENCIES = libgcrypt.sym +libgcrypt_la_LIBADD = ../cipher/libcipher.la \ + ../mpi/libmpi.la \ + ../util/libutil.la +BUILT_SOURCES = libgcrypt.sym +# libtool's --export-symbols-regex does not work in 1.3 +# so we do it ourself +libgcrypt.sym: $(libgcrypt_la_OBJECTS) + $(NM) $(libgcrypt_la_OBJECTS) \ + | $(AWK) '$$2=="T" && $$3 ~ /^gcry_/ {print $$3}' >libgcrypt.sym diff --git a/src/gcrypt.h b/src/gcrypt.h index 878e1f2c..eb8ff75a 100644 --- a/src/gcrypt.h +++ b/src/gcrypt.h @@ -71,6 +71,17 @@ enum gcry_random_level { GCRY_VERY_STRONG_RANDOM = 2 }; + +struct gcry_sexp; +typedef struct gcry_sexp *GCRY_SEXP; + +enum gcry_sexp_format { + GCRY_SEXP_FMT_DEFAULT = 0, + GCRY_SEXP_FMT_CANON = 1, + GCRY_SEXP_FMT_BASE64 = 2, + GCRY_SEXP_FMT_ADVANCED = 3, +}; + /******************************************* * * * multi precision integer functions * @@ -117,30 +128,6 @@ void gcry_mpi_powm( GCRY_MPI w, #define mpi_cmp_ui( u, v ) gcry_mpi_cmp_ui( (u), (v) ) #define mpi_powm(w,b,e,m) gcry_mpi_powm( (w), (b), (e), (m) ) - -#if 0 -#define mpi_swap( a, b ) gcry_mpi_api( (a), (b) ) -void g10m_add(MPI w, MPI u, MPI v); -void g10m_add_ui(MPI w, MPI u, unsigned long v ); -void g10m_sub( MPI w, MPI u, MPI v); -void g10m_sub_ui(MPI w, MPI u, unsigned long v ); - -void g10m_mul_ui(MPI w, MPI u, unsigned long v ); -void g10m_mul_2exp( MPI w, MPI u, unsigned long cnt); -void g10m_mul( MPI w, MPI u, MPI v); -void g10m_mulm( MPI w, MPI u, MPI v, MPI m); - -void g10m_fdiv_q( MPI quot, MPI dividend, MPI divisor ); - -int g10m_gcd( MPI g, MPI a, MPI b ); -int g10m_invm( MPI x, MPI u, MPI v ); - -unsigned g10m_get_nbits( MPI a ); -unsigned g10m_get_size( MPI a ); - -void g10m_set_buffer( MPI a, const char *buffer, unsigned nbytes, int sign ); -#endif - #endif /* GCRYPT_NO_MPI_MACROS */ /******************************************** diff --git a/src/mpiapi.c b/src/mpiapi.c index 9685008e..acf5c5ad 100644 --- a/src/mpiapi.c +++ b/src/mpiapi.c @@ -149,6 +149,18 @@ gcry_mpi_scan( struct gcry_mpi **ret_mpi, enum gcry_mpi_format format, mpi_free(a); return 0; } + else if( format == GCRYMPI_FMT_HEX ) { + if( nbytes ) + return GCRYERR_INV_ARG; /* can only handle C strings for now */ + a = mpi_alloc(0); + if( mpi_fromstr( a, buffer ) ) + return GCRYERR_INV_OBJ; + if( ret_mpi ) + *ret_mpi = a; + else + mpi_free(a); + return 0; + } else return GCRYERR_INV_ARG; } @@ -226,17 +238,16 @@ gcry_mpi_print( enum gcry_mpi_format format, char *buffer, size_t *nbytes, int extra = 0; unsigned int n=0; - if( a->sign ) - return GCRYERR_INTERNAL; /* can't handle it yet */ - tmp = mpi_get_buffer( a, &n, NULL ); if( !n || (*tmp & 0x80) ) extra=1; - if( 2*n+2+1 > len ) { + if( 2*n+3+1 > len ) { m_free(tmp); return GCRYERR_TOO_SHORT; /* the provided buffer is too short */ } + if( a->sign ) + *s++ = '-'; if( extra ) { *s++ = '0'; *s++ = '0'; diff --git a/src/symapi.c b/src/symapi.c index 4c718929..e2aca4e2 100644 --- a/src/symapi.c +++ b/src/symapi.c @@ -75,6 +75,8 @@ gcry_cipher_open( GCRY_CIPHER_HD *ret_hd, int algo, int mode, unsigned flags ) return set_lasterr( GCRYERR_INV_ALGO ); } + /* FIXME: issue a warning when CIPHER_MODE_NONE is used */ + /* allocate the handle */ h = m_lib_alloc_clear( sizeof *h ); if( !h ) |