mirror of
git://git.gnupg.org/gnupg.git
synced 2024-11-04 20:38:50 +01:00
* packet.h, build-packet.c (build_sig_subpkt), export.c
(do_export_stream), import.c (remove_bad_stuff, import), parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt): Remove vestigal code for the old sig cache subpacket. This wasn't completely harmless as it caused subpacket 101 to disappear on import and export.
This commit is contained in:
parent
55ddaeb1b5
commit
620afaecb5
@ -1,3 +1,12 @@
|
||||
2003-05-01 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* packet.h, build-packet.c (build_sig_subpkt), export.c
|
||||
(do_export_stream), import.c (remove_bad_stuff, import),
|
||||
parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt): Remove
|
||||
vestigal code for the old sig cache subpacket. This wasn't
|
||||
completely harmless as it caused subpacket 101 to disappear on
|
||||
import and export.
|
||||
|
||||
2003-04-30 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* pkclist.c (do_we_trust_pre): If an untrusted key was chosen by a
|
||||
|
@ -782,9 +782,6 @@ build_sig_subpkt (PKT_signature *sig, sigsubpkttype_t type,
|
||||
nlen = 1; /* just a 1 byte length header */
|
||||
|
||||
switch( type ) {
|
||||
case SIGSUBPKT_PRIV_VERIFY_CACHE: /*(obsolete)*/
|
||||
BUG();
|
||||
break;
|
||||
/* The issuer being unhashed is a historical oddity. It
|
||||
should work equally as well hashed. Of course, if even an
|
||||
unhashed issuer is tampered with, it makes it awfully hard
|
||||
|
@ -280,10 +280,6 @@ do_export_stream( IOBUF out, STRLIST users, int secret,
|
||||
if(i<node->pkt->pkt.signature->numrevkeys)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* delete our verification cache */
|
||||
delete_sig_subpkt (node->pkt->pkt.signature->unhashed,
|
||||
SIGSUBPKT_PRIV_VERIFY_CACHE);
|
||||
}
|
||||
|
||||
/* Don't export attribs? */
|
||||
|
18
g10/import.c
18
g10/import.c
@ -60,7 +60,6 @@ static int import( IOBUF inp, int fast, const char* fname,
|
||||
struct stats_s *stats, unsigned int options );
|
||||
static int read_block( IOBUF a, PACKET **pending_pkt, KBNODE *ret_root );
|
||||
static void revocation_present(KBNODE keyblock);
|
||||
static void remove_bad_stuff (KBNODE keyblock);
|
||||
static int import_one( const char *fname, KBNODE keyblock, int fast,
|
||||
struct stats_s *stats, unsigned int options);
|
||||
static int import_secret_one( const char *fname, KBNODE keyblock,
|
||||
@ -247,7 +246,6 @@ import( IOBUF inp, int fast, const char* fname,
|
||||
}
|
||||
|
||||
while( !(rc = read_block( inp, &pending_pkt, &keyblock) )) {
|
||||
remove_bad_stuff (keyblock);
|
||||
if( keyblock->pkt->pkttype == PKT_PUBLIC_KEY )
|
||||
rc = import_one( fname, keyblock, fast, stats, options );
|
||||
else if( keyblock->pkt->pkttype == PKT_SECRET_KEY )
|
||||
@ -437,22 +435,6 @@ read_block( IOBUF a, PACKET **pending_pkt, KBNODE *ret_root )
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
remove_bad_stuff (KBNODE keyblock)
|
||||
{
|
||||
KBNODE node;
|
||||
|
||||
for (node=keyblock; node; node = node->next ) {
|
||||
if( node->pkt->pkttype == PKT_SIGNATURE ) {
|
||||
/* delete the subpackets we used to use for the
|
||||
verification cache */
|
||||
delete_sig_subpkt (node->pkt->pkt.signature->unhashed,
|
||||
SIGSUBPKT_PRIV_VERIFY_CACHE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Walk through the subkeys on a pk to find if we have the PKS
|
||||
disease: multiple subkeys with their binding sigs stripped, and the
|
||||
sig for the first subkey placed after the last subkey. That is,
|
||||
|
@ -344,7 +344,6 @@ typedef enum {
|
||||
SIGSUBPKT_SIGNERS_UID =28, /* signer's user id */
|
||||
SIGSUBPKT_REVOC_REASON =29, /* reason for revocation */
|
||||
SIGSUBPKT_FEATURES =30, /* feature flags */
|
||||
SIGSUBPKT_PRIV_VERIFY_CACHE =101, /* cache verification result (obsolete)*/
|
||||
|
||||
SIGSUBPKT_FLAG_CRITICAL=128
|
||||
} sigsubpkttype_t;
|
||||
|
@ -899,10 +899,12 @@ dump_sig_subpkt( int hashed, int type, int critical,
|
||||
for( i=0; i < length; i++ )
|
||||
printf(" %02x", buffer[i] );
|
||||
break;
|
||||
case SIGSUBPKT_PRIV_VERIFY_CACHE:
|
||||
p = "obsolete verification cache";
|
||||
default:
|
||||
if(type>=100 && type<=110)
|
||||
p="experimental / private subpacket";
|
||||
else
|
||||
p = "?";
|
||||
break;
|
||||
default: p = "?"; break;
|
||||
}
|
||||
|
||||
printf("%s)\n", p? p: "");
|
||||
@ -957,19 +959,6 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
|
||||
if ( n != 1 )
|
||||
break;
|
||||
return 0;
|
||||
case SIGSUBPKT_PRIV_VERIFY_CACHE:
|
||||
/* We used this in gpg 1.0.5 and 1.0.6 to cache signature
|
||||
* verification results - it is no longer used.
|
||||
* "GPG" 0x00 <mode> <stat>
|
||||
* where mode == 1: valid data, stat == 0: invalid signature
|
||||
* stat == 1: valid signature
|
||||
* (because we use private data, we check our marker) */
|
||||
if( n < 6 )
|
||||
break;
|
||||
if( buffer[0] != 'G' || buffer[1] != 'P'
|
||||
|| buffer[2] != 'G' || buffer[3] )
|
||||
return -2;
|
||||
return 4;
|
||||
default: return -1;
|
||||
}
|
||||
return -3;
|
||||
|
Loading…
Reference in New Issue
Block a user