aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog18
-rw-r--r--g10/armor.c6
-rw-r--r--g10/keylist.c3
-rw-r--r--g10/mainproc.c11
-rw-r--r--g10/signal.c12
-rw-r--r--g10/tdbdump.c4
6 files changed, 44 insertions, 10 deletions
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 <[email protected]>
+
+ * 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 <[email protected]>
* 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