aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/parse-packet.c17
2 files changed, 12 insertions, 10 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 8f8f40148..8ac1b0e72 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-16 David Shaw <[email protected]>
+
+ * parse-packet.c (parse_one_sig_subpkt, enum_sig_subpkt): Don't
+ BUG() on unknown subpackets. Rather, just return them silently.
+
2004-10-15 Werner Koch <[email protected]>
* status.h (STATUS_NEED_PASSPHRASE_PIN): New.
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 48035ad5d..eeb75ac89 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -955,10 +955,9 @@ dump_sig_subpkt( int hashed, int type, int critical,
}
/****************
- * Returns: >= 0 offset into buffer
- * -1 unknown type
- * -2 unsupported type
- * -3 subpacket too short
+ * Returns: >= 0 use this offset into buffer
+ * -1 explicitly reject returning this type
+ * -2 subpacket too short
*/
int
parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
@@ -1008,9 +1007,9 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
if ( n != 2 )
break;
return 0;
- default: return -1;
+ default: return 0;
}
- return -3;
+ return -2;
}
@@ -1130,13 +1129,11 @@ enum_sig_subpkt( const subpktarea_t *pktbuf, sigsubpkttype_t reqtype,
*ret_n = n;
offset = parse_one_sig_subpkt(buffer, n, type );
switch( offset ) {
- case -3:
- log_error("subpacket of type %d too short\n", type);
- return NULL;
case -2:
+ log_error("subpacket of type %d too short\n", type);
return NULL;
case -1:
- BUG(); /* not yet needed */
+ return NULL;
default:
break;
}