gnupg/g10 (ChangeLog getkey.c keyedit.c keyid.c packet.h)
cvs user dshaw
cvs at cvs.gnupg.org
Thu Dec 30 04:21:11 CET 2004
Date: Thursday, December 30, 2004 @ 04:26:57
Author: dshaw
Path: /cvs/gnupg/gnupg/g10
Modified: ChangeLog getkey.c keyedit.c keyid.c packet.h
* packet.h, getkey.c (merge_selfsigs_main, sig_to_revoke_info), keyid.c
(revokestr_from_pk), keyedit.c (show_key_with_all_names): Show who revoked
a key (either the same key or a designated revoker) and when.
-----------+
ChangeLog | 7 +++++++
getkey.c | 26 ++++++++++++++++++--------
keyedit.c | 9 +++++++++
keyid.c | 4 ++--
packet.h | 11 ++++++++++-
5 files changed, 46 insertions(+), 11 deletions(-)
Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.673 gnupg/g10/ChangeLog:1.674
--- gnupg/g10/ChangeLog:1.673 Tue Dec 28 08:30:57 2004
+++ gnupg/g10/ChangeLog Thu Dec 30 04:26:57 2004
@@ -1,3 +1,10 @@
+2004-12-29 David Shaw <dshaw at jabberwocky.com>
+
+ * packet.h, getkey.c (merge_selfsigs_main, sig_to_revoke_info),
+ keyid.c (revokestr_from_pk), keyedit.c (show_key_with_all_names):
+ Show who revoked a key (either the same key or a designated
+ revoker) and when.
+
2004-12-28 Werner Koch <wk at g10code.com>
* ccid-driver.c (find_endpoint): New.
Index: gnupg/g10/getkey.c
diff -u gnupg/g10/getkey.c:1.122 gnupg/g10/getkey.c:1.123
--- gnupg/g10/getkey.c:1.122 Mon Dec 20 06:19:09 2004
+++ gnupg/g10/getkey.c Thu Dec 30 04:26:57 2004
@@ -1387,7 +1387,16 @@
}
static void
-merge_selfsigs_main( KBNODE keyblock, int *r_revoked, u32 *r_revokedate )
+sig_to_revoke_info(PKT_signature *sig,struct revoke_info *rinfo)
+{
+ rinfo->date = sig->timestamp;
+ rinfo->algo = sig->pubkey_algo;
+ rinfo->keyid[0] = sig->keyid[0];
+ rinfo->keyid[1] = sig->keyid[1];
+}
+
+static void
+merge_selfsigs_main(KBNODE keyblock, int *r_revoked, struct revoke_info *rinfo)
{
PKT_public_key *pk = NULL;
KBNODE k;
@@ -1402,7 +1411,8 @@
byte sigversion = 0;
*r_revoked = 0;
- *r_revokedate = 0;
+ memset(rinfo,0,sizeof(*rinfo));
+
if ( keyblock->pkt->pkttype != PKT_PUBLIC_KEY )
BUG ();
pk = keyblock->pkt->pkt.public_key;
@@ -1448,7 +1458,7 @@
* that key.
*/
*r_revoked = 1;
- *r_revokedate = sig->timestamp;
+ sig_to_revoke_info(sig,rinfo);
}
else if ( IS_KEY_SIG (sig) ) {
/* Add any revocation keys onto the pk. This is
@@ -1558,7 +1568,7 @@
if(rc==0)
{
*r_revoked=2;
- *r_revokedate=sig->timestamp;
+ sig_to_revoke_info(sig,rinfo);
/* don't continue checking since we can't be any
more revoked than this */
break;
@@ -1894,7 +1904,7 @@
problem is in the distribution. Plus, PGP (7)
does this the same way. */
subpk->is_revoked = 1;
- subpk->revokedate = sig->timestamp;
+ sig_to_revoke_info(sig,&subpk->revoked);
/* although we could stop now, we continue to
* figure out other information like the old expiration
* time */
@@ -2011,7 +2021,7 @@
{
KBNODE k;
int revoked;
- u32 revokedate;
+ struct revoke_info rinfo;
PKT_public_key *main_pk;
prefitem_t *prefs;
int mdc_feature;
@@ -2028,7 +2038,7 @@
BUG ();
}
- merge_selfsigs_main ( keyblock, &revoked, &revokedate );
+ merge_selfsigs_main ( keyblock, &revoked, &rinfo );
/* now merge in the data from each of the subkeys */
for(k=keyblock; k; k = k->next ) {
@@ -2051,7 +2061,7 @@
if(revoked && !pk->is_revoked)
{
pk->is_revoked = revoked;
- pk->revokedate = revokedate;
+ memcpy(&pk->revoked,&rinfo,sizeof(rinfo));
}
if(main_pk->has_expired)
pk->has_expired = main_pk->has_expired;
Index: gnupg/g10/keyedit.c
diff -u gnupg/g10/keyedit.c:1.166 gnupg/g10/keyedit.c:1.167
--- gnupg/g10/keyedit.c:1.166 Tue Dec 21 16:49:56 2004
+++ gnupg/g10/keyedit.c Thu Dec 30 04:26:57 2004
@@ -2317,6 +2317,15 @@
primary=pk;
}
+ if(pk->is_revoked)
+ {
+ char *user=get_user_id_string_native(pk->revoked.keyid);
+ const char *algo=pubkey_algo_to_string(pk->revoked.algo);
+ tty_printf(_("This key was revoked on %s by %s key %s\n"),
+ revokestr_from_pk(pk),algo?algo:"?",user);
+ m_free(user);
+ }
+
if(with_revoker)
{
if( !pk->revkey && pk->numrevkeys )
Index: gnupg/g10/keyid.c
diff -u gnupg/g10/keyid.c:1.51 gnupg/g10/keyid.c:1.52
--- gnupg/g10/keyid.c:1.51 Thu Sep 23 15:32:30 2004
+++ gnupg/g10/keyid.c Thu Dec 30 04:26:57 2004
@@ -529,9 +529,9 @@
static char buffer[11+5];
time_t atime;
- if(!pk->revokedate)
+ if(!pk->revoked.date)
return _("never ");
- atime=pk->revokedate;
+ atime=pk->revoked.date;
return mk_datestr (buffer, atime);
}
Index: gnupg/g10/packet.h
diff -u gnupg/g10/packet.h:1.92 gnupg/g10/packet.h:1.93
--- gnupg/g10/packet.h:1.92 Fri Apr 23 05:25:57 2004
+++ gnupg/g10/packet.h Thu Dec 30 04:26:57 2004
@@ -186,6 +186,15 @@
char name[1];
} PKT_user_id;
+struct revoke_info
+{
+ /* revoked at this date */
+ u32 date;
+ /* the keyid of the revoking key (selfsig or designated revoker) */
+ u32 keyid[2];
+ /* the algo of the revoking key */
+ byte algo;
+};
/****************
* Note about the pkey/skey elements: We assume that the secret keys
@@ -197,7 +206,7 @@
u32 timestamp; /* key made */
u32 expiredate; /* expires at this date or 0 if not at all */
u32 max_expiredate; /* must not expire past this date */
- u32 revokedate; /* revoked at this date */
+ struct revoke_info revoked;
byte hdrbytes; /* number of header bytes */
byte version;
byte selfsigversion; /* highest version of all of the self-sigs */
More information about the Gnupg-commits
mailing list