mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
(oops) The rest of the fix from previous checkin.
This commit is contained in:
parent
63246fe693
commit
041d99295a
@ -110,7 +110,7 @@ int sign_symencrypt_file (const char *fname, STRLIST locusr);
|
|||||||
/*-- sig-check.c --*/
|
/*-- sig-check.c --*/
|
||||||
int check_revocation_keys (PKT_public_key *pk, PKT_signature *sig);
|
int check_revocation_keys (PKT_public_key *pk, PKT_signature *sig);
|
||||||
int check_key_signature( KBNODE root, KBNODE node, int *is_selfsig );
|
int check_key_signature( KBNODE root, KBNODE node, int *is_selfsig );
|
||||||
int check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *pk,
|
int check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *check_pk,
|
||||||
int *is_selfsig, u32 *r_expiredate, int *r_expired );
|
int *is_selfsig, u32 *r_expiredate, int *r_expired );
|
||||||
|
|
||||||
/*-- delkey.c --*/
|
/*-- delkey.c --*/
|
||||||
|
@ -478,13 +478,14 @@ check_key_signature( KBNODE root, KBNODE node, int *is_selfsig )
|
|||||||
return check_key_signature2(root, node, NULL, is_selfsig, &dummy, &dum2 );
|
return check_key_signature2(root, node, NULL, is_selfsig, &dummy, &dum2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If pk is NULL, then it is set from ROOT. Note that is_selfsig is
|
/* If check_pk is set, then use it to check the signature in node
|
||||||
set from the pk. */
|
rather than getting it from root or the keydb. */
|
||||||
int
|
int
|
||||||
check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *pk,
|
check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *check_pk,
|
||||||
int *is_selfsig, u32 *r_expiredate, int *r_expired )
|
int *is_selfsig, u32 *r_expiredate, int *r_expired )
|
||||||
{
|
{
|
||||||
MD_HANDLE md;
|
MD_HANDLE md;
|
||||||
|
PKT_public_key *pk;
|
||||||
PKT_signature *sig;
|
PKT_signature *sig;
|
||||||
int algo;
|
int algo;
|
||||||
int rc;
|
int rc;
|
||||||
@ -496,9 +497,7 @@ check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *pk,
|
|||||||
assert( node->pkt->pkttype == PKT_SIGNATURE );
|
assert( node->pkt->pkttype == PKT_SIGNATURE );
|
||||||
assert( root->pkt->pkttype == PKT_PUBLIC_KEY );
|
assert( root->pkt->pkttype == PKT_PUBLIC_KEY );
|
||||||
|
|
||||||
if(pk==NULL)
|
|
||||||
pk = root->pkt->pkt.public_key;
|
pk = root->pkt->pkt.public_key;
|
||||||
|
|
||||||
sig = node->pkt->pkt.signature;
|
sig = node->pkt->pkt.signature;
|
||||||
algo = sig->digest_algo;
|
algo = sig->digest_algo;
|
||||||
|
|
||||||
@ -598,14 +597,17 @@ check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *pk,
|
|||||||
md = md_open( algo, 0 );
|
md = md_open( algo, 0 );
|
||||||
hash_public_key( md, pk );
|
hash_public_key( md, pk );
|
||||||
hash_uid_node( unode, md, sig );
|
hash_uid_node( unode, md, sig );
|
||||||
if( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1] ) {
|
if( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1] )
|
||||||
|
{
|
||||||
if( is_selfsig )
|
if( is_selfsig )
|
||||||
*is_selfsig = 1;
|
*is_selfsig = 1;
|
||||||
rc = do_check( pk, sig, md, r_expired );
|
rc = do_check( pk, sig, md, r_expired );
|
||||||
}
|
}
|
||||||
else {
|
else if (check_pk)
|
||||||
|
rc=do_check(check_pk,sig,md,r_expired);
|
||||||
|
else
|
||||||
rc = signature_check2( sig, md, r_expiredate, r_expired );
|
rc = signature_check2( sig, md, r_expiredate, r_expired );
|
||||||
}
|
|
||||||
cache_sig_result ( sig, rc );
|
cache_sig_result ( sig, rc );
|
||||||
md_close(md);
|
md_close(md);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user