From 7240c5816000329fbe1695ab2fda1eade6bd32aa Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Mon, 22 Nov 1999 10:10:27 +0000
Subject: [PATCH] See ChangeLog: Mon Nov 22 11:14:53 CET 1999  Werner Koch

---
 AUTHORS             |  6 ++---
 BUGS                | 60 ++++-----------------------------------------
 ChangeLog           |  4 +++
 README              |  2 --
 TODO                |  7 ------
 doc/ChangeLog       |  5 ++++
 doc/Makefile.am     |  2 --
 doc/gph/Makefile.am |  2 +-
 g10/ChangeLog       | 18 ++++++++++++++
 g10/armor.c         |  6 +++++
 g10/keylist.c       |  3 ++-
 g10/mainproc.c      | 11 ++++++---
 g10/signal.c        | 12 ++++++---
 g10/tdbdump.c       |  4 +--
 include/util.h      |  3 +++
 util/ChangeLog      |  6 +++++
 util/secmem.c       |  4 +--
 util/strgutil.c     | 12 +++++++++
 18 files changed, 85 insertions(+), 82 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index d901a92fb..4bd60bede 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -67,7 +67,7 @@ jungmann@cwb.matrix.com.br
 
 
 TRANSLATIONS   Pedro Morais
-??????????.  [pt_PT]
+Disclaimer.  [pt_PT]
 morais@poli.org
 
 
@@ -76,8 +76,8 @@ Disclaimer.  [po]
 alex@bofh.torun.pl
 
 
-TRANSLATIONS   Tedi Heriyanto
-?????????????? [id]
+TRANSLATIONS	Tedi Heriyanto	1999-05-20
+Disclaimer.  [id]
 tedi-h@usa.net
 
 
diff --git a/BUGS b/BUGS
index 81fdcf1bd..df428bde4 100644
--- a/BUGS
+++ b/BUGS
@@ -1,58 +1,8 @@
-		   List of some known bugs
-		  -------------------------
+Please see
 
-This following list contains those bugs which we are aware of.	Please
-make sure that bugs you report are not listed here.  If you can fix one
-of these bugs/limitations we will certainly be glad to receive a patch.
-(Please note that we need a disclaimer if a patch is longer than about
-10 lines; but it may help anyway to show us where we have to fix it. Do
-an "info standards" to find out why a disclaimer is needed for GNU.)
+    http://www.gnupg.org/buglist.html
 
-Format: severity: [  *] to [***], no, first reported, by, version.
-Bugs which are marked with "FIX: yyyy-mm-dd" are fixed in the CVS
-and after about half a day in the rsync snapshots.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+for a list know bugs in GnuPG.	We don't distribute this list anymore
+with the package because a more current one with notes in which version
+the bug is fixed can be found online.
 
-[  *] #3
-    --list-packets should continue even w/o a passphrase (or in batch
-    mode).  Maybe we have to move it to a separate program??
-
-[  *] #4  1999-01-13 <ralf.stephan@fitug.de> 0.9.1
-    v3 key 'expiration date' problem:
-       1. generate a key, set expiration date
-       2. <do other things, deleting etc.>
-       3. edit a v3 secret key, try to set expiration date
-       - output: "You can't change...
-       4. save
-       5. key has expiration date from 1. and gpg reports that pubkey
-	  and seckey differ.
-    The for loop the exp.date is set before v3 detection?
-    [is this bug still alive? - can someone please check it]
-
-[ **] #6 1999-02-22 <backes@rhrk.uni-kl.de> 0.9.3
-    Bus error on IRIX 6.4: Crash while doing a keygen. I think while creating
-    the prime.	Other bus errors are reported when doing a "gpg README"
-    on sparc-solaris2.6.
-    --> Solaris fixed.
-    --> IRIX bug still there but someone should test this again!
-
-[  *] #18 1999-05-27 <Steffen.Zahn@icn.siemens.de> 0.9.7
-    rndunix hangs on hp/ux.  The problem is related to my_plcose which is
-    not always called.	(I suggest to use EGD instead of rndunix.)
-
-[  *] #22 1999-07-22
-    Solaris make has problems with the generated POTFILES - seems to be a
-    gettext bug.  Use GNU gmake as a workaround.
-
-[  *] #23 1999-09-03 <todd.brooks@yale.edu> 0.9.11
-    Only the first signature of a cleartext sig seems to be verified.
-    Can't fix it in 1.0 because the code is semi-frozen.
-    HMMM: Can't reprodude the bug here - it just works.  Check wehther
-
-[  *] #24 1999-09-05 <marcus@yoyo.cc.monash.edu.au> 0.9.11
-    Does not link libc and libz expect when removing all "-lc -lz" except
-    for the last one.  This happens on some systems when not using the
-    GNU ld.  This need to be fixed in libtool.
-
-
-Next #25
diff --git a/ChangeLog b/ChangeLog
index 3dcd98ef8..446b39fbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Nov 22 11:14:53 CET 1999  Werner Koch  <wk@gnupg.de>
+
+	* BUGS: Replaced content with a link to the online list.
+
 Fri Nov 12 20:33:19 CET 1999  Werner Koch  <wk@gnupg.de>
 
 	* README: Fixed a type and add a note about the gnupg-i18n ML.
diff --git a/README b/README
index e65c94549..8139cc845 100644
--- a/README
+++ b/README
@@ -510,8 +510,6 @@
     the GNU service directory or search other resources.
 
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.0.0e (GNU/Linux)
-Comment: For info see http://www.gnupg.org
 
 iQB1AwUBOCv6bB0Z9MEMmFelAQGktwL/SyzPDeU2I38lFj3Xx7IhL9vUTEaEDuAH
 FFjs0i4qpRlvYVfTtEQjkUMCUe6PCMXNXY+var1FOECpJwS93t4uf3VV83ESOMCu
diff --git a/TODO b/TODO
index b79d4a469..27b7664de 100644
--- a/TODO
+++ b/TODO
@@ -1,11 +1,4 @@
 
-  * HAVE_STRCASECMP testen.  HAVE/RUSAGE nur benutzen wenn RUSAGE?SELF
-  auch definiert ist.
-
-  * It seems that we calculate hashes in g10/mainproc.c:proc_plaintext
-  even when we know that there is no signature (-c or --no-verify) to
-  check.
-
 Scheduled for 1.1
 -----------------
   * With option -i prompt before adding a key to the keyring and show some
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 6c5adae51..61e3ff2fc 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+Mon Nov 22 11:14:53 CET 1999  Werner Koch  <wk@gnupg.de>
+
+	* gph: Removed the directory from the dist becuase it will
+	go into it's own package.
+
 Thu Sep 23 09:52:58 CEST 1999  Werner Koch  <wk@isil.d.shuttle.de>
 
 	* README.W32: New.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index e4e135b44..37546f704 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,7 +1,5 @@
 ## Process this file with automake to create Makefile.in
 
-SUBDIRS = gph
-
 EXTRA_DIST = DETAILS gpg.sgml gpg.1 FAQ HACKING OpenPGP  README.W32
 
 man_MANS = gpg.1
diff --git a/doc/gph/Makefile.am b/doc/gph/Makefile.am
index 7e469505a..d36b0013a 100644
--- a/doc/gph/Makefile.am
+++ b/doc/gph/Makefile.am
@@ -27,7 +27,7 @@ index.html: $(PARTS)
 	echo '</body></html>' >>index.html
 	-rm -r manual.junk
 	-rm manual/signatures.jpg
-	(cd manual; rm -r stylesheet-images; ls | grep -v distfiles >distfiles)
+##    (cd manual; rm -r stylesheet-images; ls | grep -v distfiles >distfiles)
 
 
 dist-hook: index.html
diff --git a/g10/ChangeLog b/g10/ChangeLog
index b933c22b9..4de854aba 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,21 @@
+Mon Nov 22 11:14:53 CET 1999  Werner Koch  <wk@gnupg.de>
+
+	* mainproc.c (proc_plaintext): Never enable the hash processing
+	when skip_verify is active.
+
+	* armor.c (parse_header_line): Stop parsing on a WS line too.
+	Suggested by Aric Cyr.
+
+	* tdbdump.c (HEXTOBIN): Changed the name of the argument, so that
+	traditional cpp don't mess up the macros. Suggested by Jos Backus.
+
+	* mainproc.c (list_node): Print the PK algo in the --with-colon mode.
+	* keylist.c (list_keyblock): Ditto.
+
+	* signal.c (got_fatal_signal): Found the reason why exit(8) did not
+	work - it is better to set the disposition back to default before
+	raising the signal.  Print the notice on stderr always.
+
 Fri Nov 12 20:33:19 CET 1999  Werner Koch  <wk@gnupg.de>
 
 	* g10.c (make_username): Swapped the logic.
diff --git a/g10/armor.c b/g10/armor.c
index d0cbfd067..be0cc1472 100644
--- a/g10/armor.c
+++ b/g10/armor.c
@@ -311,9 +311,15 @@ parse_header_line( armor_filter_context_t *afx, byte *line, unsigned len )
     byte *p;
     int hashes=0;
 
+    /* fixme: why this double check?  I think the original code w/o the
+     * second check for an empty line was done from an early draft of
+     * of OpenPGP - or simply very stupid code */
     if( *line == '\n' || ( len && (*line == '\r' && line[1]=='\n') ) )
 	return 0; /* empty line */
     len = trim_trailing_ws( line, len );
+    if( !len )
+	return 0; /* WS only same as empty line */
+
     p = strchr( line, ':');
     if( !p || !p[1] ) {
 	log_error(_("invalid armor header: "));
diff --git a/g10/keylist.c b/g10/keylist.c
index e94631aa8..4b973786a 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -389,7 +389,8 @@ list_keyblock( KBNODE keyblock, int secret )
 		putchar(':');
 		if( sigrc != ' ' )
 		    putchar(sigrc);
-		printf(":::%08lX%08lX:%s::::", (ulong)sig->keyid[0],
+		printf("::%d:%08lX%08lX:%s::::", sig->pubkey_algo,
+						 (ulong)sig->keyid[0],
 			   (ulong)sig->keyid[1], datestr_from_sig(sig));
 	    }
 	    else
diff --git a/g10/mainproc.c b/g10/mainproc.c
index 1299c7a24..990c8401b 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -1,4 +1,4 @@
-/* maPPPPinproc.c - handle packets
+/* mainproc.c - handle packets
  *	Copyright (C) 1998, 1999 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
@@ -397,12 +397,14 @@ proc_plaintext( CTX c, PACKET *pkt )
 		clearsig = 1;
 	}
     }
-    if( !any ) { /* no onepass sig packet: enable all standard algos */
+
+    if( !any && !opt.skip_verify ) {
+	/* no onepass sig packet: enable all standard algos */
 	md_enable( c->mfx.md, DIGEST_ALGO_RMD160 );
 	md_enable( c->mfx.md, DIGEST_ALGO_SHA1 );
 	md_enable( c->mfx.md, DIGEST_ALGO_MD5 );
     }
-    if( only_md5 ) {
+    if( only_md5 && !opt.skip_verify ) {
 	/* This is a kludge to work around a bug in pgp2.  It does only
 	 * catch those mails which are armored.  To catch the non-armored
 	 * pgp mails we could see whether there is the signature packet
@@ -828,7 +830,8 @@ list_node( CTX c, KBNODE node )
 	    putchar(':');
 	    if( sigrc != ' ' )
 		putchar(sigrc);
-	    printf(":::%08lX%08lX:%s::::", (ulong)sig->keyid[0],
+	    printf("::%d:%08lX%08lX:%s::::", sig->pubkey_algo,
+					     (ulong)sig->keyid[0],
 		       (ulong)sig->keyid[1], datestr_from_sig(sig));
 	}
 	else
diff --git a/g10/signal.c b/g10/signal.c
index 6ed23e5a0..ea837c3e7 100644
--- a/g10/signal.c
+++ b/g10/signal.c
@@ -53,20 +53,26 @@ static RETSIGTYPE
 got_fatal_signal( int sig )
 {
     const char *s;
+    struct sigaction nact;
 
     if( caught_fatal_sig )
 	raise( sig );
     caught_fatal_sig = 1;
 
     secmem_term();
-  #ifdef IS_DEVELOPMENT_VERSION
+    /* better don't transtale these messages */
     write(2, "\n", 1 );
     s = log_get_name(); if( s ) write(2, s, strlen(s) );
     write(2, ": ", 2 );
     s = get_signal_name(sig); write(2, s, strlen(s) );
     write(2, " caught ... exiting\n", 21 );
-  #endif
-    exit(8); /* Hmmm, for some reasons rais2e does not work */
+
+    /* reset action to default action and raise signal again */
+    nact.sa_handler = SIG_DFL;
+    sigemptyset( &nact.sa_mask );
+    nact.sa_flags = 0;
+    sigaction( sig, &nact, NULL);
+    raise( sig );
 }
 
 
diff --git a/g10/tdbdump.c b/g10/tdbdump.c
index e384b8be7..230fda980 100644
--- a/g10/tdbdump.c
+++ b/g10/tdbdump.c
@@ -43,8 +43,8 @@
 #include "tdbio.h"
 
 
-#define HEXTOBIN(a) ( (a) >= '0' && (a) <= '9' ? ((a)-'0') : \
-		      (a) >= 'A' && (a) <= 'F' ? ((a)-'A'+10) : ((a)-'a'+10))
+#define HEXTOBIN(x) ( (x) >= '0' && (x) <= '9' ? ((x)-'0') : \
+		      (x) >= 'A' && (x) <= 'F' ? ((x)-'A'+10) : ((x)-'a'+10))
 
 /****************
  * Read a record but die if it does not exist
diff --git a/include/util.h b/include/util.h
index 0fade55f4..08c514a23 100644
--- a/include/util.h
+++ b/include/util.h
@@ -188,6 +188,9 @@ char *stpcpy(char *a,const char *b);
 #ifndef HAVE_STRLWR
 char *strlwr(char *a);
 #endif
+#ifndef HAVE_STRCASECMP
+int strcasecmp( const char *, const char *b);
+#endif
 #ifndef HAVE_STRTOUL
   #define strtoul(a,b,c)  ((unsigned long)strtol((a),(b),(c)))
 #endif
diff --git a/util/ChangeLog b/util/ChangeLog
index 531de7c02..972214428 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,3 +1,9 @@
+Mon Nov 22 11:14:53 CET 1999  Werner Koch  <wk@gnupg.de>
+
+	* strgutil.c (strcasecmp): New.
+
+	* secmem.c (pool_is_mmapped): Made volatile.
+
 Sat Oct  9 20:34:41 CEST 1999  Werner Koch  <wk@gnupg.de>
 
 	* Makefile.am:	Removed libtool.
diff --git a/util/secmem.c b/util/secmem.c
index db4ee4148..0ab218567 100644
--- a/util/secmem.c
+++ b/util/secmem.c
@@ -58,7 +58,7 @@ struct memblock_struct {
 
 static void  *pool;
 static volatile int pool_okay; /* may be checked in an atexit function */
-static int   pool_is_mmapped;
+static volatile int pool_is_mmapped;
 static size_t poolsize; /* allocated length */
 static size_t poollen;	/* used length */
 static MEMBLOCK *unused_blocks;
@@ -380,7 +380,7 @@ m_is_secure( const void *p )
 
 /****************
  * Warning:  This code might be called by an interrupt handler
- *	     and frankly, thre should really be such a handler,
+ *	     and frankly, there should really be such a handler,
  *	     to make sure that the memory is wiped out.
  *	     We hope that the OS wipes out mlocked memory after
  *	     receiving a SIGKILL - it really should do so, otherwise
diff --git a/util/strgutil.c b/util/strgutil.c
index 9ab63a047..861bf0d6b 100644
--- a/util/strgutil.c
+++ b/util/strgutil.c
@@ -559,6 +559,18 @@ strlwr(char *s)
 }
 #endif
 
+#ifndef HAVE_STRCASECMP
+int
+strcasecmp( const char *a, const char *b )
+{
+    for( ; *a && *b; a++, b++ ) {
+	if( *a != *b && toupper(*a) != toupper(*b) )
+	    break;
+    }
+    return *(const byte*)a - *(const byte*)b;
+}
+#endif
+
 /****************
  * mingw32/cpd has a memicmp()
  */