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 Changes to 2.99.1/20100313



details:   https://anonhg.NetBSD.org/src/rev/6722dd912f38
branches:  trunk
changeset: 752994:6722dd912f38
user:      agc <agc%NetBSD.org@localhost>
date:      Sat Mar 13 23:30:40 2010 +0000

description:
Changes to 2.99.1/20100313

+ add functionality to parse basic signature subkeys
+ in doing so, add expiration of keys
+ at the same time, add revocation of keys
+ recognise the primary user id, and use it when displaying user ids
+ recognise self signed keys and subkeys
+ rework the indentation of output
+ add the --list-sigs [userid] option to netpgpkeys(1)
+ use memcmp(3) rather than strcmp(3) when checking binary user ids to
  be exported
+ add expiration display to subkey signature output
+ update libnetpgp library version major number to 3

diffstat:

 crypto/external/bsd/netpgp/dist/TODO                        |    6 +-
 crypto/external/bsd/netpgp/dist/configure                   |   22 +-
 crypto/external/bsd/netpgp/dist/configure.ac                |    6 +-
 crypto/external/bsd/netpgp/dist/include/netpgp.h            |    4 +-
 crypto/external/bsd/netpgp/dist/src/lib/create.c            |   50 +---
 crypto/external/bsd/netpgp/dist/src/lib/keyring.c           |  108 +++++++----
 crypto/external/bsd/netpgp/dist/src/lib/keyring.h           |   16 +-
 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c            |   33 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet-print.c      |  104 +++++++++--
 crypto/external/bsd/netpgp/dist/src/lib/packet.h            |   61 +++++-
 crypto/external/bsd/netpgp/dist/src/lib/reader.c            |    8 +-
 crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c           |    6 +-
 crypto/external/bsd/netpgp/dist/src/lib/version.h           |    2 +-
 crypto/external/bsd/netpgp/dist/src/netpgp/Makefile         |    6 +-
 crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.1 |   14 +-
 crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c |   12 +-
 crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile   |    6 +-
 crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.c   |    4 +-
 crypto/external/bsd/netpgp/dist/tst                         |    4 +-
 crypto/external/bsd/netpgp/lib/config.h                     |    6 +-
 crypto/external/bsd/netpgp/lib/shlib_version                |    2 +-
 21 files changed, 302 insertions(+), 178 deletions(-)

diffs (truncated from 1118 to 300 lines):

diff -r 3f599fe1860f -r 6722dd912f38 crypto/external/bsd/netpgp/dist/TODO
--- a/crypto/external/bsd/netpgp/dist/TODO      Sat Mar 13 23:03:39 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/TODO      Sat Mar 13 23:30:40 2010 +0000
@@ -1,13 +1,10 @@
 To Do
 =====
-add revocation information to public key display
 agent
 agentctl
-trust subpackets
 make netpgpkeys work - add, import, commit, update, sign, passphrase
 convert to and from ascii armored sigs
 gpgme compat lib
---list-sigs - these come out in __ops_check_subkey_sig()
 return userids from successful verify, and then print id out if required
 is get_passphrase_cb needed?
 error logging
@@ -93,3 +90,6 @@
 hkpclient
 netbsd/pkgsrc pr 42922
 add expiry information to public key display
+trust subpackets
+add revocation information to public key display
+--list-sigs - these come out in __ops_check_subkey_sig()
diff -r 3f599fe1860f -r 6722dd912f38 crypto/external/bsd/netpgp/dist/configure
--- a/crypto/external/bsd/netpgp/dist/configure Sat Mar 13 23:03:39 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/configure Sat Mar 13 23:30:40 2010 +0000
@@ -1,7 +1,7 @@
 #! /bin/sh
-# From configure.ac Revision: 1.26 .
+# From configure.ac Revision: 1.27 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for netpgp 20100307.
+# Generated by GNU Autoconf 2.63 for netpgp 20100313.
 #
 # Report bugs to <Alistair Crooks <agc%netbsd.org@localhost> c0596823>.
 #
@@ -751,8 +751,8 @@
 # Identity of this package.
 PACKAGE_NAME='netpgp'
 PACKAGE_TARNAME='netpgp'
-PACKAGE_VERSION='20100307'
-PACKAGE_STRING='netpgp 20100307'
+PACKAGE_VERSION='20100313'
+PACKAGE_STRING='netpgp 20100313'
 PACKAGE_BUGREPORT='Alistair Crooks <agc%netbsd.org@localhost> c0596823'
 
 ac_unique_file="src/netpgp/netpgp.c"
@@ -1483,7 +1483,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures netpgp 20100307 to adapt to many kinds of systems.
+\`configure' configures netpgp 20100313 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1553,7 +1553,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of netpgp 20100307:";;
+     short | recursive ) echo "Configuration of netpgp 20100313:";;
    esac
   cat <<\_ACEOF
 
@@ -1660,7 +1660,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-netpgp configure 20100307
+netpgp configure 20100313
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1674,7 +1674,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by netpgp $as_me 20100307, which was
+It was created by netpgp $as_me 20100313, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -2561,7 +2561,7 @@
 
 # Define the identity of the package.
  PACKAGE='netpgp'
- VERSION='20100307'
+ VERSION='20100313'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -22306,7 +22306,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by netpgp $as_me 20100307, which was
+This file was extended by netpgp $as_me 20100313, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -22369,7 +22369,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-netpgp config.status 20100307
+netpgp config.status 20100313
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff -r 3f599fe1860f -r 6722dd912f38 crypto/external/bsd/netpgp/dist/configure.ac
--- a/crypto/external/bsd/netpgp/dist/configure.ac      Sat Mar 13 23:03:39 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/configure.ac      Sat Mar 13 23:30:40 2010 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: configure.ac,v 1.27 2010/03/08 07:37:24 agc Exp $
+# $NetBSD: configure.ac,v 1.28 2010/03/13 23:30:40 agc Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT([netpgp],[20100307],[Alistair Crooks <agc%netbsd.org@localhost> c0596823])
+AC_INIT([netpgp],[20100313],[Alistair Crooks <agc%netbsd.org@localhost> c0596823])
 AC_PREREQ(2.63)
-AC_REVISION([$Revision: 1.27 $])
+AC_REVISION([$Revision: 1.28 $])
 
 AS_SHELL_SANITIZE
 
diff -r 3f599fe1860f -r 6722dd912f38 crypto/external/bsd/netpgp/dist/include/netpgp.h
--- a/crypto/external/bsd/netpgp/dist/include/netpgp.h  Sat Mar 13 23:03:39 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/include/netpgp.h  Sat Mar 13 23:30:40 2010 +0000
@@ -72,7 +72,7 @@
 int netpgp_set_homedir(netpgp_t *, char *, const char *, const int);
 
 /* key management */
-int netpgp_list_keys(netpgp_t *);
+int netpgp_list_keys(netpgp_t *, const int);
 int netpgp_find_key(netpgp_t *, char *);
 char *netpgp_get_key(netpgp_t *, const char *, const char *);
 char *netpgp_export_key(netpgp_t *, char *);
@@ -92,7 +92,7 @@
 int netpgp_decrypt_memory(netpgp_t *, const void *, const size_t, char *, size_t, const int);
 
 /* match and hkp-related functions */
-int netpgp_match_keys(netpgp_t *, char *, const char *, void *);
+int netpgp_match_keys(netpgp_t *, char *, const char *, void *, const int);
 int netpgp_match_pubkeys(netpgp_t *, char *, void *);
 
 int netpgp_validate_sigs(netpgp_t *);
diff -r 3f599fe1860f -r 6722dd912f38 crypto/external/bsd/netpgp/dist/src/lib/create.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/create.c  Sat Mar 13 23:03:39 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/create.c  Sat Mar 13 23:30:40 2010 +0000
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: create.c,v 1.23 2010/03/05 16:01:09 agc Exp $");
+__RCSID("$NetBSD: create.c,v 1.24 2010/03/13 23:30:41 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -518,7 +518,7 @@
 
 unsigned 
 __ops_write_xfer_pubkey(__ops_output_t *output,
-                       const __ops_key_t *keydata,
+                       const __ops_key_t *key,
                        const unsigned armoured)
 {
        unsigned    i, j;
@@ -527,30 +527,20 @@
                __ops_writer_push_armoured(output, OPS_PGP_PUBLIC_KEY_BLOCK);
        }
        /* public key */
-       if (!write_struct_pubkey(output, &keydata->key.seckey.pubkey)) {
+       if (!write_struct_pubkey(output, &key->key.seckey.pubkey)) {
                return 0;
        }
 
        /* TODO: revocation signatures go here */
 
        /* user ids and corresponding signatures */
-       for (i = 0; i < keydata->uidc; i++) {
-               __ops_userid_t  *uid = &keydata->uids[i];
-
-               if (!__ops_write_struct_userid(output, uid)) {
+       for (i = 0; i < key->uidc; i++) {
+               if (!__ops_write_struct_userid(output, &key->uids[i])) {
                        return 0;
                }
-
-               /* find signature for this packet if it exists */
-               for (j = 0; j < keydata->sigc; j++) {
-                       sigpacket_t    *sig = &keydata->sigs[i];
-
-                       if (strcmp((char *) sig->userid->userid,
-                                       (char *) uid->userid) == 0) {
-                               if (!__ops_write(output, sig->packet->raw,
-                                               sig->packet->length)) {
-                                       return 0;
-                               }
+               for (j = 0; j < key->packetc; j++) {
+                       if (!__ops_write(output, key->packets[j].raw, key->packets[j].length)) {
+                               return 0;
                        }
                }
        }
@@ -584,7 +574,7 @@
 
 unsigned 
 __ops_write_xfer_seckey(__ops_output_t *output,
-                               const __ops_key_t *keydata,
+                               const __ops_key_t *key,
                                const uint8_t *passphrase,
                                const size_t pplen,
                                unsigned armoured)
@@ -595,7 +585,7 @@
                __ops_writer_push_armoured(output, OPS_PGP_PRIVATE_KEY_BLOCK);
        }
        /* public key */
-       if (!__ops_write_struct_seckey(&keydata->key.seckey, passphrase,
+       if (!__ops_write_struct_seckey(&key->key.seckey, passphrase,
                        pplen, output)) {
                return 0;
        }
@@ -603,23 +593,13 @@
        /* TODO: revocation signatures go here */
 
        /* user ids and corresponding signatures */
-       for (i = 0; i < keydata->uidc; i++) {
-               __ops_userid_t  *uid = &keydata->uids[i];
-
-               if (!__ops_write_struct_userid(output, uid)) {
+       for (i = 0; i < key->uidc; i++) {
+               if (!__ops_write_struct_userid(output, &key->uids[i])) {
                        return 0;
                }
-
-               /* find signature for this packet if it exists */
-               for (j = 0; j < keydata->sigc; j++) {
-                       sigpacket_t    *sig = &keydata->sigs[i];
-
-                       if (strcmp((char *) sig->userid->userid,
-                                       (char *) uid->userid) == 0) {
-                               if (!__ops_write(output, sig->packet->raw,
-                                               sig->packet->length)) {
-                                       return 0;
-                               }
+               for (j = 0; j < key->packetc; j++) {
+                       if (!__ops_write(output, key->packets[j].raw, key->packets[j].length)) {
+                               return 0;
                        }
                }
        }
diff -r 3f599fe1860f -r 6722dd912f38 crypto/external/bsd/netpgp/dist/src/lib/keyring.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Sat Mar 13 23:03:39 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Sat Mar 13 23:30:40 2010 +0000
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: keyring.c,v 1.32 2010/03/12 01:22:01 agc Exp $");
+__RCSID("$NetBSD: keyring.c,v 1.33 2010/03/13 23:30:41 agc Exp $");
 #endif
 
 #ifdef HAVE_FCNTL_H
@@ -480,36 +480,6 @@
 
 /**
 \ingroup Core_Keys
-\brief Add signed User ID to key
-\param keydata Key to which to add signed User ID
-\param userid User ID to add
-\param sigpacket Packet to add
-*/
-void 
-__ops_add_signed_userid(__ops_key_t *keydata,
-               const __ops_userid_t *userid,
-               const __ops_subpacket_t *sigpacket)
-{
-       __ops_subpacket_t       *pkt;
-       __ops_userid_t          *uid;
-
-       uid = __ops_add_userid(keydata, userid);
-       pkt = __ops_add_subpacket(keydata, sigpacket);
-
-       /*
-         * add entry in sigs array to link the userid and sigpacket
-        * and add ptr to it from the sigs array */
-       EXPAND_ARRAY(keydata, sig);
-
-       /**setup new entry in array */
-       keydata->sigs[keydata->sigc].userid = uid;
-       keydata->sigs[keydata->sigc].packet = pkt;
-
-       keydata->sigc++;
-}
-
-/**
-\ingroup Core_Keys



Home | Main Index | Thread Index | Old Index