1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-23 15:07:03 +01:00

* parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt,

can_handle_critical): Parse and display 0x19 signatures.
This commit is contained in:
David Shaw 2004-04-22 00:54:30 +00:00
parent 36e6975ac9
commit 2bdb01e2e7
2 changed files with 91 additions and 74 deletions

View File

@ -1,3 +1,8 @@
2004-04-21 David Shaw <dshaw@jabberwocky.com>
* parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt,
can_handle_critical): Parse and display 0x19 signatures.
2004-04-20 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (parse_keyserver_uri): Do not accept "http" as an

View File

@ -949,6 +949,17 @@ dump_sig_subpkt( int hashed, int type, int critical,
for( i=0; i < length; i++ )
printf(" %02x", buffer[i] );
break;
case SIGSUBPKT_SIGNATURE:
fputs("signature: ",stdout);
if(length<17)
p="[too short]";
else
printf("v%d, class 0x%02X, algo %d, digest algo %d",
buffer[0],
buffer[0]==3?buffer[2]:buffer[1],
buffer[0]==3?buffer[15]:buffer[2],
buffer[0]==3?buffer[16]:buffer[3]);
break;
default:
if(type>=100 && type<=110)
p="experimental / private subpacket";
@ -969,7 +980,8 @@ dump_sig_subpkt( int hashed, int type, int critical,
int
parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
{
switch( type ) {
switch( type )
{
case SIGSUBPKT_REV_KEY:
if(n < 22)
break;
@ -990,8 +1002,10 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
case SIGSUBPKT_FEATURES:
case SIGSUBPKT_REGEXP:
return 0;
case SIGSUBPKT_SIGNATURE:
case SIGSUBPKT_EXPORTABLE:
case SIGSUBPKT_REVOCABLE:
case SIGSUBPKT_REVOC_REASON:
if( !n )
break;
return 0;
@ -1003,10 +1017,6 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
if( n < 8 ) /* minimum length needed */
break;
return 0;
case SIGSUBPKT_REVOC_REASON:
if( !n )
break;
return 0;
case SIGSUBPKT_PRIMARY_UID:
if ( n != 1 )
break;
@ -1024,12 +1034,14 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
static int
can_handle_critical( const byte *buffer, size_t n, int type )
{
switch( type ) {
switch( type )
{
case SIGSUBPKT_NOTATION:
if( n >= 8 && (*buffer & 0x80) )
return 1; /* human readable is handled */
return 0;
case SIGSUBPKT_SIGNATURE:
case SIGSUBPKT_SIG_CREATED:
case SIGSUBPKT_SIG_EXPIRE:
case SIGSUBPKT_KEY_EXPIRE: