Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/security/netpgpverify/files Update netpgpverify and li...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3cc5cb716891
branches:  trunk
changeset: 430759:3cc5cb716891
user:      agc <agc%pkgsrc.org@localhost>
date:      Sun May 03 23:49:04 2020 +0000

description:
Update netpgpverify and libnetpgpverify to version 20200503

ensure all exported functions use a unique prfix, so that they don't
conflict with symbols (both data and text) in libcrypto. this works for
statically linked binaries and libraries, rather then the version map which
only works for dynalically-linked.

diffstat:

 security/netpgpverify/files/Makefile.bsd    |    7 +-
 security/netpgpverify/files/b64.c           |    6 +-
 security/netpgpverify/files/b64.h           |    6 +-
 security/netpgpverify/files/bzlib.c         |   86 +++++++++++-----------
 security/netpgpverify/files/bzlib.h         |   32 ++++----
 security/netpgpverify/files/bzlib_private.h |   26 +++---
 security/netpgpverify/files/libverify.c     |   22 ++--
 security/netpgpverify/files/rsa.c           |   78 ++++++++++---------
 security/netpgpverify/files/rsa.h           |   87 ++++++++++++----------
 security/netpgpverify/files/verify.h        |    6 +-
 security/netpgpverify/files/zlib.c          |   62 +++++++-------
 security/netpgpverify/files/zlib.h          |  109 ++++++++++++++-------------
 12 files changed, 273 insertions(+), 254 deletions(-)

diffs (truncated from 1474 to 300 lines):

diff -r e061b63ef952 -r 3cc5cb716891 security/netpgpverify/files/Makefile.bsd
--- a/security/netpgpverify/files/Makefile.bsd  Sun May 03 21:52:18 2020 +0000
+++ b/security/netpgpverify/files/Makefile.bsd  Sun May 03 23:49:04 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.bsd,v 1.12 2016/06/30 21:19:59 agc Exp $
+# $NetBSD: Makefile.bsd,v 1.13 2020/05/03 23:49:04 agc Exp $
 
 PROG=netpgpverify
 
@@ -12,6 +12,11 @@
 
 CPPFLAGS+=-I.
 
+CPPFLAGS.bzlib.c+=     -Wno-error=implicit-fallthrough
+CPPFLAGS.zlib.c+=      -Wno-error=implicit-fallthrough
+
+LDFLAGS+=-Wl,--version-script=${.CURDIR}/verify.map
+
 .ifndef PRODUCTION
 CPPFLAGS+=-g -O0
 LDFLAGS+=-g -O0
diff -r e061b63ef952 -r 3cc5cb716891 security/netpgpverify/files/b64.c
--- a/security/netpgpverify/files/b64.c Sun May 03 21:52:18 2020 +0000
+++ b/security/netpgpverify/files/b64.c Sun May 03 23:49:04 2020 +0000
@@ -235,7 +235,7 @@
 ** base64 encode a stream adding padding and line breaks as per spec.
 */
 int 
-b64encode(const char *in, const size_t insize, void *vp, size_t outsize, int linesize)
+netpgpv_b64encode(const char *in, const size_t insize, void *vp, size_t outsize, int linesize)
 {
        const char      *inp;
        unsigned         i;
@@ -299,7 +299,7 @@
 ** decode a base64 encoded stream discarding padding, line breaks and noise
 */
 int
-b64decode(const char *in, const size_t insize, void *vp, size_t outsize)
+netpgpv_b64decode(const char *in, const size_t insize, void *vp, size_t outsize)
 {
        const char      *inp;
        unsigned         wordlen;
@@ -349,7 +349,7 @@
 
 /* return the encoded size for n bytes input */
 int
-b64_encsize(unsigned n)
+netpgpv_b64_encsize(unsigned n)
 {
        return ((4 * n) / 3) + 4;
 }
diff -r e061b63ef952 -r 3cc5cb716891 security/netpgpverify/files/b64.h
--- a/security/netpgpverify/files/b64.h Sun May 03 21:52:18 2020 +0000
+++ b/security/netpgpverify/files/b64.h Sun May 03 23:49:04 2020 +0000
@@ -25,8 +25,8 @@
 #ifndef B64_H_
 #define B64_H_ 20091223
 
-int b64encode(const char */*in*/, const size_t /*insize*/, void */*vp*/, size_t /*outsize*/, int /*linesize*/);
-int b64decode(const char */*in*/, const size_t /*insize*/, void */*vp*/, size_t /*outsize*/);
-int b64_encsize(unsigned /*n*/);
+int netpgpv_b64encode(const char */*in*/, const size_t /*insize*/, void */*vp*/, size_t /*outsize*/, int /*linesize*/);
+int netpgpv_b64decode(const char */*in*/, const size_t /*insize*/, void */*vp*/, size_t /*outsize*/);
+int netpgpv_b64_encsize(unsigned /*n*/);
 
 #endif
diff -r e061b63ef952 -r 3cc5cb716891 security/netpgpverify/files/bzlib.c
--- a/security/netpgpverify/files/bzlib.c       Sun May 03 21:52:18 2020 +0000
+++ b/security/netpgpverify/files/bzlib.c       Sun May 03 23:49:04 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bzlib.c,v 1.5 2016/02/19 22:41:50 agc Exp $    */
+/*     $NetBSD: bzlib.c,v 1.6 2020/05/03 23:49:04 agc Exp $    */
 
 
 /*-------------------------------------------------------------*/
@@ -39,7 +39,7 @@
 #define        USE_ARG(x)      /*LINTED*/(void)&(x)
 #endif
 
-/*     $NetBSD: bzlib.c,v 1.5 2016/02/19 22:41:50 agc Exp $    */
+/*     $NetBSD: bzlib.c,v 1.6 2020/05/03 23:49:04 agc Exp $    */
 
 
 /*-------------------------------------------------------------*/
@@ -64,7 +64,7 @@
 
 
 /*---------------------------------------------*/
-Int32 BZ2_rNums[512] = { 
+Int32 netpgpv_BZ2_rNums[512] = { 
    619, 720, 127, 481, 931, 816, 813, 233, 566, 247, 
    985, 724, 205, 454, 863, 491, 741, 242, 949, 214, 
    733, 859, 335, 708, 621, 574, 73, 654, 730, 472, 
@@ -126,7 +126,7 @@
 
 /*---------------------------------------------------*/
 #ifndef BZ_NO_STDIO
-void BZ2_bz__AssertH__fail ( int errcode )
+void netpgpv_BZ2_bz__AssertH__fail ( int errcode )
 {
    fprintf(stderr, 
       "\n\nbzip2/libbzip2: internal error number %d.\n"
@@ -138,7 +138,7 @@
       "timely and accurate bug reports eventually lead to higher\n"
       "quality software.  Thanks.  Julian Seward, 10 December 2007.\n\n",
       errcode,
-      BZ2_bzlibVersion()
+      netpgpv_BZ2_bzlibVersion()
    );
 
    if (errcode == 1007) {
@@ -249,7 +249,7 @@
 /*---------------------------------------------------*/
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzDecompressInit) 
+int BZ_API(netpgpv_BZ2_bzDecompressInit) 
                      ( bz_stream* strm, 
                        int        verbosity,
                        int        small )
@@ -444,7 +444,7 @@
 
 
 /*---------------------------------------------------*/
-__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
+__inline__ Int32 netpgpv_BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
 {
    Int32 nb, na, mid;
    nb = 0;
@@ -565,7 +565,7 @@
 
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
+int BZ_API(netpgpv_BZ2_bzDecompress) ( bz_stream *strm )
 {
    Bool    corrupt;
    DState* s;
@@ -599,7 +599,7 @@
          }
       }
       if (s->state >= BZ_X_MAGIC_1) {
-         Int32 r = BZ2_decompress ( s );
+         Int32 r = netpgpv_BZ2_decompress ( s );
          if (r == BZ_STREAM_END) {
             if (s->verbosity >= 3)
                VPrintf2 ( "\n    combined CRCs: stored = 0x%08x, computed = 0x%08x", 
@@ -619,7 +619,7 @@
 
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzDecompressEnd)  ( bz_stream *strm )
+int BZ_API(netpgpv_BZ2_bzDecompressEnd)  ( bz_stream *strm )
 {
    DState* s;
    if (strm == NULL) return BZ_PARAM_ERROR;
@@ -673,7 +673,7 @@
 
 
 /*---------------------------------------------------*/
-BZFILE* BZ_API(BZ2_bzReadOpen) 
+BZFILE* BZ_API(netpgpv_BZ2_bzReadOpen) 
                    ( int*  bzerror, 
                      FILE* f, 
                      int   verbosity,
@@ -720,7 +720,7 @@
       nUnused--;
    }
 
-   ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );
+   ret = netpgpv_BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );
    if (ret != BZ_OK)
       { BZ_SETERR(ret); free(bzf); return NULL; };
 
@@ -733,7 +733,7 @@
 
 
 /*---------------------------------------------------*/
-void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b )
+void BZ_API(netpgpv_BZ2_bzReadClose) ( int *bzerror, BZFILE *b )
 {
    bzFile* bzf = (bzFile*)b;
 
@@ -745,13 +745,13 @@
       { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
 
    if (bzf->initialisedOk)
-      (void)BZ2_bzDecompressEnd ( &(bzf->strm) );
+      (void)netpgpv_BZ2_bzDecompressEnd ( &(bzf->strm) );
    free ( bzf );
 }
 
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzRead) 
+int BZ_API(netpgpv_BZ2_bzRead) 
            ( int*    bzerror, 
              BZFILE* b, 
              void*   buf, 
@@ -789,7 +789,7 @@
          bzf->strm.next_in = bzf->buf;
       }
 
-      ret = BZ2_bzDecompress ( &(bzf->strm) );
+      ret = netpgpv_BZ2_bzDecompress ( &(bzf->strm) );
 
       if (ret != BZ_OK && ret != BZ_STREAM_END)
          { BZ_SETERR(ret); return 0; };
@@ -811,7 +811,7 @@
 
 
 /*---------------------------------------------------*/
-void BZ_API(BZ2_bzReadGetUnused) 
+void BZ_API(netpgpv_BZ2_bzReadGetUnused) 
                      ( int*    bzerror, 
                        BZFILE* b, 
                        void**  unused, 
@@ -833,7 +833,7 @@
 
 
 /*---------------------------------------------------*/
-int BZ_API(BZ2_bzBuffToBuffDecompress) 
+int BZ_API(netpgpv_BZ2_bzBuffToBuffDecompress) 
                            ( char*         dest, 
                              unsigned int* destLen,
                              char*         source, 
@@ -853,7 +853,7 @@
    strm.bzalloc = NULL;
    strm.bzfree = NULL;
    strm.opaque = NULL;
-   ret = BZ2_bzDecompressInit ( &strm, verbosity, small );
+   ret = netpgpv_BZ2_bzDecompressInit ( &strm, verbosity, small );
    if (ret != BZ_OK) return ret;
 
    strm.next_in = source;
@@ -861,26 +861,26 @@
    strm.avail_in = sourceLen;
    strm.avail_out = *destLen;
 
-   ret = BZ2_bzDecompress ( &strm );
+   ret = netpgpv_BZ2_bzDecompress ( &strm );
    if (ret == BZ_OK) goto output_overflow_or_eof;
    if (ret != BZ_STREAM_END) goto errhandler;
 
    /* normal termination */
    *destLen -= strm.avail_out;
-   BZ2_bzDecompressEnd ( &strm );
+   netpgpv_BZ2_bzDecompressEnd ( &strm );
    return BZ_OK;
 
    output_overflow_or_eof:
    if (strm.avail_out > 0) {
-      BZ2_bzDecompressEnd ( &strm );
+      netpgpv_BZ2_bzDecompressEnd ( &strm );
       return BZ_UNEXPECTED_EOF;
    } else {
-      BZ2_bzDecompressEnd ( &strm );
+      netpgpv_BZ2_bzDecompressEnd ( &strm );
       return BZ_OUTBUFF_FULL;
    };      
 
    errhandler:
-   BZ2_bzDecompressEnd ( &strm );
+   netpgpv_BZ2_bzDecompressEnd ( &strm );
    return ret; 
 }
 
@@ -900,7 +900,7 @@
 /*--
    return version like "0.9.5d, 4-Sept-1999".
 --*/
-const char * BZ_API(BZ2_bzlibVersion)(void)
+const char * BZ_API(netpgpv_BZ2_bzlibVersion)(void)
 {
    return BZ_VERSION;
 }
@@ -973,7 +973,7 @@
 
    if (writing) {
    } else {
-      bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode,
+      bzfp = netpgpv_BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode,
                             unused,nUnused);
    }
    if (bzfp == NULL) {
@@ -990,7 +990,7 @@
       ex) bzopen("file","w9")
       case path="" or NULL => use stdin or stdout.
 --*/
-BZFILE * BZ_API(BZ2_bzopen)
+BZFILE * BZ_API(netpgpv_BZ2_bzopen)
                ( const char *path,
                  const char *mode )
 {
@@ -999,7 +999,7 @@
 
 
 /*---------------------------------------------------*/
-BZFILE * BZ_API(BZ2_bzdopen)
+BZFILE * BZ_API(netpgpv_BZ2_bzdopen)



Home | Main Index | Thread Index | Old Index