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 Update netpgp to version 1.9...



details:   https://anonhg.NetBSD.org/src/rev/4fada1177259
branches:  trunk
changeset: 752738:4fada1177259
user:      agc <agc%NetBSD.org@localhost>
date:      Fri Mar 05 16:01:09 2010 +0000

description:
Update netpgp to version 1.99.20/20100304 - portability improvements, and bug fixes:

        Changes to 1.99.20/20100304

        + move args to some functions around to be consistent
        + use uint*_t where appropriate
        + fix bug in verify memory
        + add documentation to manual pages to show how to do combined
          signing/encryption and decryption/verification
        + make verification of ascii-armoured memory work the same as binary
        + eliminate use of strdup(3), strcasecmp(3), and strptime(3). NetBSD/pkgsrc
          PR 42922 applies - need to define _XOPEN_SOURCE and _BSD_SOURCE for
          newer linux platforms with glibc 2.10.1. solved a bit differently, by
          implementing strdup(3) and strcasecmp(3) independently, and using regexps
          to avoid calling strptime(3).

diffstat:

 crypto/external/bsd/netpgp/dist/TODO                        |    4 +-
 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/compress.c          |   18 +-
 crypto/external/bsd/netpgp/dist/src/lib/create.c            |   78 +-
 crypto/external/bsd/netpgp/dist/src/lib/create.h            |   18 +-
 crypto/external/bsd/netpgp/dist/src/lib/crypto.c            |   12 +-
 crypto/external/bsd/netpgp/dist/src/lib/crypto.h            |   42 +-
 crypto/external/bsd/netpgp/dist/src/lib/fastctype.c         |   24 +-
 crypto/external/bsd/netpgp/dist/src/lib/fastctype.h         |   24 +-
 crypto/external/bsd/netpgp/dist/src/lib/keyring.c           |   43 +-
 crypto/external/bsd/netpgp/dist/src/lib/keyring.h           |   10 +-
 crypto/external/bsd/netpgp/dist/src/lib/memory.h            |    4 +-
 crypto/external/bsd/netpgp/dist/src/lib/misc.c              |   91 +-
 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c            |  107 ++-
 crypto/external/bsd/netpgp/dist/src/lib/netpgpdefs.h        |    2 +-
 crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h         |   13 +-
 crypto/external/bsd/netpgp/dist/src/lib/openssl_crypto.c    |   58 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c      |  107 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet-parse.h      |   12 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet-print.c      |   44 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet-show.c       |   48 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet-show.h       |   22 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet.h            |  106 +-
 crypto/external/bsd/netpgp/dist/src/lib/reader.c            |   77 +-
 crypto/external/bsd/netpgp/dist/src/lib/readerwriter.h      |   14 +-
 crypto/external/bsd/netpgp/dist/src/lib/signature.c         |   75 +-
 crypto/external/bsd/netpgp/dist/src/lib/signature.h         |   12 +-
 crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c           |   12 +-
 crypto/external/bsd/netpgp/dist/src/lib/symmetric.c         |   20 +-
 crypto/external/bsd/netpgp/dist/src/lib/types.h             |    2 +-
 crypto/external/bsd/netpgp/dist/src/lib/validate.c          |   38 +-
 crypto/external/bsd/netpgp/dist/src/lib/validate.h          |    6 +-
 crypto/external/bsd/netpgp/dist/src/lib/version.h           |    2 +-
 crypto/external/bsd/netpgp/dist/src/lib/writer.c            |  407 ++++++-----
 crypto/external/bsd/netpgp/dist/src/lib/writer.h            |   15 +-
 crypto/external/bsd/netpgp/dist/src/netpgp/Makefile         |    6 +-
 crypto/external/bsd/netpgp/dist/src/netpgp/netpgp.1         |   41 +-
 crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c |   10 +-
 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                         |    7 +-
 43 files changed, 893 insertions(+), 780 deletions(-)

diffs (truncated from 5096 to 300 lines):

diff -r 544743dcfdd7 -r 4fada1177259 crypto/external/bsd/netpgp/dist/TODO
--- a/crypto/external/bsd/netpgp/dist/TODO      Fri Mar 05 14:00:16 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/TODO      Fri Mar 05 16:01:09 2010 +0000
@@ -15,7 +15,6 @@
 thresholds
 default compression when signing?
 elgamal enc/decryption?
-hkpd
 
 Done
 ====
@@ -89,3 +88,6 @@
 duration -> expiry
 print signing key info properly when prompting for passphrase
 print decryption key info properly when prompting for passphrase
+hkpd
+hkpclient
+netbsd/pkgsrc pr 42922
diff -r 544743dcfdd7 -r 4fada1177259 crypto/external/bsd/netpgp/dist/configure
--- a/crypto/external/bsd/netpgp/dist/configure Fri Mar 05 14:00:16 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/configure Fri Mar 05 16:01:09 2010 +0000
@@ -1,7 +1,7 @@
 #! /bin/sh
-# From configure.ac Revision: 1.21 .
+# From configure.ac Revision: 1.24 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for netpgp 20100208.
+# Generated by GNU Autoconf 2.63 for netpgp 20100304.
 #
 # 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='20100208'
-PACKAGE_STRING='netpgp 20100208'
+PACKAGE_VERSION='20100304'
+PACKAGE_STRING='netpgp 20100304'
 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 20100208 to adapt to many kinds of systems.
+\`configure' configures netpgp 20100304 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 20100208:";;
+     short | recursive ) echo "Configuration of netpgp 20100304:";;
    esac
   cat <<\_ACEOF
 
@@ -1660,7 +1660,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-netpgp configure 20100208
+netpgp configure 20100304
 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 20100208, which was
+It was created by netpgp $as_me 20100304, 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='20100208'
+ VERSION='20100304'
 
 
 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 20100208, which was
+This file was extended by netpgp $as_me 20100304, 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 20100208
+netpgp config.status 20100304
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff -r 544743dcfdd7 -r 4fada1177259 crypto/external/bsd/netpgp/dist/configure.ac
--- a/crypto/external/bsd/netpgp/dist/configure.ac      Fri Mar 05 14:00:16 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/configure.ac      Fri Mar 05 16:01:09 2010 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: configure.ac,v 1.24 2010/02/12 03:38:48 agc Exp $
+# $NetBSD: configure.ac,v 1.25 2010/03/05 16:01:09 agc Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT([netpgp],[20100212],[Alistair Crooks <agc%netbsd.org@localhost> c0596823])
+AC_INIT([netpgp],[20100304],[Alistair Crooks <agc%netbsd.org@localhost> c0596823])
 AC_PREREQ(2.63)
-AC_REVISION([$Revision: 1.24 $])
+AC_REVISION([$Revision: 1.25 $])
 
 AS_SHELL_SANITIZE
 
diff -r 544743dcfdd7 -r 4fada1177259 crypto/external/bsd/netpgp/dist/include/netpgp.h
--- a/crypto/external/bsd/netpgp/dist/include/netpgp.h  Fri Mar 05 14:00:16 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/include/netpgp.h  Fri Mar 05 16:01:09 2010 +0000
@@ -74,8 +74,8 @@
 /* key management */
 int netpgp_list_keys(netpgp_t *);
 int netpgp_find_key(netpgp_t *, char *);
-char *netpgp_get_key(netpgp_t *, const char *);
-int netpgp_export_key(netpgp_t *, char *);
+char *netpgp_get_key(netpgp_t *, const char *, const char *);
+char *netpgp_export_key(netpgp_t *, char *);
 int netpgp_import_key(netpgp_t *, char *);
 int netpgp_generate_key(netpgp_t *, char *, int);
 
diff -r 544743dcfdd7 -r 4fada1177259 crypto/external/bsd/netpgp/dist/src/lib/compress.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/compress.c        Fri Mar 05 14:00:16 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/compress.c        Fri Mar 05 16:01:09 2010 +0000
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: compress.c,v 1.14 2009/10/07 04:56:51 agc Exp $");
+__RCSID("$NetBSD: compress.c,v 1.15 2010/03/05 16:01:09 agc Exp $");
 #endif
 
 #ifdef HAVE_ZLIB_H
@@ -82,8 +82,8 @@
 typedef struct {
        __ops_compression_type_t type;
        __ops_region_t   *region;
-       unsigned char   in[DECOMPRESS_BUFFER];
-       unsigned char   out[DECOMPRESS_BUFFER];
+       uint8_t         in[DECOMPRESS_BUFFER];
+       uint8_t         out[DECOMPRESS_BUFFER];
        z_stream        zstream;/* ZIP and ZLIB */
        size_t          offset;
        int             inflate_ret;
@@ -101,8 +101,8 @@
 
 typedef struct {
        z_stream        stream;
-       unsigned char  *src;
-       unsigned char  *dst;
+       uint8_t         *src;
+       uint8_t         *dst;
 } compress_t;
 
 /*
@@ -247,7 +247,7 @@
                                        n = sizeof(bz->in);
 
                                if (!__ops_stacked_limited_read(
-                                               (unsigned char *) bz->in,
+                                               (uint8_t *) bz->in,
                                                n, bz->region,
                                                errors, readinfo, cbinfo))
                                        return -1;
@@ -412,9 +412,7 @@
 */
 
 unsigned 
-__ops_writez(const unsigned char *data,
-                    const unsigned int len,
-                    __ops_output_t *out)
+__ops_writez(__ops_output_t *out, const uint8_t *data, const unsigned len)
 {
        compress_t      *zip;
        size_t           sz_in;
@@ -447,7 +445,7 @@
                return 0;
        }
 
-       sz_in = len * sizeof(unsigned char);
+       sz_in = len * sizeof(uint8_t);
        sz_out = ((101 * sz_in) / 100) + 12;    /* from zlib webpage */
        if ((zip->src = calloc(1, sz_in)) == NULL) {
                free(zip);
diff -r 544743dcfdd7 -r 4fada1177259 crypto/external/bsd/netpgp/dist/src/lib/create.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/create.c  Fri Mar 05 14:00:16 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/create.c  Fri Mar 05 16:01:09 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.22 2010/02/12 03:38:48 agc Exp $");
+__RCSID("$NetBSD: create.c,v 1.23 2010/03/05 16:01:09 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -122,7 +122,7 @@
  */
 
 void 
-__ops_fast_create_userid(__ops_userid_t *id, unsigned char *userid)
+__ops_fast_create_userid(__ops_userid_t *id, uint8_t *userid)
 {
        id->userid = userid;
 }
@@ -151,7 +151,7 @@
  * \return return value from __ops_write_struct_userid()
  */
 unsigned 
-__ops_write_userid(const unsigned char *userid, __ops_output_t *output)
+__ops_write_userid(const uint8_t *userid, __ops_output_t *output)
 {
        __ops_userid_t   id;
 
@@ -272,18 +272,18 @@
  */
 static unsigned 
 write_seckey_body(const __ops_seckey_t *key,
-                     const unsigned char *passphrase,
+                     const uint8_t *passphrase,
                      const size_t pplen,
                      __ops_output_t *output)
 {
        /* RFC4880 Section 5.5.3 Secret-Key Packet Formats */
 
-       __ops_crypt_t     crypted;
-       __ops_hash_t      hash;
-       unsigned char   hashed[OPS_SHA1_HASH_SIZE];
-       unsigned char   sesskey[CAST_KEY_LENGTH];
-       unsigned int    done = 0;
-       unsigned int    i = 0;
+       __ops_crypt_t   crypted;
+       __ops_hash_t    hash;
+       unsigned        done = 0;
+       unsigned        i = 0;
+       uint8_t         hashed[OPS_SHA1_HASH_SIZE];
+       uint8_t         sesskey[CAST_KEY_LENGTH];
 
        if (!write_pubkey_body(&key->pubkey, output)) {
                return 0;
@@ -362,8 +362,8 @@
                /* RFC4880: section 3.7.1.1 and 3.7.1.2 */
 
                for (done = 0, i = 0; done < CAST_KEY_LENGTH; i++) {
-                       unsigned char   zero = 0;
                        unsigned        j;
+                       uint8_t         zero = 0;
                        int             needed;
                        int             size;
 
@@ -521,7 +521,7 @@
                        const __ops_key_t *keydata,
                        const unsigned armoured)
 {
-       unsigned int    i, j;
+       unsigned    i, j;
 
        if (armoured) {
                __ops_writer_push_armoured(output, OPS_PGP_PUBLIC_KEY_BLOCK);
@@ -563,7 +563,7 @@
         */
 
        if (armoured) {
-               writer_info_finalise(&output->errors, &output->writer);
+               __ops_writer_info_finalise(&output->errors, &output->writer);
                __ops_writer_pop(output);
        }
        return 1;
@@ -585,7 +585,7 @@
 unsigned 
 __ops_write_xfer_seckey(__ops_output_t *output,
                                const __ops_key_t *keydata,
-                               const unsigned char *passphrase,
+                               const uint8_t *passphrase,
                                const size_t pplen,
                                unsigned armoured)
 {
@@ -632,7 +632,7 @@
         */
 
        if (armoured) {
-               writer_info_finalise(&output->errors, &output->writer);
+               __ops_writer_info_finalise(&output->errors, &output->writer);
                __ops_writer_pop(output);
        }



Home | Main Index | Thread Index | Old Index