Source-Changes-HG archive

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

[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/lib re-order the fields ...



details:   https://anonhg.NetBSD.org/src/rev/a90193258538
branches:  trunk
changeset: 777530:a90193258538
user:      agc <agc%NetBSD.org@localhost>
date:      Wed Feb 22 06:29:40 2012 +0000

description:
re-order the fields that we print out in the pgp_sprint_pubkey() function
to be more usual.

print out the name from within pgp_sprint_pubkey() rather than tagging it
onto the end of the output from the function.

diffstat:

 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c       |   4 +---
 crypto/external/bsd/netpgp/dist/src/lib/packet-print.c |  13 +++++++------
 2 files changed, 8 insertions(+), 9 deletions(-)

diffs (71 lines):

diff -r 2a6633bb5c2c -r a90193258538 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Wed Feb 22 00:15:57 2012 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Wed Feb 22 06:29:40 2012 +0000
@@ -34,7 +34,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.94 2011/08/02 07:16:56 agc Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.95 2012/02/22 06:29:40 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -1091,8 +1091,6 @@
                        ALLOC(char *, pubs.v, pubs.size, pubs.c, 10, 10,
                                        "netpgp_match_pubkeys", return 0);
                        cc = pgp_sprint_pubkey(key, out, sizeof(out));
-                       (void) snprintf(&out[cc], sizeof(out) - cc, "name=%s\n",
-                               key->uids[0]);
                        pubs.v[pubs.c++] = netpgp_strdup(out);
                        k += 1;
                }
diff -r 2a6633bb5c2c -r a90193258538 crypto/external/bsd/netpgp/dist/src/lib/packet-print.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/packet-print.c    Wed Feb 22 00:15:57 2012 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/packet-print.c    Wed Feb 22 06:29:40 2012 +0000
@@ -58,7 +58,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: packet-print.c,v 1.41 2011/06/25 00:37:44 agc Exp $");
+__RCSID("$NetBSD: packet-print.c,v 1.42 2012/02/22 06:29:40 agc Exp $");
 #endif
 
 #include <string.h>
@@ -688,16 +688,17 @@
        char    fp[(PGP_FINGERPRINT_SIZE * 3) + 1];
        int     cc;
 
-       cc = snprintf(out, outsize, "key:%s:%d:%lld:%lld:%d:\n",
+       cc = snprintf(out, outsize, "key=%s\nname=%s\ncreation=%lld\nexpiry=%lld\nversion=%d\nalg=%d\n",
                strhexdump(fp, key->sigfingerprint.fingerprint, PGP_FINGERPRINT_SIZE, ""),
-               key->key.pubkey.version,
+               key->uids[key->uid0],
                (long long)key->key.pubkey.birthtime,
                (long long)key->key.pubkey.days_valid,
+               key->key.pubkey.version,
                key->key.pubkey.alg);
        switch (key->key.pubkey.alg) {
        case PGP_PKA_DSA:
                cc += snprintf(&out[cc], outsize - cc,
-                       "pubkey:p=%s:q=%s:g=%s:y=%s\n",
+                       "p=%s\nq=%s\ng=%s\ny=%s\n",
                        BN_bn2hex(key->key.pubkey.key.dsa.p),
                        BN_bn2hex(key->key.pubkey.key.dsa.q),
                        BN_bn2hex(key->key.pubkey.key.dsa.g),
@@ -707,14 +708,14 @@
        case PGP_PKA_RSA_ENCRYPT_ONLY:
        case PGP_PKA_RSA_SIGN_ONLY:
                cc += snprintf(&out[cc], outsize - cc,
-                       "pubkey:n=%s:e=%s\n",
+                       "n=%s\ne=%s\n",
                        BN_bn2hex(key->key.pubkey.key.rsa.n),
                        BN_bn2hex(key->key.pubkey.key.rsa.e));
                break;
        case PGP_PKA_ELGAMAL:
        case PGP_PKA_ELGAMAL_ENCRYPT_OR_SIGN:
                cc += snprintf(&out[cc], outsize - cc,
-                       "pubkey:p=%s:g=%s:y=%s\n",
+                       "p=%s\ng=%s\ny=%s\n",
                        BN_bn2hex(key->key.pubkey.key.elgamal.p),
                        BN_bn2hex(key->key.pubkey.key.elgamal.g),
                        BN_bn2hex(key->key.pubkey.key.elgamal.y));



Home | Main Index | Thread Index | Old Index