aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-01-03 00:40:20 +0000
committerDavid Shaw <[email protected]>2003-01-03 00:40:20 +0000
commit2d5091e4e343fd95ae9b834a6de210a095f6a0c2 (patch)
treecba536a73052b732c52b51a13f30b3a7a0270b73
parent* keydb.c (keydb_add_resource): Don't assume that try_make_homedir (diff)
downloadgnupg-2d5091e4e343fd95ae9b834a6de210a095f6a0c2.tar.gz
gnupg-2d5091e4e343fd95ae9b834a6de210a095f6a0c2.zip
* getkey.c (merge_selfsigs_main): Remove some unused code and make sure
that the pk selfsigversion member accounts for 1F direct sigs. * keyring.c (keyring_search): skipfnc didn't work properly with non-keyid searches. Noted by Stefan Bellon.
-rw-r--r--g10/ChangeLog9
-rw-r--r--g10/getkey.c20
-rw-r--r--g10/keyring.c2
3 files changed, 22 insertions, 9 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index f43d97a5d..90c90258f 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,12 @@
+2003-01-02 David Shaw <[email protected]>
+
+ * getkey.c (merge_selfsigs_main): Remove some unused code and make
+ sure that the pk selfsigversion member accounts for 1F direct
+ sigs.
+
+ * keyring.c (keyring_search): skipfnc didn't work properly with
+ non-keyid searches. Noted by Stefan Bellon.
+
2003-01-02 Werner Koch <[email protected]>
* keydb.c (keydb_add_resource): Don't assume that try_make_homedir
diff --git a/g10/getkey.c b/g10/getkey.c
index 420f35dc6..e4a5053f1 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1319,7 +1319,7 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
PKT_public_key *pk = NULL;
KBNODE k;
u32 kid[2];
- u32 sigdate = 0, uiddate=0, uiddate2;
+ u32 sigdate, uiddate, uiddate2;
KBNODE signode, uidnode, uidnode2;
u32 curtime = make_timestamp ();
unsigned int key_usage = 0;
@@ -1402,7 +1402,8 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
else {
sigdate = sig->timestamp;
signode = k;
- sigversion = sig->version;
+ if( sig->version > sigversion )
+ sigversion = sig->version;
}
}
@@ -1500,7 +1501,6 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
/* second pass: look at the self-signature of all user IDs */
signode = uidnode = NULL;
sigdate = 0; /* helper to find the latest signature in one user ID */
- uiddate = 0; /* and over of all user IDs */
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY; k = k->next ) {
if ( k->pkt->pkttype == PKT_USER_ID ) {
if ( uidnode && signode )
@@ -1510,8 +1510,6 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
}
uidnode = k;
signode = NULL;
- if ( sigdate > uiddate )
- uiddate = sigdate;
sigdate = 0;
}
else if ( k->pkt->pkttype == PKT_SIGNATURE && uidnode ) {
@@ -1601,9 +1599,15 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
}
}
- /* Record the highest selfsigversion so we know if this is a v3
- key through and through, or a v3 key with a v4 selfsig, which
- means we can trust the preferences (if any). */
+ /* Record the highest selfsig version so we know if this is a v3
+ key through and through, or a v3 key with a v4 selfsig
+ somewhere. This is useful in a few places to know if the key
+ must be treated as PGP2-style or OpenPGP-style. Note that a
+ selfsig revocation with a higher version number will also raise
+ this value. This is okay since such a revocation must be
+ issued by the user (i.e. it cannot be issued by someone else to
+ modify the key behavior.) */
+
pk->selfsigversion=sigversion;
/* Now that we had a look at all user IDs we can now get some information
diff --git a/g10/keyring.c b/g10/keyring.c
index b084aa8af..70386eef2 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -861,6 +861,7 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc)
PKT_user_id *uid = NULL;
PKT_public_key *pk = NULL;
PKT_secret_key *sk = NULL;
+ u32 aki[2];
/* figure out what information we need */
need_uid = need_words = need_keyid = need_fpr = any_skip = 0;
@@ -963,7 +964,6 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc)
{
byte afp[MAX_FINGERPRINT_LEN];
size_t an;
- u32 aki[2];
if (pkt.pkttype == PKT_PUBLIC_KEY || pkt.pkttype == PKT_SECRET_KEY)
{