1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-22 14:57:02 +01:00

* parse-packet.c (parse_one_sig_subpkt, enum_sig_subpkt): Don't BUG() on

unknown subpackets.  Rather, just return them silently.
This commit is contained in:
David Shaw 2004-10-16 22:48:20 +00:00
parent 4d79b138ac
commit b03a7a6f3b
2 changed files with 12 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2004-10-16 David Shaw <dshaw@jabberwocky.com>
* 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 <wk@g10code.com> 2004-10-15 Werner Koch <wk@g10code.com>
* status.h (STATUS_NEED_PASSPHRASE_PIN): New. * status.h (STATUS_NEED_PASSPHRASE_PIN): New.

View File

@ -955,10 +955,9 @@ dump_sig_subpkt( int hashed, int type, int critical,
} }
/**************** /****************
* Returns: >= 0 offset into buffer * Returns: >= 0 use this offset into buffer
* -1 unknown type * -1 explicitly reject returning this type
* -2 unsupported type * -2 subpacket too short
* -3 subpacket too short
*/ */
int int
parse_one_sig_subpkt( const byte *buffer, size_t n, int type ) 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 ) if ( n != 2 )
break; break;
return 0; 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; *ret_n = n;
offset = parse_one_sig_subpkt(buffer, n, type ); offset = parse_one_sig_subpkt(buffer, n, type );
switch( offset ) { switch( offset ) {
case -3: case -2:
log_error("subpacket of type %d too short\n", type); log_error("subpacket of type %d too short\n", type);
return NULL; return NULL;
case -2:
return NULL;
case -1: case -1:
BUG(); /* not yet needed */ return NULL;
default: default:
break; break;
} }