From 33783a41a449ede7b37697910ffafbb0c27730a5 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Tue, 3 Dec 2002 18:10:10 +0000 Subject: [PATCH] * main.h, keylist.c (reorder_keyblock), keyedit.c (keyedit_menu): Reorder user ID display in the --edit-key menu to match that of the --list-keys display. * tdbio.c (tdbio_read_record, tdbio_write_record): Comments to reserve a byte for trust model in the devel version. * g10.c (add_notation_data): Fix initialization. --- g10/ChangeLog | 13 ++++++++++++- g10/g10.c | 2 +- g10/keyedit.c | 1 + g10/keylist.c | 2 +- g10/main.h | 1 + g10/tdbio.c | 10 ++++++++-- 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index ca52ac697..65cc5314c 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,14 @@ +2002-12-03 David Shaw + + * main.h, keylist.c (reorder_keyblock), keyedit.c (keyedit_menu): + Reorder user ID display in the --edit-key menu to match that of + the --list-keys display. + + * tdbio.c (tdbio_read_record, tdbio_write_record): Comments to + reserve a byte for trust model in the devel version. + + * g10.c (add_notation_data): Fix initialization. + 2002-12-01 David Shaw * keyedit.c (menu_expire): Don't lose key flags when changing the @@ -10,7 +21,7 @@ (keygen_copy_flags_add_expire): New version of keygen_add_key_expire that also copies key flags. (keygen_add_key_flags_and_expire): Use do_add_key_expire. - + * import.c (fix_hkp_corruption): Comment. 2002-11-23 David Shaw diff --git a/g10/g10.c b/g10/g10.c index 6f088b4ae..7fd00125f 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -2723,7 +2723,7 @@ add_notation_data( const char *string, int which ) for( s=string ; *s != '='; s++ ) { if( *s=='@') - saw_at=0; + saw_at=1; if( !*s || (*s & 0x80) || (!isgraph(*s) && !isspace(*s)) ) { diff --git a/g10/keyedit.c b/g10/keyedit.c index f21906e05..5d9a8d775 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -980,6 +980,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands, modified++; if( collapse_uids( &keyblock ) ) modified++; + reorder_keyblock(keyblock); if( !sign_mode ) {/* see whether we have a matching secret key */ PKT_public_key *pk = keyblock->pkt->pkt.public_key; diff --git a/g10/keylist.c b/g10/keylist.c index d6569bed8..60363e743 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -911,7 +911,7 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr ) * Reorder the keyblock so that the primary user ID (and not attribute * packet) comes first. Fixme: Replace this by a generic sort * function. */ -static void +void reorder_keyblock (KBNODE keyblock) { KBNODE primary = NULL, primary0 = NULL, primary2 = NULL; diff --git a/g10/main.h b/g10/main.h index 5584e8655..f355e8e92 100644 --- a/g10/main.h +++ b/g10/main.h @@ -199,6 +199,7 @@ void release_revocation_reason_info( struct revocation_reason_info *reason ); /*-- keylist.c --*/ void public_key_list( STRLIST list ); void secret_key_list( STRLIST list ); +void reorder_keyblock (KBNODE keyblock); void list_keyblock( KBNODE keyblock, int secret, int fpr, void *opaque ); void print_fingerprint (PKT_public_key *pk, PKT_secret_key *sk, int mode); void show_policy_url(PKT_signature *sig,int indent); diff --git a/g10/tdbio.c b/g10/tdbio.c index a01680c8b..7fdab5213 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -427,8 +427,8 @@ create_version_record (void) memset( &rec, 0, sizeof rec ); rec.r.ver.version = 3; rec.r.ver.created = make_timestamp(); - rec.r.ver.marginals = opt.marginals_needed; - rec.r.ver.completes = opt.completes_needed; + rec.r.ver.marginals = opt.marginals_needed; + rec.r.ver.completes = opt.completes_needed; rec.r.ver.cert_depth = opt.max_cert_depth; rec.rectype = RECTYPE_VER; rec.recnum = 0; @@ -1158,6 +1158,9 @@ tdbio_read_record( ulong recnum, TRUSTREC *rec, int expected ) rec->r.ver.marginals = *p++; rec->r.ver.completes = *p++; rec->r.ver.cert_depth = *p++; + /* Warning - one byte of this is used in the devel version. + If you change this, make sure to consult the same code in + devel. */ p += 4; /* lock flags */ rec->r.ver.created = buftoulong(p); p += 4; rec->r.ver.nextcheck = buftoulong(p); p += 4; @@ -1241,6 +1244,9 @@ tdbio_write_record( TRUSTREC *rec ) *p++ = rec->r.ver.marginals; *p++ = rec->r.ver.completes; *p++ = rec->r.ver.cert_depth; + /* Warning - one byte of this is used in the devel version. + If you change this, make sure to consult the same code in + devel. */ p += 4; /* skip lock flags */ ulongtobuf(p, rec->r.ver.created); p += 4; ulongtobuf(p, rec->r.ver.nextcheck); p += 4;