Module Name:    src
Committed By:   agc
Date:           Thu Nov  1 01:35:35 UTC 2012

Modified Files:
        src/crypto/external/bsd/netpgp/dist/src/libverify 
[agc-netpgp-standalone]:
            libverify.c verify.h

Log Message:
display revoked userids, and particularly, compromised and revoked userids


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 \
    src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 \
    src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.10 src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.11
--- src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.10	Tue Oct 30 02:10:42 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c	Thu Nov  1 01:35:35 2012
@@ -1237,6 +1237,9 @@ recog_userid(pgpv_t *pgp, pgpv_signed_us
 		if (signature.primary_userid) {
 			userid->primary_userid = signature.primary_userid;
 		}
+		if (signature.revoked) {
+			userid->revoked = signature.revoked;
+		}
 	}
 	return 1;
 }
@@ -1260,6 +1263,9 @@ recog_userattr(pgpv_t *pgp, pgpv_signed_
 			return 0;
 		}
 		ARRAY_APPEND(userattr->sigs, signature);
+		if (signature.revoked) {
+			userattr->revoked = signature.revoked;
+		}
 	}
 	return 1;
 }
@@ -1361,6 +1367,9 @@ fmt_pubkey(char *s, size_t size, pgpv_pu
 	return cc;
 }
 
+/* we add 1 to revocation value to denote compromised */
+#define COMPROMISED	(0x02 + 1)
+
 /* format a userid - used to order the userids when formatting */
 static size_t
 fmt_userid(char *s, size_t size, pgpv_primarykey_t *primary, uint8_t u)
@@ -1368,8 +1377,10 @@ fmt_userid(char *s, size_t size, pgpv_pr
 	pgpv_signed_userid_t	*userid;
 
 	userid = &ARRAY_ELEMENT(primary->signed_userids, u);
-	return snprintf(s, size, "uid              %.*s\n",
-			(int)userid->userid.size, userid->userid.data);
+	return snprintf(s, size, "uid              %.*s%s\n",
+			(int)userid->userid.size, userid->userid.data,
+			(userid->revoked == COMPROMISED) ? " [COMPROMISED AND REVOKED]" :
+			(userid->revoked) ? " [REVOKED]" : "");
 }
 
 /* print a primary key, per RFC 4880 */
@@ -1919,6 +1930,7 @@ recog_primary_key(pgpv_t *pgp, pgpv_prim
 			/* XXX - check it's a good key expiry */
 			primary->primary.expiry = signature.keyexpiry;
 		}
+if (signature.revoked) fprintf(stderr, "agc - revoked1\n");
 		ARRAY_APPEND(primary->direct_sigs, signature);
 	}
 	/* some keys out there have user ids where they shouldn't */

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h:1.1.2.9 src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h:1.1.2.10
--- src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h:1.1.2.9	Tue Oct 30 02:10:42 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h	Thu Nov  1 01:35:35 2012
@@ -211,11 +211,13 @@ typedef struct pgpv_signed_userid_t {
 	pgpv_string_t	 	 userid;
 	PGPV_ARRAY(pgpv_signature_t, sigs);
 	uint8_t			 primary_userid;
+	uint8_t			 revoked;
 } pgpv_signed_userid_t;
 
 typedef struct pgpv_signed_userattr_t {
 	pgpv_userattr_t	 	 userattr;
 	PGPV_ARRAY(pgpv_signature_t, sigs);
+	uint8_t			 revoked;
 } pgpv_signed_userattr_t;
 
 typedef struct pgpv_signed_subkey_t {

Reply via email to