mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
This is the first half of revocation key / designated revoker
support. That is, it handles all the data to mark a key as revoked if it has been revoked by a designated revoker. The second half (coming later) will contain the code to make someones key your designated revoker and to issue revocations for someone else. Note that this is written so that a revoked revoker can still issue revocations: i.e. If A revokes B, but A is revoked, B is still revoked. I'm not completely convinced this is the proper behavior, but it matches how PGP does it. It does at least have the advantage of much simpler code - my first version of this had lots of loop maintaining code so you could chain revokers many levels deep and if D was revoked, C was not, which meant that B was, and so on. It was sort of scary, actually. This also changes importing to allow bringing in more revocation keys, and exporting to not export revocation keys marked "sensitive". The --edit menu information will show if a revocation key is present.
This commit is contained in:
parent
6be293e24b
commit
fbc66185f8
9 changed files with 332 additions and 30 deletions
|
@ -922,6 +922,10 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type )
|
|||
if( n < 8 ) /* minimum length needed */
|
||||
break;
|
||||
return 0;
|
||||
case SIGSUBPKT_REV_KEY:
|
||||
if(n < 22)
|
||||
break;
|
||||
return 0;
|
||||
case SIGSUBPKT_REVOC_REASON:
|
||||
if( !n )
|
||||
break;
|
||||
|
@ -969,6 +973,7 @@ can_handle_critical( const byte *buffer, size_t n, int type )
|
|||
case SIGSUBPKT_KEY_EXPIRE:
|
||||
case SIGSUBPKT_EXPORTABLE:
|
||||
case SIGSUBPKT_REVOCABLE:
|
||||
case SIGSUBPKT_REV_KEY:
|
||||
case SIGSUBPKT_ISSUER:/* issuer key ID */
|
||||
case SIGSUBPKT_PREF_SYM:
|
||||
case SIGSUBPKT_PREF_HASH:
|
||||
|
@ -1248,6 +1253,28 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||
p=parse_sig_subpkt2(sig,SIGSUBPKT_EXPORTABLE,NULL);
|
||||
if(p && *p==0)
|
||||
sig->flags.exportable=0;
|
||||
|
||||
/* Find all revokation keys */
|
||||
if(sig->sig_class==0x1F)
|
||||
{
|
||||
struct revocation_key *revkey;
|
||||
int len,seq=0;
|
||||
|
||||
while((revkey=
|
||||
(struct revocation_key *)enum_sig_subpkt(sig->hashed,
|
||||
SIGSUBPKT_REV_KEY,
|
||||
&len,&seq)))
|
||||
{
|
||||
if(len==sizeof(struct revocation_key) &&
|
||||
revkey->class&0x80) /* 0x80 bit must be set */
|
||||
{
|
||||
sig->revkey=m_realloc(sig->revkey,
|
||||
sizeof(struct revocation_key *)*(sig->numrevkeys+1));
|
||||
sig->revkey[sig->numrevkeys]=revkey;
|
||||
sig->numrevkeys++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( list_mode ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue