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 changes to 1.99.18/20100211



details:   https://anonhg.NetBSD.org/src/rev/57a7becfd0c1
branches:  trunk
changeset: 752033:57a7becfd0c1
user:      agc <agc%NetBSD.org@localhost>
date:      Thu Feb 11 17:46:09 2010 +0000

description:
changes to 1.99.18/20100211

small steps, but lots of them - this is the first one.

+ print out the correct key information when signing files and memory.
  what used to be printed out was the copy of the public key which is
  stored as part of the private key(!). does not address the info shown
  when decrypting, since that is done in a different way, by callback.
  this whole part needs to be re-written, but will have to wait for two
  good hands.

diffstat:

 crypto/external/bsd/netpgp/dist/configure.ac      |   6 ++--
 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  |  28 ++++++++++++++++++----
 crypto/external/bsd/netpgp/dist/src/lib/version.h |   2 +-
 3 files changed, 27 insertions(+), 9 deletions(-)

diffs (109 lines):

diff -r 9e5c23d8547f -r 57a7becfd0c1 crypto/external/bsd/netpgp/dist/configure.ac
--- a/crypto/external/bsd/netpgp/dist/configure.ac      Thu Feb 11 16:28:06 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/configure.ac      Thu Feb 11 17:46:09 2010 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: configure.ac,v 1.22 2010/02/08 17:19:12 agc Exp $
+# $NetBSD: configure.ac,v 1.23 2010/02/11 17:46:09 agc Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT([netpgp],[20100208],[Alistair Crooks <agc%netbsd.org@localhost> c0596823])
+AC_INIT([netpgp],[20100211],[Alistair Crooks <agc%netbsd.org@localhost> c0596823])
 AC_PREREQ(2.63)
-AC_REVISION([$Revision: 1.22 $])
+AC_REVISION([$Revision: 1.23 $])
 
 AS_SHELL_SANITIZE
 
diff -r 9e5c23d8547f -r 57a7becfd0c1 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Thu Feb 11 16:28:06 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Thu Feb 11 17:46:09 2010 +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.37 2010/02/06 02:24:33 agc Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.38 2010/02/11 17:46:09 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -389,7 +389,7 @@
                (void) memset(&limit, 0x0, sizeof(limit));
                if (setrlimit(RLIMIT_CORE, &limit) != 0) {
                        (void) fprintf(stderr,
-                       "netpgp_init: warning - can't turn off core dumps\n");
+                       "netpgp: warning - can't turn off core dumps\n");
                        coredumps = 1;
                }
        }
@@ -814,6 +814,7 @@
                int detached)
 {
        const __ops_key_t       *keypair;
+       const __ops_key_t       *pubkey;
        __ops_seckey_t          *seckey;
        const unsigned           overwrite = 1;
        __ops_io_t              *io;
@@ -832,7 +833,7 @@
        /* get key with which to sign */
        keypair = __ops_getkeybyname(io, netpgp->secring, userid);
        if (keypair == NULL) {
-               (void) fprintf(io->errs, "Userid '%s' not found in keyring\n",
+               (void) fprintf(io->errs, "Userid '%s' not found in secring\n",
                                userid);
                return 0;
        }
@@ -840,7 +841,15 @@
        do {
                if (netpgp->passfp == NULL) {
                        /* print out the user id */
-                       __ops_print_keydata(io, keypair, "pub", &keypair->key.pubkey);
+                       pubkey = __ops_getkeybyname(io, netpgp->pubring, userid);
+                       if (pubkey == NULL) {
+                               (void) fprintf(io->errs,
+                                       "netpgp: warning - using pubkey from secring\n");
+                               __ops_print_keydata(io, keypair, "pub",
+                                       &keypair->key.seckey.pubkey);
+                       } else {
+                               __ops_print_keydata(io, pubkey, "pub", &pubkey->key.pubkey);
+                       }
                }
                if (netpgp_getvar(netpgp, "ssh keys") == NULL) {
                        /* now decrypt key */
@@ -918,6 +927,7 @@
                const unsigned cleartext)
 {
        const __ops_key_t       *keypair;
+       const __ops_key_t       *pubkey;
        __ops_seckey_t          *seckey;
        __ops_memory_t          *signedmem;
        __ops_io_t              *io;
@@ -944,7 +954,15 @@
        do {
                if (netpgp->passfp == NULL) {
                        /* print out the user id */
-                       __ops_print_keydata(io, keypair, "pub", &keypair->key.pubkey);
+                       pubkey = __ops_getkeybyname(io, netpgp->pubring, userid);
+                       if (pubkey == NULL) {
+                               (void) fprintf(io->errs,
+                                       "netpgp: warning - using pubkey from secring\n");
+                               __ops_print_keydata(io, keypair, "pub",
+                                       &keypair->key.seckey.pubkey);
+                       } else {
+                               __ops_print_keydata(io, pubkey, "pub", &pubkey->key.pubkey);
+                       }
                }
                /* now decrypt key */
                seckey = __ops_decrypt_seckey(keypair, netpgp->passfp);
diff -r 9e5c23d8547f -r 57a7becfd0c1 crypto/external/bsd/netpgp/dist/src/lib/version.h
--- a/crypto/external/bsd/netpgp/dist/src/lib/version.h Thu Feb 11 16:28:06 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/version.h Thu Feb 11 17:46:09 2010 +0000
@@ -58,7 +58,7 @@
 #endif
 
 /* development versions have .99 suffix */
-#define NETPGP_BASE_VERSION    "1.99.17"
+#define NETPGP_BASE_VERSION    "1.99.18"
 
 #define NETPGP_VERSION_CAT(a, b)       "NetPGP portable " a "/[" b "]"
 #define NETPGP_VERSION_STRING \



Home | Main Index | Thread Index | Old Index