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 Take the internal fu...



details:   https://anonhg.NetBSD.org/src/rev/cfc01bbd7a3c
branches:  trunk
changeset: 758531:cfc01bbd7a3c
user:      agc <agc%NetBSD.org@localhost>
date:      Sun Nov 07 08:39:59 2010 +0000

description:
Take the internal functions and definitions back out of the implementation
namespace:

        :g/\<__ops/s//pgp/g
        :g/\<__OPS/s//__PGP/g
        :g/\<OPS/s//PGP/g

No functional change, regression tests complete successfully.

diffstat:

 crypto/external/bsd/netpgp/dist/src/lib/compress.c       |   126 +-
 crypto/external/bsd/netpgp/dist/src/lib/config.h.in      |     3 +
 crypto/external/bsd/netpgp/dist/src/lib/create.c         |   532 ++--
 crypto/external/bsd/netpgp/dist/src/lib/create.h         |    70 +-
 crypto/external/bsd/netpgp/dist/src/lib/crypto.c         |   234 +-
 crypto/external/bsd/netpgp/dist/src/lib/crypto.h         |   258 +-
 crypto/external/bsd/netpgp/dist/src/lib/errors.h         |   138 +-
 crypto/external/bsd/netpgp/dist/src/lib/keyring.c        |   520 ++--
 crypto/external/bsd/netpgp/dist/src/lib/keyring.h        |   120 +-
 crypto/external/bsd/netpgp/dist/src/lib/memory.h         |    34 +-
 crypto/external/bsd/netpgp/dist/src/lib/misc.c           |   500 ++--
 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c         |   312 +-
 crypto/external/bsd/netpgp/dist/src/lib/netpgpdefs.h     |    16 +-
 crypto/external/bsd/netpgp/dist/src/lib/netpgpdigest.h   |     6 +-
 crypto/external/bsd/netpgp/dist/src/lib/netpgpsdk.h      |    34 +-
 crypto/external/bsd/netpgp/dist/src/lib/openssl_crypto.c |   256 +-
 crypto/external/bsd/netpgp/dist/src/lib/ops-ssh.h        |    10 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c   |  1258 +++++++-------
 crypto/external/bsd/netpgp/dist/src/lib/packet-parse.h   |   120 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet-print.c   |   514 ++--
 crypto/external/bsd/netpgp/dist/src/lib/packet-show.c    |   478 ++--
 crypto/external/bsd/netpgp/dist/src/lib/packet-show.h    |    56 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet.h         |   820 ++++----
 crypto/external/bsd/netpgp/dist/src/lib/reader.c         |   636 +++---
 crypto/external/bsd/netpgp/dist/src/lib/readerwriter.h   |    74 +-
 crypto/external/bsd/netpgp/dist/src/lib/signature.c      |   622 +++---
 crypto/external/bsd/netpgp/dist/src/lib/signature.h      |   116 +-
 crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c        |   114 +-
 crypto/external/bsd/netpgp/dist/src/lib/symmetric.c      |   162 +-
 crypto/external/bsd/netpgp/dist/src/lib/types.h          |    30 +-
 crypto/external/bsd/netpgp/dist/src/lib/validate.c       |   402 ++--
 crypto/external/bsd/netpgp/dist/src/lib/validate.h       |    58 +-
 crypto/external/bsd/netpgp/dist/src/lib/version.h        |     2 +-
 crypto/external/bsd/netpgp/dist/src/lib/writer.c         |   680 +++---
 crypto/external/bsd/netpgp/dist/src/lib/writer.h         |    70 +-
 35 files changed, 4692 insertions(+), 4689 deletions(-)

diffs (truncated from 20526 to 300 lines):

diff -r 1c0df0efda31 -r cfc01bbd7a3c crypto/external/bsd/netpgp/dist/src/lib/compress.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/compress.c        Sun Nov 07 07:34:27 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/compress.c        Sun Nov 07 08:39:59 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.18 2010/10/31 18:31:03 agc Exp $");
+__RCSID("$NetBSD: compress.c,v 1.19 2010/11/07 08:39:59 agc Exp $");
 #endif
 
 #ifdef HAVE_ZLIB_H
@@ -80,8 +80,8 @@
 #define DECOMPRESS_BUFFER      1024
 
 typedef struct {
-       __ops_compression_type_t type;
-       __ops_region_t   *region;
+       pgp_compression_type_t type;
+       pgp_region_t   *region;
        uint8_t         in[DECOMPRESS_BUFFER];
        uint8_t         out[DECOMPRESS_BUFFER];
        z_stream        zstream;/* ZIP and ZLIB */
@@ -91,8 +91,8 @@
 
 #ifdef HAVE_BZLIB_H
 typedef struct {
-       __ops_compression_type_t type;
-       __ops_region_t   *region;
+       pgp_compression_type_t type;
+       pgp_region_t   *region;
        char            in[DECOMPRESS_BUFFER];
        char            out[DECOMPRESS_BUFFER];
        bz_stream       bzstream;       /* BZIP2 */
@@ -113,16 +113,16 @@
  */
 static int 
 zlib_compressed_data_reader(void *dest, size_t length,
-                           __ops_error_t **errors,
-                           __ops_reader_t *readinfo,
-                           __ops_cbdata_t *cbinfo)
+                           pgp_error_t **errors,
+                           pgp_reader_t *readinfo,
+                           pgp_cbdata_t *cbinfo)
 {
-       z_decompress_t *z = __ops_reader_get_arg(readinfo);
+       z_decompress_t *z = pgp_reader_get_arg(readinfo);
        size_t           len;
        size_t           cc;
        char            *cdest = dest;
 
-       if (z->type != OPS_C_ZIP && z->type != OPS_C_ZLIB) {
+       if (z->type != PGP_C_ZIP && z->type != PGP_C_ZLIB) {
                (void) fprintf(stderr,
                        "zlib_compressed_data_reader: weird type %d\n",
                        z->type);
@@ -134,7 +134,7 @@
                return 0;
        }
 
-       if (__ops_get_debug_level(__FILE__)) {
+       if (pgp_get_debug_level(__FILE__)) {
                (void) fprintf(stderr,
                        "zlib_compressed_data_reader: length %" PRIsize "d\n",
                        length);
@@ -142,7 +142,7 @@
 
        if (z->region->readc == z->region->length) {
                if (z->inflate_ret != Z_STREAM_END) {
-                       OPS_ERROR(cbinfo->errors, OPS_E_P_DECOMPRESSION_ERROR,
+                       PGP_ERROR(cbinfo->errors, PGP_E_P_DECOMPRESSION_ERROR,
                        "Compressed data didn't end when region ended.");
                }
        }
@@ -164,7 +164,7 @@
                                } else {
                                        n = sizeof(z->in);
                                }
-                               if (!__ops_stacked_limited_read(z->in, n,
+                               if (!pgp_stacked_limited_read(z->in, n,
                                                z->region,
                                                errors, readinfo, cbinfo)) {
                                        return -1;
@@ -178,14 +178,14 @@
                        if (ret == Z_STREAM_END) {
                                if (!z->region->indeterminate &&
                                    z->region->readc != z->region->length) {
-                                       OPS_ERROR(cbinfo->errors,
-                                               OPS_E_P_DECOMPRESSION_ERROR,
+                                       PGP_ERROR(cbinfo->errors,
+                                               PGP_E_P_DECOMPRESSION_ERROR,
                                                "Compressed stream ended before packet end.");
                                }
                        } else if (ret != Z_OK) {
                                (void) fprintf(stderr, "ret=%d\n", ret);
-                               OPS_ERROR(cbinfo->errors,
-                               OPS_E_P_DECOMPRESSION_ERROR, z->zstream.msg);
+                               PGP_ERROR(cbinfo->errors,
+                               PGP_E_P_DECOMPRESSION_ERROR, z->zstream.msg);
                        }
                        z->inflate_ret = ret;
                }
@@ -208,16 +208,16 @@
 /* \todo remove code duplication between this and zlib_compressed_data_reader */
 static int 
 bzip2_compressed_data_reader(void *dest, size_t length,
-                            __ops_error_t **errors,
-                            __ops_reader_t *readinfo,
-                            __ops_cbdata_t *cbinfo)
+                            pgp_error_t **errors,
+                            pgp_reader_t *readinfo,
+                            pgp_cbdata_t *cbinfo)
 {
-       bz_decompress_t *bz = __ops_reader_get_arg(readinfo);
+       bz_decompress_t *bz = pgp_reader_get_arg(readinfo);
        size_t          len;
        size_t           cc;
        char            *cdest = dest;
 
-       if (bz->type != OPS_C_BZIP2) {
+       if (bz->type != PGP_C_BZIP2) {
                (void) fprintf(stderr, "Weird type %d\n", bz->type);
                return 0;
        }
@@ -228,7 +228,7 @@
        }
        if (bz->region->readc == bz->region->length) {
                if (bz->inflate_ret != BZ_STREAM_END) {
-                       OPS_ERROR(cbinfo->errors, OPS_E_P_DECOMPRESSION_ERROR,
+                       PGP_ERROR(cbinfo->errors, PGP_E_P_DECOMPRESSION_ERROR,
                        "Compressed data didn't end when region ended.");
                }
        }
@@ -249,7 +249,7 @@
                                } else
                                        n = sizeof(bz->in);
 
-                               if (!__ops_stacked_limited_read(
+                               if (!pgp_stacked_limited_read(
                                                (uint8_t *) bz->in,
                                                n, bz->region,
                                                errors, readinfo, cbinfo))
@@ -264,12 +264,12 @@
                        if (ret == BZ_STREAM_END) {
                                if (!bz->region->indeterminate &&
                                    bz->region->readc != bz->region->length)
-                                       OPS_ERROR(cbinfo->errors,
-                                               OPS_E_P_DECOMPRESSION_ERROR,
+                                       PGP_ERROR(cbinfo->errors,
+                                               PGP_E_P_DECOMPRESSION_ERROR,
                                                "Compressed stream ended before packet end.");
                        } else if (ret != BZ_OK) {
-                               OPS_ERROR_1(cbinfo->errors,
-                                       OPS_E_P_DECOMPRESSION_ERROR,
+                               PGP_ERROR_1(cbinfo->errors,
+                                       PGP_E_P_DECOMPRESSION_ERROR,
                                        "Invalid return %d from BZ2_bzDecompress", ret);
                        }
                        bz->inflate_ret = ret;
@@ -299,8 +299,8 @@
 */
 
 int 
-__ops_decompress(__ops_region_t *region, __ops_stream_t *stream,
-              __ops_compression_type_t type)
+pgp_decompress(pgp_region_t *region, pgp_stream_t *stream,
+              pgp_compression_type_t type)
 {
        z_decompress_t z;
 #ifdef HAVE_BZLIB_H
@@ -310,8 +310,8 @@
        int             ret;
 
        switch (type) {
-       case OPS_C_ZIP:
-       case OPS_C_ZLIB:
+       case PGP_C_ZIP:
+       case PGP_C_ZLIB:
                (void) memset(&z, 0x0, sizeof(z));
 
                z.region = region;
@@ -328,7 +328,7 @@
                break;
 
 #ifdef HAVE_BZLIB_H
-       case OPS_C_BZIP2:
+       case PGP_C_BZIP2:
                (void) memset(&bz, 0x0, sizeof(bz));
 
                bz.region = region;
@@ -346,72 +346,72 @@
                break;
 
        default:
-               OPS_ERROR_1(&stream->errors,
-                       OPS_E_ALG_UNSUPPORTED_COMPRESS_ALG,
+               PGP_ERROR_1(&stream->errors,
+                       PGP_E_ALG_UNSUPPORTED_COMPRESS_ALG,
                        "Compression algorithm %d is not yet supported", type);
                return 0;
        }
 
        switch (type) {
-       case OPS_C_ZIP:
+       case PGP_C_ZIP:
                /* LINTED */ /* this is a lint problem in zlib.h header */
                ret = (int)inflateInit2(&z.zstream, -15);
                break;
 
-       case OPS_C_ZLIB:
+       case PGP_C_ZLIB:
                /* LINTED */ /* this is a lint problem in zlib.h header */
                ret = (int)inflateInit(&z.zstream);
                break;
 
 #ifdef HAVE_BZLIB_H
-       case OPS_C_BZIP2:
+       case PGP_C_BZIP2:
                ret = BZ2_bzDecompressInit(&bz.bzstream, 1, 0);
                break;
 #endif
 
        default:
-               OPS_ERROR_1(&stream->errors,
-                       OPS_E_ALG_UNSUPPORTED_COMPRESS_ALG,
+               PGP_ERROR_1(&stream->errors,
+                       PGP_E_ALG_UNSUPPORTED_COMPRESS_ALG,
                        "Compression algorithm %d is not yet supported", type);
                return 0;
        }
 
        switch (type) {
-       case OPS_C_ZIP:
-       case OPS_C_ZLIB:
+       case PGP_C_ZIP:
+       case PGP_C_ZLIB:
                if (ret != Z_OK) {
-                       OPS_ERROR_1(&stream->errors,
-                               OPS_E_P_DECOMPRESSION_ERROR,
+                       PGP_ERROR_1(&stream->errors,
+                               PGP_E_P_DECOMPRESSION_ERROR,
 "Cannot initialise ZIP or ZLIB stream for decompression: error=%d", ret);
                        return 0;
                }
-               __ops_reader_push(stream, zlib_compressed_data_reader,
+               pgp_reader_push(stream, zlib_compressed_data_reader,
                                        NULL, &z);
                break;
 
 #ifdef HAVE_BZLIB_H
-       case OPS_C_BZIP2:
+       case PGP_C_BZIP2:
                if (ret != BZ_OK) {
-                       OPS_ERROR_1(&stream->errors,
-                               OPS_E_P_DECOMPRESSION_ERROR,
+                       PGP_ERROR_1(&stream->errors,
+                               PGP_E_P_DECOMPRESSION_ERROR,
 "Cannot initialise BZIP2 stream for decompression: error=%d", ret);
                        return 0;
                }
-               __ops_reader_push(stream, bzip2_compressed_data_reader,
+               pgp_reader_push(stream, bzip2_compressed_data_reader,
                                        NULL, &bz);
                break;
 #endif
 
        default:
-               OPS_ERROR_1(&stream->errors,
-                       OPS_E_ALG_UNSUPPORTED_COMPRESS_ALG,
+               PGP_ERROR_1(&stream->errors,
+                       PGP_E_ALG_UNSUPPORTED_COMPRESS_ALG,
                        "Compression algorithm %d is not yet supported", type);
                return 0;
        }
 
-       ret = __ops_parse(stream, !printerrors);
+       ret = pgp_parse(stream, !printerrors);
 
-       __ops_reader_pop(stream);
+       pgp_reader_pop(stream);
 
        return ret;
 }
@@ -426,7 +426,7 @@
 */
 
 unsigned 
-__ops_writez(__ops_output_t *out, const uint8_t *data, const unsigned len)
+pgp_writez(pgp_output_t *out, const uint8_t *data, const unsigned len)
 {
        compress_t      *zip;
        size_t           sz_in;
@@ -439,7 +439,7 @@
                                                         * levels */
 
        if ((zip = calloc(1, sizeof(*zip))) == NULL) {
-               (void) fprintf(stderr, "__ops_writez: bad alloc\n");
+               (void) fprintf(stderr, "pgp_writez: bad alloc\n");
                return 0;
        }



Home | Main Index | Thread Index | Old Index