aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-10-04 22:12:09 +0000
committerDavid Shaw <[email protected]>2002-10-04 22:12:09 +0000
commit1fed5c87f0e792599b6d71fad908f60b27b6446b (patch)
tree30bc39c743f89d4c93ae67cdc01ff5ffc71fd6e0
parent* import.c (import_keys_internal): s/inp/inp2/ to avoid shadowing (diff)
downloadgnupg-1fed5c87f0e792599b6d71fad908f60b27b6446b.tar.gz
gnupg-1fed5c87f0e792599b6d71fad908f60b27b6446b.zip
* getkey.c (get_pubkey_direct): Don't cache keys retrieved via this
function as they may not have all their fields filled in. * sig-check.c (signature_check2): Use new is_primary flag to check rather than comparing main_keyid with keyid as this still works in the case of a not fully filled in pk.
-rw-r--r--g10/ChangeLog9
-rw-r--r--g10/getkey.c5
-rw-r--r--g10/sig-check.c4
3 files changed, 14 insertions, 4 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index de855dc1b..aebc00d61 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,12 @@
+2002-10-04 David Shaw <[email protected]>
+
+ * getkey.c (get_pubkey_direct): Don't cache keys retrieved via
+ this function as they may not have all their fields filled in.
+
+ * sig-check.c (signature_check2): Use new is_primary flag to check
+ rather than comparing main_keyid with keyid as this still works in
+ the case of a not fully filled in pk.
+
2002-10-04 Werner Koch <[email protected]>
* import.c (import_keys_internal): s/inp/inp2/ to avoid shadowing
diff --git a/g10/getkey.c b/g10/getkey.c
index a123f5fdd..991b98d2f 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -417,7 +417,10 @@ get_pubkey_direct (PKT_public_key *pk, u32 *keyid)
|| keyblock->pkt->pkttype == PKT_PUBLIC_SUBKEY );
copy_public_key (pk, keyblock->pkt->pkt.public_key );
release_kbnode (keyblock);
- cache_public_key (pk);
+
+ /* Not caching key here since it won't have all of the fields
+ properly set. */
+
return 0;
}
diff --git a/g10/sig-check.c b/g10/sig-check.c
index 2b3c6472c..c068e4409 100644
--- a/g10/sig-check.c
+++ b/g10/sig-check.c
@@ -75,9 +75,7 @@ signature_check2( PKT_signature *sig, MD_HANDLE digest,
}
else if( get_pubkey( pk, sig->keyid ) )
rc = G10ERR_NO_PUBKEY;
- else if(!pk->is_valid &&
- (pk->main_keyid[0]!=pk->keyid[0] ||
- pk->main_keyid[1]!=pk->keyid[1]))
+ else if(!pk->is_valid && !pk->is_primary)
rc=G10ERR_BAD_PUBKEY; /* you cannot have a good sig from an
invalid subkey */
else {