diff --git a/ChangeLog b/ChangeLog index 8d0a583a5..4e84473d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Jan 31 17:46:35 CET 2000 Werner Koch + + * Makefile.am: Re-added tools. By Rémi. + Mon Jan 31 16:37:34 CET 2000 Werner Koch * configure.in: Create a symlink for types.h in gcrypt/. diff --git a/Makefile.am b/Makefile.am index bf47e022e..c05fa23d9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ else checks = checks endif -SUBDIRS = intl zlib jnlib util mpi cipher ${gcrypt} g10 po doc ${checks} +SUBDIRS = intl zlib jnlib util mpi cipher ${gcrypt} g10 po tools doc ${checks} EXTRA_DIST = README-alpha VERSION PROJECTS BUGS # gettext never gets it right, so we take here care of deleting the # symlink. my_clean_gcrypt is just a kludge until we can include diff --git a/checks/genkey1024.test b/checks/genkey1024.test index 42a1000c0..3c62166f8 100755 --- a/checks/genkey1024.test +++ b/checks/genkey1024.test @@ -76,7 +76,7 @@ expect { expect { -exact "a test\r \r \rYou selected this USER-ID:\r - \"Harry H. (a test) (INSECURE!)\"\r + \"Harry H. (a test) \"\r \r Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? " { send -- "o\r" } timeout { exit 1 } } diff --git a/configure.in b/configure.in index d67fdf9e1..ac926d640 100644 --- a/configure.in +++ b/configure.in @@ -673,7 +673,7 @@ fi dnl Temp workarounds: GNUPG_LINK_FILES(gcrypt/gcrypt.h, gcrypt.h ) -GNUPG_LINK_FILES(include/typtes.h, gcrypt/types.h ) +GNUPG_LINK_FILES(include/types.h, gcrypt/types.h ) AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes) diff --git a/tools/ChangeLog b/tools/ChangeLog index f3b32eac0..a5566e84b 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -1,3 +1,9 @@ +Mon Jan 31 17:46:35 CET 2000 Werner Koch + + * Makefile.am: Add libjnlib. + * bftest.c: Some minor hacks to let it compile. + * mpicalc.c: Ditto. + Thu Jul 8 16:21:27 CEST 1999 Werner Koch diff --git a/tools/Makefile.am b/tools/Makefile.am index 07fd1145a..92e008dfd 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -2,7 +2,8 @@ EXTRA_DIST = lspgpot INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl -needed_libs = ../util/libutil.la ../gcrypt/libgcrypt.la @INTLLIBS@ +needed_libs = ../gcrypt/libgcrypt.la \ + ../util/libutil.la ../jnlib/libjnlib.la @INTLLIBS@ noinst_PROGRAMS = mpicalc bftest clean-sat mk-tdata shmtest diff --git a/tools/bftest.c b/tools/bftest.c index 8b8175901..1902703f7 100644 --- a/tools/bftest.c +++ b/tools/bftest.c @@ -38,11 +38,6 @@ my_usage(void) exit(1); } -const char * -strusage( int level ) -{ - return default_strusage(level); -} static void i18n_init(void) @@ -53,7 +48,7 @@ i18n_init(void) #else setlocale( LC_ALL, "" ); #endif - bindtextdomain( PACKAGE, G10_LOCALEDIR ); + bindtextdomain( PACKAGE, GNUPG_LOCALEDIR ); textdomain( PACKAGE ); #endif } diff --git a/tools/mpicalc.c b/tools/mpicalc.c index 95ab47c29..aedb27ecf 100644 --- a/tools/mpicalc.c +++ b/tools/mpicalc.c @@ -28,9 +28,9 @@ #include #include #include +#include #include "util.h" -#include "mpi.h" #include "i18n.h" #define STACKSIZE 100 @@ -38,8 +38,8 @@ static MPI stack[STACKSIZE]; static int stackidx; -const char * -strusage( int level ) +static const char * +my_strusage( int level ) { const char *p; switch( level ) { @@ -56,7 +56,7 @@ strusage( int level ) "\nSyntax: mpicalc [options] [files]\n" "MPI RPN calculator\n"; break; - default: p = default_strusage(level); + default: p = NULL; } return p; } @@ -71,11 +71,35 @@ i18n_init(void) #else setlocale( LC_ALL, "" ); #endif - bindtextdomain( PACKAGE, G10_LOCALEDIR ); + bindtextdomain( PACKAGE, GNUPG_LOCALEDIR ); textdomain( PACKAGE ); #endif } +int +mpi_print( FILE *fp, MPI a, int mode ) +{ + int n=0; + + if( !a ) + return fprintf(fp, "[MPI_NULL]"); + if( !mode ) { + unsigned int n1; + n1 = gcry_mpi_get_nbits(a); + n += fprintf(fp, "[%u bits]", n1); + } + else { + int rc; + char *buffer; + + rc = gcry_mpi_aprint( GCRYMPI_FMT_HEX, (void **)&buffer, NULL, a ); + fputs( buffer, fp ); + n += strlen(buffer); + gcry_free( buffer ); + } + return n; +} + static void do_add(void) @@ -233,6 +257,7 @@ main(int argc, char **argv) pargs.argv = &argv; pargs.flags = 0; + set_strusage( my_strusage ); i18n_init(); while( arg_parse( &pargs, opts) ) { switch( pargs.r_opt ) { diff --git a/tools/shmtest.c b/tools/shmtest.c index 1cfb9b4ed..956dec6c5 100644 --- a/tools/shmtest.c +++ b/tools/shmtest.c @@ -15,6 +15,7 @@ #ifdef HAVE_SYS_SHM_H #include #endif +#include #include "util.h" #include "ttyio.h" #include "i18n.h" @@ -36,12 +37,6 @@ my_usage(void) exit(1); } -const char * -strusage( int level ) -{ - return default_strusage(level); -} - static void i18n_init(void) { @@ -51,7 +46,7 @@ i18n_init(void) #else setlocale( LC_ALL, "" ); #endif - bindtextdomain( PACKAGE, G10_LOCALEDIR ); + bindtextdomain( PACKAGE, GNUPG_LOCALEDIR ); textdomain( PACKAGE ); #endif } @@ -77,7 +72,7 @@ do_get_string( int mode, const char *keyword, byte *area, size_t areasize ) memcpy( area+n+2, p, len ); area[n] = len >> 8; area[n+1] = len; - m_free(p); + gcry_free(p); } else { /* bool */ area[n] = 0; @@ -112,7 +107,7 @@ main(int argc, char **argv) for(n=0,i=1; i < argc; i++ ) n += strlen(argv[i]) + 1; - p = m_alloc( 100 + n ); + p = gcry_xmalloc( 100 + n ); strcpy( p, "../g10/gpg --status-fd 1 --run-as-shm-coprocess 0"); for(i=1; i < argc; i++ ) { strcat(p, " " ); @@ -120,7 +115,7 @@ main(int argc, char **argv) } fp = popen( p, "r" ); - m_free( p ); + gcry_free( p ); if( !fp ) log_error("popen failed: %s\n", strerror(errno));