Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/agc-netpgp-standalone]: src/crypto/external/bsd/netpgp/dist/src/libverif...



details:   https://anonhg.NetBSD.org/src/rev/f354ce025fac
branches:  agc-netpgp-standalone
changeset: 777830:f354ce025fac
user:      agc <agc%NetBSD.org@localhost>
date:      Thu Nov 01 01:35:35 2012 +0000

description:
display revoked userids, and particularly, compromised and revoked userids

diffstat:

 crypto/external/bsd/netpgp/dist/src/libverify/libverify.c |  16 +++++++++++++-
 crypto/external/bsd/netpgp/dist/src/libverify/verify.h    |   2 +
 2 files changed, 16 insertions(+), 2 deletions(-)

diffs (71 lines):

diff -r a66284f67d69 -r f354ce025fac crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
--- a/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c Tue Oct 30 02:10:42 2012 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c Thu Nov 01 01:35:35 2012 +0000
@@ -1237,6 +1237,9 @@
                if (signature.primary_userid) {
                        userid->primary_userid = signature.primary_userid;
                }
+               if (signature.revoked) {
+                       userid->revoked = signature.revoked;
+               }
        }
        return 1;
 }
@@ -1260,6 +1263,9 @@
                        return 0;
                }
                ARRAY_APPEND(userattr->sigs, signature);
+               if (signature.revoked) {
+                       userattr->revoked = signature.revoked;
+               }
        }
        return 1;
 }
@@ -1361,6 +1367,9 @@
        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 @@
        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 @@
                        /* 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 */
diff -r a66284f67d69 -r f354ce025fac crypto/external/bsd/netpgp/dist/src/libverify/verify.h
--- a/crypto/external/bsd/netpgp/dist/src/libverify/verify.h    Tue Oct 30 02:10:42 2012 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/libverify/verify.h    Thu Nov 01 01:35:35 2012 +0000
@@ -211,11 +211,13 @@
        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 {



Home | Main Index | Thread Index | Old Index