mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
* keyedit.c (print_and_check_one_sig, show_key_and_fingerprint,
menu_addrevoker), keylist.c (list_keyblock_print, print_fingerprint): Show "T" or the trust depth for trust signatures, and add spaces to some strings to make room for it. * packet.h, parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt, parse_signature): Parse trust signature values. * tdbio.h, tdbio.c (tdbio_read_record, tdbio_write_record): Reserve a byte for the minimum ownertrust value (for use with trust signatures).
This commit is contained in:
parent
e4021a4c95
commit
809b8b031a
@ -1,3 +1,17 @@
|
|||||||
|
2002-10-29 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* keyedit.c (print_and_check_one_sig, show_key_and_fingerprint,
|
||||||
|
menu_addrevoker), keylist.c (list_keyblock_print,
|
||||||
|
print_fingerprint): Show "T" or the trust depth for trust
|
||||||
|
signatures, and add spaces to some strings to make room for it.
|
||||||
|
|
||||||
|
* packet.h, parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt,
|
||||||
|
parse_signature): Parse trust signature values.
|
||||||
|
|
||||||
|
* tdbio.h, tdbio.c (tdbio_read_record, tdbio_write_record):
|
||||||
|
Reserve a byte for the minimum ownertrust value (for use with
|
||||||
|
trust signatures).
|
||||||
|
|
||||||
2002-10-29 Stefan Bellon <sbellon@sbellon.de>
|
2002-10-29 Stefan Bellon <sbellon@sbellon.de>
|
||||||
|
|
||||||
* build-packet.c (calc_plaintext, do_plaintext): Removed RISC OS
|
* build-packet.c (calc_plaintext, do_plaintext): Removed RISC OS
|
||||||
|
@ -129,7 +129,7 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( sigrc != '?' || print_without_key ) {
|
if( sigrc != '?' || print_without_key ) {
|
||||||
tty_printf("%s%c%c %c%c%c%c%c %08lX %s ",
|
tty_printf("%s%c%c %c%c%c%c%c%c %08lX %s ",
|
||||||
is_rev? "rev":"sig",sigrc,
|
is_rev? "rev":"sig",sigrc,
|
||||||
(sig->sig_class-0x10>0 &&
|
(sig->sig_class-0x10>0 &&
|
||||||
sig->sig_class-0x10<4)?'0'+sig->sig_class-0x10:' ',
|
sig->sig_class-0x10<4)?'0'+sig->sig_class-0x10:' ',
|
||||||
@ -138,6 +138,8 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node,
|
|||||||
sig->flags.policy_url?'P':' ',
|
sig->flags.policy_url?'P':' ',
|
||||||
sig->flags.notation?'N':' ',
|
sig->flags.notation?'N':' ',
|
||||||
sig->flags.expired?'X':' ',
|
sig->flags.expired?'X':' ',
|
||||||
|
(sig->trust_depth>9)?'T':
|
||||||
|
(sig->trust_depth>0)?'0'+sig->trust_depth:' ',
|
||||||
(ulong)sig->keyid[1], datestr_from_sig(sig));
|
(ulong)sig->keyid[1], datestr_from_sig(sig));
|
||||||
if( sigrc == '%' )
|
if( sigrc == '%' )
|
||||||
tty_printf("[%s] ", g10_errstr(rc) );
|
tty_printf("[%s] ", g10_errstr(rc) );
|
||||||
@ -1925,7 +1927,7 @@ show_key_and_fingerprint( KBNODE keyblock )
|
|||||||
for( node = keyblock; node; node = node->next ) {
|
for( node = keyblock; node; node = node->next ) {
|
||||||
if( node->pkt->pkttype == PKT_PUBLIC_KEY ) {
|
if( node->pkt->pkttype == PKT_PUBLIC_KEY ) {
|
||||||
pk = node->pkt->pkt.public_key;
|
pk = node->pkt->pkt.public_key;
|
||||||
tty_printf("pub %4u%c/%08lX %s ",
|
tty_printf("pub %4u%c/%08lX %s ",
|
||||||
nbits_from_pk( pk ),
|
nbits_from_pk( pk ),
|
||||||
pubkey_letter( pk->pubkey_algo ),
|
pubkey_letter( pk->pubkey_algo ),
|
||||||
(ulong)keyid_from_pk(pk,NULL),
|
(ulong)keyid_from_pk(pk,NULL),
|
||||||
@ -2375,7 +2377,7 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock, int sensitive )
|
|||||||
|
|
||||||
keyid_from_pk(revoker_pk,keyid);
|
keyid_from_pk(revoker_pk,keyid);
|
||||||
|
|
||||||
tty_printf("\npub %4u%c/%08lX %s ",
|
tty_printf("\npub %4u%c/%08lX %s ",
|
||||||
nbits_from_pk( revoker_pk ),
|
nbits_from_pk( revoker_pk ),
|
||||||
pubkey_letter( revoker_pk->pubkey_algo ),
|
pubkey_letter( revoker_pk->pubkey_algo ),
|
||||||
(ulong)keyid[1], datestr_from_pk(pk) );
|
(ulong)keyid[1], datestr_from_pk(pk) );
|
||||||
|
@ -476,7 +476,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque )
|
|||||||
pk = node->pkt->pkt.public_key;
|
pk = node->pkt->pkt.public_key;
|
||||||
sk = NULL;
|
sk = NULL;
|
||||||
keyid_from_pk( pk, keyid );
|
keyid_from_pk( pk, keyid );
|
||||||
printf("pub %4u%c/%08lX %s ", nbits_from_pk( pk ),
|
printf("pub %4u%c/%08lX %s ", nbits_from_pk( pk ),
|
||||||
pubkey_letter( pk->pubkey_algo ),
|
pubkey_letter( pk->pubkey_algo ),
|
||||||
(ulong)keyid[1],
|
(ulong)keyid[1],
|
||||||
datestr_from_pk( pk ) );
|
datestr_from_pk( pk ) );
|
||||||
@ -528,7 +528,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque )
|
|||||||
}
|
}
|
||||||
|
|
||||||
keyid_from_pk( pk2, keyid2 );
|
keyid_from_pk( pk2, keyid2 );
|
||||||
printf("sub %4u%c/%08lX %s", nbits_from_pk( pk2 ),
|
printf("sub %4u%c/%08lX %s", nbits_from_pk( pk2 ),
|
||||||
pubkey_letter( pk2->pubkey_algo ),
|
pubkey_letter( pk2->pubkey_algo ),
|
||||||
(ulong)keyid2[1],
|
(ulong)keyid2[1],
|
||||||
datestr_from_pk( pk2 ) );
|
datestr_from_pk( pk2 ) );
|
||||||
@ -620,7 +620,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque )
|
|||||||
}
|
}
|
||||||
|
|
||||||
fputs( sigstr, stdout );
|
fputs( sigstr, stdout );
|
||||||
printf("%c%c %c%c%c%c%c %08lX %s ",
|
printf("%c%c %c%c%c%c%c%c %08lX %s ",
|
||||||
sigrc,(sig->sig_class-0x10>0 &&
|
sigrc,(sig->sig_class-0x10>0 &&
|
||||||
sig->sig_class-0x10<4)?'0'+sig->sig_class-0x10:' ',
|
sig->sig_class-0x10<4)?'0'+sig->sig_class-0x10:' ',
|
||||||
sig->flags.exportable?' ':'L',
|
sig->flags.exportable?' ':'L',
|
||||||
@ -628,6 +628,8 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque )
|
|||||||
sig->flags.policy_url?'P':' ',
|
sig->flags.policy_url?'P':' ',
|
||||||
sig->flags.notation?'N':' ',
|
sig->flags.notation?'N':' ',
|
||||||
sig->flags.expired?'X':' ',
|
sig->flags.expired?'X':' ',
|
||||||
|
(sig->trust_depth>9)?'T':
|
||||||
|
(sig->trust_depth>0)?'0'+sig->trust_depth:' ',
|
||||||
(ulong)sig->keyid[1], datestr_from_sig(sig));
|
(ulong)sig->keyid[1], datestr_from_sig(sig));
|
||||||
if( sigrc == '%' )
|
if( sigrc == '%' )
|
||||||
printf("[%s] ", g10_errstr(rc) );
|
printf("[%s] ", g10_errstr(rc) );
|
||||||
@ -1073,11 +1075,11 @@ print_fingerprint (PKT_public_key *pk, PKT_secret_key *sk, int mode )
|
|||||||
}
|
}
|
||||||
else if (mode == 3) {
|
else if (mode == 3) {
|
||||||
fp = NULL; /* use tty */
|
fp = NULL; /* use tty */
|
||||||
text = _(" Key fingerprint =");
|
text = _(" Key fingerprint =");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fp = stdout;
|
fp = stdout;
|
||||||
text = _(" Key fingerprint =");
|
text = _(" Key fingerprint =");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sk)
|
if (sk)
|
||||||
|
@ -140,6 +140,9 @@ typedef struct {
|
|||||||
byte pubkey_algo; /* algorithm used for public key scheme */
|
byte pubkey_algo; /* algorithm used for public key scheme */
|
||||||
/* (PUBKEY_ALGO_xxx) */
|
/* (PUBKEY_ALGO_xxx) */
|
||||||
byte digest_algo; /* algorithm used for digest (DIGEST_ALGO_xxxx) */
|
byte digest_algo; /* algorithm used for digest (DIGEST_ALGO_xxxx) */
|
||||||
|
byte trust_depth;
|
||||||
|
byte trust_value;
|
||||||
|
const byte *trust_regexp;
|
||||||
struct revocation_key **revkey;
|
struct revocation_key **revkey;
|
||||||
int numrevkeys;
|
int numrevkeys;
|
||||||
subpktarea_t *hashed; /* all subpackets with hashed data (v4 only) */
|
subpktarea_t *hashed; /* all subpackets with hashed data (v4 only) */
|
||||||
|
@ -778,13 +778,13 @@ dump_sig_subpkt( int hashed, int type, int critical,
|
|||||||
break;
|
break;
|
||||||
case SIGSUBPKT_TRUST:
|
case SIGSUBPKT_TRUST:
|
||||||
if(length!=2)
|
if(length!=2)
|
||||||
p="[invalid trust signature]";
|
p="[invalid trust subpacket]";
|
||||||
else
|
else
|
||||||
printf("trust signature of level %d, amount %d",buffer[0],buffer[1]);
|
printf("trust signature of depth %d, amount %d",buffer[0],buffer[1]);
|
||||||
break;
|
break;
|
||||||
case SIGSUBPKT_REGEXP:
|
case SIGSUBPKT_REGEXP:
|
||||||
if(!length)
|
if(!length)
|
||||||
p="[invalid regexp]";
|
p="[invalid regexp subpacket]";
|
||||||
else
|
else
|
||||||
printf("regular expression: \"%s\"",buffer);
|
printf("regular expression: \"%s\"",buffer);
|
||||||
break;
|
break;
|
||||||
@ -933,6 +933,7 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
|
|||||||
case SIGSUBPKT_PREF_COMPR:
|
case SIGSUBPKT_PREF_COMPR:
|
||||||
case SIGSUBPKT_POLICY:
|
case SIGSUBPKT_POLICY:
|
||||||
case SIGSUBPKT_FEATURES:
|
case SIGSUBPKT_FEATURES:
|
||||||
|
case SIGSUBPKT_REGEXP:
|
||||||
return 0;
|
return 0;
|
||||||
case SIGSUBPKT_EXPORTABLE:
|
case SIGSUBPKT_EXPORTABLE:
|
||||||
case SIGSUBPKT_REVOCABLE:
|
case SIGSUBPKT_REVOCABLE:
|
||||||
@ -955,6 +956,10 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
|
|||||||
if ( n != 1 )
|
if ( n != 1 )
|
||||||
break;
|
break;
|
||||||
return 0;
|
return 0;
|
||||||
|
case SIGSUBPKT_TRUST:
|
||||||
|
if ( n != 2 )
|
||||||
|
break;
|
||||||
|
return 0;
|
||||||
case SIGSUBPKT_PRIV_VERIFY_CACHE:
|
case SIGSUBPKT_PRIV_VERIFY_CACHE:
|
||||||
/* We used this in gpg 1.0.5 and 1.0.6 to cache signature
|
/* We used this in gpg 1.0.5 and 1.0.6 to cache signature
|
||||||
* verification results - it is no longer used.
|
* verification results - it is no longer used.
|
||||||
@ -1247,6 +1252,7 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||||||
|
|
||||||
if( is_v4 && sig->pubkey_algo ) { /*extract required information */
|
if( is_v4 && sig->pubkey_algo ) { /*extract required information */
|
||||||
const byte *p;
|
const byte *p;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
/* set sig->flags.unknown_critical if there is a
|
/* set sig->flags.unknown_critical if there is a
|
||||||
* critical bit set for packets which we do not understand */
|
* critical bit set for packets which we do not understand */
|
||||||
@ -1288,6 +1294,21 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||||||
if(p && *p==0)
|
if(p && *p==0)
|
||||||
sig->flags.revocable=0;
|
sig->flags.revocable=0;
|
||||||
|
|
||||||
|
p=parse_sig_subpkt(sig->hashed,SIGSUBPKT_TRUST,&len);
|
||||||
|
if(p && len==2)
|
||||||
|
{
|
||||||
|
sig->trust_depth=p[0];
|
||||||
|
sig->trust_value=p[1];
|
||||||
|
|
||||||
|
sig->trust_regexp=
|
||||||
|
parse_sig_subpkt(sig->hashed,SIGSUBPKT_REGEXP,&len);
|
||||||
|
|
||||||
|
/* If the regular expression is of 0 length, there is no
|
||||||
|
regular expression. */
|
||||||
|
if(len==0)
|
||||||
|
sig->trust_regexp=NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* We accept the exportable subpacket from either the hashed
|
/* We accept the exportable subpacket from either the hashed
|
||||||
or unhashed areas as older versions of gpg put it in the
|
or unhashed areas as older versions of gpg put it in the
|
||||||
unhashed area. In theory, anyway, we should never see this
|
unhashed area. In theory, anyway, we should never see this
|
||||||
|
@ -1197,6 +1197,7 @@ tdbio_read_record( ulong recnum, TRUSTREC *rec, int expected )
|
|||||||
rec->r.trust.depth = *p++;
|
rec->r.trust.depth = *p++;
|
||||||
p += 2;
|
p += 2;
|
||||||
rec->r.trust.validlist = buftoulong(p); p += 4;
|
rec->r.trust.validlist = buftoulong(p); p += 4;
|
||||||
|
rec->r.trust.min_ownertrust = *p++;
|
||||||
break;
|
break;
|
||||||
case RECTYPE_VALID:
|
case RECTYPE_VALID:
|
||||||
memcpy( rec->r.valid.namehash, p, 20); p+=20;
|
memcpy( rec->r.valid.namehash, p, 20); p+=20;
|
||||||
@ -1275,6 +1276,7 @@ tdbio_write_record( TRUSTREC *rec )
|
|||||||
*p++ = rec->r.trust.depth;
|
*p++ = rec->r.trust.depth;
|
||||||
p += 2;
|
p += 2;
|
||||||
ulongtobuf( p, rec->r.trust.validlist); p += 4;
|
ulongtobuf( p, rec->r.trust.validlist); p += 4;
|
||||||
|
*p++ = rec->r.trust.min_ownertrust;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECTYPE_VALID:
|
case RECTYPE_VALID:
|
||||||
|
@ -77,6 +77,7 @@ struct trust_record {
|
|||||||
byte ownertrust;
|
byte ownertrust;
|
||||||
byte depth;
|
byte depth;
|
||||||
ulong validlist;
|
ulong validlist;
|
||||||
|
byte min_ownertrust;
|
||||||
} trust;
|
} trust;
|
||||||
struct {
|
struct {
|
||||||
byte namehash[20];
|
byte namehash[20];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user