pkgsrc-Changes archive

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

CVS commit: pkgsrc/sysutils/radmind



Module Name:    pkgsrc
Committed By:   hauke
Date:           Fri May  3 11:04:34 UTC 2019

Modified Files:
        pkgsrc/sysutils/radmind: Makefile distinfo
        pkgsrc/sysutils/radmind/patches: patch-Makefile.in patch-retr.c
Added Files:
        pkgsrc/sysutils/radmind/patches: patch-cksum.c patch-openssl__compat.c
            patch-openssl__compat.h patch-stor.c patch-t2pkg.c

Log Message:
Add openssl 1.1 support, while maintaining compatibility to 1.0, from
upstream <https://github.com/Radmind/radmind/pull/320> with minor
changes.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 pkgsrc/sysutils/radmind/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/sysutils/radmind/distinfo
cvs rdiff -u -r1.2 -r1.3 pkgsrc/sysutils/radmind/patches/patch-Makefile.in \
    pkgsrc/sysutils/radmind/patches/patch-retr.c
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/radmind/patches/patch-cksum.c \
    pkgsrc/sysutils/radmind/patches/patch-openssl__compat.c \
    pkgsrc/sysutils/radmind/patches/patch-openssl__compat.h \
    pkgsrc/sysutils/radmind/patches/patch-stor.c \
    pkgsrc/sysutils/radmind/patches/patch-t2pkg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/sysutils/radmind/Makefile
diff -u pkgsrc/sysutils/radmind/Makefile:1.38 pkgsrc/sysutils/radmind/Makefile:1.39
--- pkgsrc/sysutils/radmind/Makefile:1.38       Tue Dec 18 14:16:17 2018
+++ pkgsrc/sysutils/radmind/Makefile    Fri May  3 11:04:34 2019
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.38 2018/12/18 14:16:17 hauke Exp $
+# $NetBSD: Makefile,v 1.39 2019/05/03 11:04:34 hauke Exp $
 #
 
 DISTNAME=      radmind-1.14.1
-PKGREVISION=   7
+PKGREVISION=   8
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=radmind/}
 
@@ -25,12 +25,16 @@ BUILD_TARGET=               all man rash
 RADMINDDIR=            ${VARBASE}/radmind
 BUILD_DEFS+=           VARBASE
 
+RCD_SCRIPTS=           radmind
+
 OWN_DIRS_PERMS+=       ${RADMINDDIR} ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0750
-OWN_DIRS_PERMS+=       ${RADMINDDIR}/client ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0750
-OWN_DIRS_PERMS+=       ${RADMINDDIR}/preapply ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0750
-OWN_DIRS_PERMS+=       ${RADMINDDIR}/postapply ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0750
 OWN_DIRS_PERMS+=       ${RADMINDDIR}/cert ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0700
-RCD_SCRIPTS=           radmind
+OWN_DIRS_PERMS+=       ${RADMINDDIR}/client ${REAL_ROOT_USER} \
+                       ${REAL_ROOT_GROUP} 0750
+OWN_DIRS_PERMS+=       ${RADMINDDIR}/preapply ${REAL_ROOT_USER} \
+                       ${REAL_ROOT_GROUP} 0750
+OWN_DIRS_PERMS+=       ${RADMINDDIR}/postapply ${REAL_ROOT_USER} \
+                       ${REAL_ROOT_GROUP} 0750
 
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../security/openssl/buildlink3.mk"

Index: pkgsrc/sysutils/radmind/distinfo
diff -u pkgsrc/sysutils/radmind/distinfo:1.22 pkgsrc/sysutils/radmind/distinfo:1.23
--- pkgsrc/sysutils/radmind/distinfo:1.22       Tue Dec 18 14:16:17 2018
+++ pkgsrc/sysutils/radmind/distinfo    Fri May  3 11:04:34 2019
@@ -1,10 +1,11 @@
-$NetBSD: distinfo,v 1.22 2018/12/18 14:16:17 hauke Exp $
+$NetBSD: distinfo,v 1.23 2019/05/03 11:04:34 hauke Exp $
 
 SHA1 (radmind-1.14.1.tar.gz) = 26f37f1c002384a9c609e688d6cee2fa15b6d0d2
 RMD160 (radmind-1.14.1.tar.gz) = 6b925083ef9dce2de21ebb0ffef287b1ffe9173d
 SHA512 (radmind-1.14.1.tar.gz) = bccf9681a6899be3b500065237dd1e04cd83ffb6f9be0e355412e7b0c556325f7d13435cec65a8a5e156e4411da915744f01a615472f6361d52c4d54d8be20eb
 Size (radmind-1.14.1.tar.gz) = 403553 bytes
-SHA1 (patch-Makefile.in) = 7667b83fe2984eaa2487c75a3f82eede0cda06e2
+SHA1 (patch-Makefile.in) = b7222e8854172104545f3bfd10b843cc3df85ce8
+SHA1 (patch-cksum.c) = ff9218d189c348e4da5a7bebb5a74473ec79e9ce
 SHA1 (patch-command.c) = 26e93be15a5a1113b8f75eb6eaf1d77892947bc7
 SHA1 (patch-command.h) = 03daa77363c681ef625cf429071f02245689e1e9
 SHA1 (patch-config.h.in) = 89bce7b9d256e81ebb6ce1319183cb346260bcde
@@ -14,7 +15,11 @@ SHA1 (patch-ktcheck.c) = 83c03e417fc9386
 SHA1 (patch-largefile.h) = 806f12878aa628f30355b82ac23a5c92740f42a1
 SHA1 (patch-lcksum.c) = 7b7b4da338bb13f2508c5b22307263eaedb32347
 SHA1 (patch-libsnet_snet.c) = 29484ae6775a1fe9d02980a84503762b55a093e9
+SHA1 (patch-openssl__compat.c) = 0076abec076f29764d86ec1fc3b0bf7092c7dd18
+SHA1 (patch-openssl__compat.h) = d73ce65dde6e48e378feded637b7b6a4d8e36047
 SHA1 (patch-ra.sh) = 05ba697814bf4833a9c38f881e43639067afba29
-SHA1 (patch-retr.c) = 8798a4467fad905aac5061ff1c9759c29f9b7f74
+SHA1 (patch-retr.c) = 7c76538c3159fa0e10e5a44c358f3091ad16d594
+SHA1 (patch-stor.c) = f0a5a94222513a02d6cae3f2141e592866765fcb
+SHA1 (patch-t2pkg.c) = 8c8379ad8e33fc07c83d04c944fb1e425775739c
 SHA1 (patch-transcript.c) = 2fab20d210317b0e0ba52102359588670ba5f941
 SHA1 (patch-update.c) = 2b951451fc1b91492eb0efe16d28e21c5e8d0470

Index: pkgsrc/sysutils/radmind/patches/patch-Makefile.in
diff -u pkgsrc/sysutils/radmind/patches/patch-Makefile.in:1.2 pkgsrc/sysutils/radmind/patches/patch-Makefile.in:1.3
--- pkgsrc/sysutils/radmind/patches/patch-Makefile.in:1.2       Tue Dec 18 14:16:18 2018
+++ pkgsrc/sysutils/radmind/patches/patch-Makefile.in   Fri May  3 11:04:34 2019
@@ -1,15 +1,77 @@
-$NetBSD: patch-Makefile.in,v 1.2 2018/12/18 14:16:18 hauke Exp $
+$NetBSD: patch-Makefile.in,v 1.3 2019/05/03 11:04:34 hauke Exp $
 
 Patch pkgsrc variables
 
---- Makefile.in.orig   2010-12-13 03:43:49.000000000 +0000
+Add openssl 1.0.x compatibility shims
+
+--- Makefile.in.orig   2019-05-02 14:26:24.379182232 +0000
 +++ Makefile.in
-@@ -269,6 +269,8 @@ rash : FRC
-           -e 's@_RADMIND_MAIL_DOMAIN@${RADMIND_MAIL_DOMAIN}@g' \
-           -e 's@_RADMIND_COMMANDFILE@${COMMANDFILE}@g' \
-           -e 's@_RADMIND_VERSION@$(shell cat VERSION)@g' \
-+          -e 's@_PKG_SYSCONFDIR@${PKG_SYSCONFDIR}@g' \
-+          -e 's@_LOCALBASE@${LOCALBASE}@g' \
-           -e 's@_RADMIND_ECHO_PATH@${ECHO}@g' \
-           ${srcdir}/ra.sh > tmp/ra.sh; 
+@@ -56,42 +56,48 @@ TARGETS=        radmind ${BINTARGETS}
+ 
+ RADMIND_OBJ=    version.o daemon.o command.o argcargv.o code.o \
+                 cksum.o base64.o mkdirs.o applefile.o connect.o \
+-              list.o wildcard.o logname.o pathcmp.o tls.o
++              list.o wildcard.o logname.o pathcmp.o tls.o \
++              openssl_compat.o
+ 
+ FSDIFF_OBJ=     version.o fsdiff.o argcargv.o transcript.o llist.o code.o \
+                 hardlink.o cksum.o base64.o pathcmp.o radstat.o applefile.o \
+-              list.o wildcard.o
++              list.o wildcard.o openssl_compat.o
+ 
+ KTCHECK_OBJ=    version.o ktcheck.o argcargv.o retr.o base64.o code.o \
+                 cksum.o list.o llist.o connect.o applefile.o tls.o pathcmp.o \
+-              progress.o mkdirs.o report.o rmdirs.o mkprefix.o
++              progress.o mkdirs.o report.o rmdirs.o mkprefix.o \
++              openssl_compat.o
+ 
+ LAPPLY_OBJ=     version.o lapply.o argcargv.o code.o base64.o retr.o \
+                 radstat.o update.o cksum.o connect.o pathcmp.o progress.o \
+-                applefile.o report.o tls.o mkprefix.o
++                applefile.o report.o tls.o mkprefix.o openssl_compat.o
+ 
+ LCREATE_OBJ=    version.o lcreate.o argcargv.o code.o connect.o progress.o \
+-                stor.o applefile.o base64.o cksum.o radstat.o tls.o
++                stor.o applefile.o base64.o cksum.o radstat.o tls.o \
++              openssl_compat.o
+ 
+ LCKSUM_OBJ=     version.o lcksum.o argcargv.o cksum.o base64.o code.o \
+-                progress.o pathcmp.o applefile.o connect.o root.o
++                progress.o pathcmp.o applefile.o connect.o root.o \
++              openssl_compat.o
+ 
+ LMERGE_OBJ=     version.o lmerge.o argcargv.o code.o pathcmp.o mkdirs.o \
+               root.o
+ 
+ LFDIFF_OBJ=     version.o lfdiff.o argcargv.o connect.o retr.o cksum.o \
+                 progress.o base64.o applefile.o code.o tls.o pathcmp.o \
+-              transcript.o list.o radstat.o hardlink.o mkprefix.o wildcard.o
++              transcript.o list.o radstat.o hardlink.o mkprefix.o \
++              wildcard.o openssl_compat.o
+ 
+ REPO_OBJ=     version.o repo.o report.o argcargv.o connect.o code.o tls.o
+ 
+ T2PKG_OBJ=    version.o t2pkg.o argcargv.o transcript.o connect.o code.o \
+               hardlink.o cksum.o base64.o pathcmp.o radstat.o applefile.o \
+-              list.o rmdirs.o mkdirs.o wildcard.o progress.o
++              list.o rmdirs.o mkdirs.o wildcard.o progress.o \
++              openssl_compat.o
+ 
+ TWHICH_OBJ=     version.o twhich.o argcargv.o transcript.o llist.o code.o \
+                 hardlink.o cksum.o base64.o pathcmp.o radstat.o applefile.o \
+-              list.o wildcard.o
++              list.o wildcard.o openssl_compat.o
+ 
+ LSORT_OBJ=     version.o lsort.o pathcmp.o code.o argcargv.o
+ 
+@@ -102,6 +108,10 @@ version.o : version.c
+               -DVERSION=\"`cat ${srcdir}/VERSION`\" \
+               -c ${srcdir}/version.c
  
++openssl_compat.o : openssl_compat.c
++      ${CC} ${CFLAGS} \
++      -c ${srcdir}/openssl_compat.c
++
+ transcript.o : transcript.c
+       ${CC} ${CFLAGS} \
+               -D_RADMIND_PATH=\"${RADMINDDIR}\" \
Index: pkgsrc/sysutils/radmind/patches/patch-retr.c
diff -u pkgsrc/sysutils/radmind/patches/patch-retr.c:1.2 pkgsrc/sysutils/radmind/patches/patch-retr.c:1.3
--- pkgsrc/sysutils/radmind/patches/patch-retr.c:1.2    Tue Dec 18 14:16:18 2018
+++ pkgsrc/sysutils/radmind/patches/patch-retr.c        Fri May  3 11:04:34 2019
@@ -1,14 +1,128 @@
-$NetBSD: patch-retr.c,v 1.2 2018/12/18 14:16:18 hauke Exp $
+$NetBSD: patch-retr.c,v 1.3 2019/05/03 11:04:34 hauke Exp $
 
 Remove stale extern declaration
 
---- retr.c.orig        2010-12-13 03:42:49.000000000 +0000
+Move to openssl 1.1 api
+
+--- retr.c.orig        2019-05-02 14:26:24.815072747 +0000
 +++ retr.c
-@@ -47,7 +47,6 @@ extern int           verbose;
- extern int            showprogress;
- extern int            dodots;
- extern int            cksum;
--extern int            errno;
- extern int            create_prefix;
- extern SSL_CTX        *ctx;
+@@ -31,6 +31,7 @@
+ 
+ #include <snet.h>
+ 
++#include "openssl_compat.h"
+ #include "applefile.h"
+ #include "connect.h"
+ #include "cksum.h"
+@@ -73,7 +74,7 @@ retr( SNET *sn, char *pathdesc, char *pa
+     char              buf[ 8192 ]; 
+     ssize_t           rr;
+     extern EVP_MD     *md;
+-    EVP_MD_CTX                mdctx;
++    EVP_MD_CTX                *mdctx = EVP_MD_CTX_new();
+     unsigned char     md_value[ EVP_MAX_MD_SIZE ];
+     char              cksum_b64[ SZ_BASE64_E( EVP_MAX_MD_SIZE ) ];
+ 
+@@ -83,7 +84,7 @@ retr( SNET *sn, char *pathdesc, char *pa
+           fprintf( stderr, "%s\n", pathdesc );
+           return( 1 );
+       }
+-      EVP_DigestInit( &mdctx, md );
++      EVP_DigestInit( mdctx, md );
+     }
+ 
+     if ( verbose ) printf( ">>> RETR %s\n", pathdesc );
+@@ -164,7 +165,7 @@ retr( SNET *sn, char *pathdesc, char *pa
+           goto error2;
+       }
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, buf, (unsigned int)rr );
++          EVP_DigestUpdate( mdctx, buf, (unsigned int)rr );
+       }
+       if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+       size -= rr;
+@@ -196,8 +197,9 @@ retr( SNET *sn, char *pathdesc, char *pa
+ 
+     /* cksum file */
+     if ( cksum ) {
+-      EVP_DigestFinal( &mdctx, md_value, &md_len );
++      EVP_DigestFinal( mdctx, md_value, &md_len );
+       base64_e( md_value, md_len, cksum_b64 );
++      EVP_MD_CTX_free(mdctx);
+       if ( strcmp( trancksum, cksum_b64 ) != 0 ) {
+           fprintf( stderr, "line %d: checksum in transcript does not match "
+               "checksum from server\n", linenum );
+@@ -245,7 +247,7 @@ retr_applefile( SNET *sn, char *pathdesc
+     struct as_entry           ae_ents[ 3 ]; 
+     struct timeval            tv;
+     extern EVP_MD             *md;
+-    EVP_MD_CTX                mdctx;
++    EVP_MD_CTX                *mdctx;
+     unsigned char             md_value[ EVP_MAX_MD_SIZE ];
+     char                      cksum_b64[ SZ_BASE64_E( EVP_MAX_MD_SIZE ) ];
+ 
+@@ -255,7 +257,7 @@ retr_applefile( SNET *sn, char *pathdesc
+           fprintf( stderr, "%s\n", pathdesc );
+             return( 1 );
+         }
+-        EVP_DigestInit( &mdctx, md );
++        EVP_DigestInit( mdctx, md );
+     }
+ 
+     if ( verbose ) printf( ">>> RETR %s\n", pathdesc );
+@@ -315,7 +317,7 @@ retr_applefile( SNET *sn, char *pathdesc
+       return( -1 );
+     }
+     if ( cksum ) {
+-      EVP_DigestUpdate( &mdctx, (char *)&ah, (unsigned int)rc );
++      EVP_DigestUpdate( mdctx, (char *)&ah, (unsigned int)rc );
+     }
+ 
+     /* name temp file */
+@@ -372,7 +374,7 @@ retr_applefile( SNET *sn, char *pathdesc
+     /* Should we check for valid ae_ents here? YES! */
+ 
+     if ( cksum ) {
+-      EVP_DigestUpdate( &mdctx, (char *)&ae_ents, (unsigned int)rc );
++      EVP_DigestUpdate( mdctx, (char *)&ae_ents, (unsigned int)rc );
+     }
+     if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+ 
+@@ -397,7 +399,7 @@ retr_applefile( SNET *sn, char *pathdesc
+       goto error2;
+     }
+     if ( cksum ) {
+-      EVP_DigestUpdate( &mdctx, finfo, (unsigned int)rc );
++      EVP_DigestUpdate( mdctx, finfo, (unsigned int)rc );
+     }
+     if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+     size -= rc;
+@@ -447,7 +449,7 @@ retr_applefile( SNET *sn, char *pathdesc
+               goto error3;
+           }
+           if ( cksum ) {
+-              EVP_DigestUpdate( &mdctx, buf, (unsigned int)rc );
++              EVP_DigestUpdate( mdctx, buf, (unsigned int)rc );
+           }
+           if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+           if ( showprogress ) {
+@@ -481,7 +483,7 @@ retr_applefile( SNET *sn, char *pathdesc
+       }
+ 
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, buf, (unsigned int)rc );
++          EVP_DigestUpdate( mdctx, buf, (unsigned int)rc );
+       }
+       if ( dodots ) { putc( '.', stdout ); fflush( stdout); }
+       if ( showprogress ) {
+@@ -522,8 +524,9 @@ retr_applefile( SNET *sn, char *pathdesc
+     if ( verbose ) printf( "<<< .\n" );
  
+     if ( cksum ) {
+-      EVP_DigestFinal( &mdctx, md_value, &md_len );
++      EVP_DigestFinal( mdctx, md_value, &md_len );
+       base64_e(( char*)&md_value, md_len, cksum_b64 );
++        EVP_MD_CTX_free(mdctx);
+         if ( strcmp( trancksum, cksum_b64 ) != 0 ) {
+           fprintf( stderr, "line %d: checksum in transcript does not match "
+               "checksum from server\n", linenum );

Added files:

Index: pkgsrc/sysutils/radmind/patches/patch-cksum.c
diff -u /dev/null pkgsrc/sysutils/radmind/patches/patch-cksum.c:1.1
--- /dev/null   Fri May  3 11:04:34 2019
+++ pkgsrc/sysutils/radmind/patches/patch-cksum.c       Fri May  3 11:04:34 2019
@@ -0,0 +1,102 @@
+$NetBSD: patch-cksum.c,v 1.1 2019/05/03 11:04:34 hauke Exp $
+
+Move to openssl 1.1 api
+
+--- cksum.c.orig       2010-12-13 03:42:49.000000000 +0000
++++ cksum.c
+@@ -20,6 +20,7 @@
+ 
+ #include <openssl/evp.h>
+ 
++#include "openssl_compat.h"
+ #include "applefile.h"
+ #include "cksum.h"
+ #include "base64.h"
+@@ -41,21 +42,22 @@ do_fcksum( int fd, char *cksum_b64 )
+     off_t             size = 0;
+     unsigned char     buf[ 8192 ];
+     extern EVP_MD     *md;
+-    EVP_MD_CTX                mdctx;
++    EVP_MD_CTX                *mdctx = EVP_MD_CTX_new();
+     unsigned char     md_value[ EVP_MAX_MD_SIZE ];
+ 
+-    EVP_DigestInit( &mdctx, md );
++    EVP_DigestInit( mdctx, md );
+ 
+     while (( rr = read( fd, buf, sizeof( buf ))) > 0 ) {
+       size += rr;
+-      EVP_DigestUpdate( &mdctx, buf, (unsigned int)rr );
++      EVP_DigestUpdate( mdctx, buf, (unsigned int)rr );
+     }
+     if ( rr < 0 ) {
+       return( -1 );
+     }
+ 
+-    EVP_DigestFinal( &mdctx, md_value, &md_len );
++    EVP_DigestFinal( mdctx, md_value, &md_len );
+     base64_e( md_value, md_len, cksum_b64 );
++    EVP_MD_CTX_free(mdctx);
+ 
+     return( size );
+ }
+@@ -103,13 +105,13 @@ do_acksum( char *path, char *cksum_b64, 
+     struct as_entry           as_entries_endian[ 3 ];
+     unsigned int              md_len;
+     extern EVP_MD             *md;
+-    EVP_MD_CTX                mdctx;
++    EVP_MD_CTX                *mdctx = EVP_MD_CTX_new();
+     unsigned char             md_value[ EVP_MAX_MD_SIZE ];
+ 
+-    EVP_DigestInit( &mdctx, md ); 
++    EVP_DigestInit( mdctx, md ); 
+ 
+     /* checksum applesingle header */
+-    EVP_DigestUpdate( &mdctx, (char *)&as_header, AS_HEADERLEN );
++    EVP_DigestUpdate( mdctx, (char *)&as_header, AS_HEADERLEN );
+     size += (size_t)AS_HEADERLEN;
+ 
+     /* endian handling, sum big-endian header entries */
+@@ -120,12 +122,12 @@ do_acksum( char *path, char *cksum_b64, 
+     as_entry_netswap( &as_entries_endian[ AS_DFE ] );
+ 
+     /* checksum header entries */
+-    EVP_DigestUpdate( &mdctx, (char *)&as_entries_endian,
++    EVP_DigestUpdate( mdctx, (char *)&as_entries_endian,
+               (unsigned int)( 3 * sizeof( struct as_entry )));
+     size += sizeof( 3 * sizeof( struct as_entry ));
+ 
+     /* checksum finder info data */
+-    EVP_DigestUpdate( &mdctx, afinfo->ai.ai_data, FINFOLEN );
++    EVP_DigestUpdate( mdctx, afinfo->ai.ai_data, FINFOLEN );
+     size += FINFOLEN;
+ 
+     /* checksum rsrc fork data */
+@@ -140,7 +142,7 @@ do_acksum( char *path, char *cksum_b64, 
+           return( -1 );
+       }
+       while (( rc = read( rfd, buf, sizeof( buf ))) > 0 ) {
+-          EVP_DigestUpdate( &mdctx, buf, (unsigned int)rc );
++          EVP_DigestUpdate( mdctx, buf, (unsigned int)rc );
+           size += (size_t)rc;
+       }
+       if ( close( rfd ) < 0 ) {
+@@ -156,7 +158,7 @@ do_acksum( char *path, char *cksum_b64, 
+     }
+     /* checksum data fork */
+     while (( rc = read( dfd, buf, sizeof( buf ))) > 0 ) {
+-      EVP_DigestUpdate( &mdctx, buf, (unsigned int)rc );
++      EVP_DigestUpdate( mdctx, buf, (unsigned int)rc );
+       size += (size_t)rc;
+     }
+     if ( rc < 0 ) {
+@@ -166,8 +168,9 @@ do_acksum( char *path, char *cksum_b64, 
+       return( -1 );
+     }
+ 
+-    EVP_DigestFinal( &mdctx, md_value, &md_len );
++    EVP_DigestFinal( mdctx, md_value, &md_len );
+     base64_e( ( char*)&md_value, md_len, cksum_b64 );
++    EVP_MD_CTX_free();
+ 
+     return( size );
+ }
Index: pkgsrc/sysutils/radmind/patches/patch-openssl__compat.c
diff -u /dev/null pkgsrc/sysutils/radmind/patches/patch-openssl__compat.c:1.1
--- /dev/null   Fri May  3 11:04:34 2019
+++ pkgsrc/sysutils/radmind/patches/patch-openssl__compat.c     Fri May  3 11:04:34 2019
@@ -0,0 +1,38 @@
+$NetBSD: patch-openssl__compat.c,v 1.1 2019/05/03 11:04:34 hauke Exp $
+
+Provide compatibility shims for building with openssl 1.0
+
+--- openssl_compat.c.orig      2019-05-03 10:46:27.805935157 +0000
++++ openssl_compat.c
+@@ -0,0 +1,31 @@
++/*
++ * OpenSSL Compatibility Shims for pre-1.1.0
++ *
++*/
++#include <string.h>
++#include <openssl/engine.h>
++#include "openssl_compat.h"
++
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++
++static void *OPENSSL_zalloc(size_t num)
++{
++   void *ret = OPENSSL_malloc(num);
++
++   if (ret != NULL)
++       memset(ret, 0, num);
++   return ret;
++}
++
++EVP_MD_CTX *EVP_MD_CTX_new(void)
++{
++    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
++}
++
++void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
++{
++   EVP_MD_CTX_cleanup(ctx);
++   OPENSSL_free(ctx);
++}
++
++#endif /* OPENSSL_VERSION_NUMBER */
Index: pkgsrc/sysutils/radmind/patches/patch-openssl__compat.h
diff -u /dev/null pkgsrc/sysutils/radmind/patches/patch-openssl__compat.h:1.1
--- /dev/null   Fri May  3 11:04:34 2019
+++ pkgsrc/sysutils/radmind/patches/patch-openssl__compat.h     Fri May  3 11:04:34 2019
@@ -0,0 +1,25 @@
+$NetBSD: patch-openssl__compat.h,v 1.1 2019/05/03 11:04:34 hauke Exp $
+
+Provide compatibility shims for building with openssl 1.0
+
+--- openssl_compat.h.orig      2019-05-03 10:46:27.814125691 +0000
++++ openssl_compat.h
+@@ -0,0 +1,18 @@
++/*
++ * OpenSSL Compatibility Shims for pre-1.1.0
++ *
++*/
++#ifndef RADMIND_OPENSSL_SHIMS
++#define RADMIND_OPENSSL_SHIMS
++
++#include <openssl/opensslv.h>
++
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#include <string.h>
++#include <openssl/engine.h>
++
++EVP_MD_CTX *EVP_MD_CTX_new(void);
++void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
++
++#endif /* OPENSSL_VERSION_NUMBER */
++#endif /* RADMIND_OPENSSL_SHIMS */
Index: pkgsrc/sysutils/radmind/patches/patch-stor.c
diff -u /dev/null pkgsrc/sysutils/radmind/patches/patch-stor.c:1.1
--- /dev/null   Fri May  3 11:04:34 2019
+++ pkgsrc/sysutils/radmind/patches/patch-stor.c        Fri May  3 11:04:34 2019
@@ -0,0 +1,126 @@
+$NetBSD: patch-stor.c,v 1.1 2019/05/03 11:04:34 hauke Exp $
+
+Move to openssl 1.1 api
+
+--- stor.c.orig        2010-12-13 03:42:49.000000000 +0000
++++ stor.c
+@@ -32,6 +32,7 @@
+ 
+ #include <snet.h>
+ 
++#include "openssl_compat.h"
+ #include "applefile.h"
+ #include "connect.h"
+ #include "cksum.h"
+@@ -136,7 +137,7 @@ stor_file( SNET *sn, char *pathdesc, cha
+     ssize_t             rr, size = 0;
+     unsigned int      md_len;
+     extern EVP_MD       *md;
+-    EVP_MD_CTX          mdctx;
++    EVP_MD_CTX          *mdctx = EVP_MD_CTX_new();
+     unsigned char       md_value[ EVP_MAX_MD_SIZE ];
+     char       cksum_b64[ SZ_BASE64_E( EVP_MAX_MD_SIZE ) ];
+ 
+@@ -146,7 +147,7 @@ stor_file( SNET *sn, char *pathdesc, cha
+           fprintf( stderr, "line %d: No checksum listed\n", linenum );
+           exit( 2 );
+         }
+-      EVP_DigestInit( &mdctx, md );
++      EVP_DigestInit( mdctx, md );
+     }
+ 
+     /* Open and stat file */
+@@ -202,7 +203,7 @@ stor_file( SNET *sn, char *pathdesc, cha
+       size -= rr;
+       if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, buf, (unsigned int)rr );
++          EVP_DigestUpdate( mdctx, buf, (unsigned int)rr );
+       }
+       
+       if ( showprogress ) {
+@@ -237,8 +238,9 @@ stor_file( SNET *sn, char *pathdesc, cha
+ 
+     /* cksum data sent */
+     if ( cksum ) {
+-      EVP_DigestFinal( &mdctx, md_value, &md_len );
++      EVP_DigestFinal( mdctx, md_value, &md_len );
+       base64_e( md_value, md_len, cksum_b64 );
++      EVP_MD_CTX_free(mdctx);
+         if ( strcmp( trancksum, cksum_b64 ) != 0 ) {
+           fprintf( stderr,
+               "line %d: checksum listed in transcript wrong\n", linenum );
+@@ -262,7 +264,7 @@ stor_applefile( SNET *sn, char *pathdesc
+     unsigned int              md_len;
+     unsigned int      rsrc_len;
+     extern EVP_MD             *md;
+-    EVP_MD_CTX                mdctx;
++    EVP_MD_CTX                *mdctx = EVP_MD_CTX_new();
+     unsigned char     md_value[ EVP_MAX_MD_SIZE ];
+     char              cksum_b64[ EVP_MAX_MD_SIZE ];
+ 
+@@ -272,7 +274,7 @@ stor_applefile( SNET *sn, char *pathdesc
+           fprintf( stderr, "line %d: No checksum listed\n", linenum );
+           exit( 2 );
+         }
+-        EVP_DigestInit( &mdctx, md );
++        EVP_DigestInit( mdctx, md );
+     }
+ 
+     /* Check size listed in transcript */
+@@ -339,7 +341,7 @@ stor_applefile( SNET *sn, char *pathdesc
+     }
+     size -= AS_HEADERLEN;
+     if ( cksum ) {
+-      EVP_DigestUpdate( &mdctx, (char *)&as_header, AS_HEADERLEN );
++      EVP_DigestUpdate( mdctx, (char *)&as_header, AS_HEADERLEN );
+     }
+     if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+     if ( showprogress ) {
+@@ -357,7 +359,7 @@ stor_applefile( SNET *sn, char *pathdesc
+     }
+     size -= ( 3 * sizeof( struct as_entry ));
+     if ( cksum ) {
+-      EVP_DigestUpdate( &mdctx, (char *)&afinfo->as_ents,
++      EVP_DigestUpdate( mdctx, (char *)&afinfo->as_ents,
+           (unsigned int)( 3 * sizeof( struct as_entry )));
+     }
+     if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+@@ -375,7 +377,7 @@ stor_applefile( SNET *sn, char *pathdesc
+     }
+     size -= FINFOLEN;
+     if ( cksum ) {
+-      EVP_DigestUpdate( &mdctx, afinfo->ai.ai_data, FINFOLEN );
++      EVP_DigestUpdate( mdctx, afinfo->ai.ai_data, FINFOLEN );
+     }
+     if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+     if ( showprogress ) {
+@@ -393,7 +395,7 @@ stor_applefile( SNET *sn, char *pathdesc
+           }
+           size -= rc;
+           if ( cksum ) {
+-              EVP_DigestUpdate( &mdctx, buf, (unsigned int)rc );
++              EVP_DigestUpdate( mdctx, buf, (unsigned int)rc );
+           } 
+           if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+           if ( showprogress ) {
+@@ -417,7 +419,7 @@ stor_applefile( SNET *sn, char *pathdesc
+       }
+       size -= rc;
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, buf, (unsigned int)rc );
++          EVP_DigestUpdate( mdctx, buf, (unsigned int)rc );
+       }
+       if ( dodots ) { putc( '.', stdout ); fflush( stdout ); }
+       if ( showprogress ) {
+@@ -463,8 +465,9 @@ stor_applefile( SNET *sn, char *pathdesc
+ 
+     /* cksum data sent */
+     if ( cksum ) {
+-        EVP_DigestFinal( &mdctx, md_value, &md_len );
++        EVP_DigestFinal( mdctx, md_value, &md_len );
+         base64_e( ( char*)&md_value, md_len, cksum_b64 );
++      EVP_MD_CTX_free(mdctx);
+         if ( strcmp( trancksum, cksum_b64 ) != 0 ) {
+           fprintf( stderr,
+               "line %d: checksum listed in transcript wrong\n", linenum );
Index: pkgsrc/sysutils/radmind/patches/patch-t2pkg.c
diff -u /dev/null pkgsrc/sysutils/radmind/patches/patch-t2pkg.c:1.1
--- /dev/null   Fri May  3 11:04:34 2019
+++ pkgsrc/sysutils/radmind/patches/patch-t2pkg.c       Fri May  3 11:04:34 2019
@@ -0,0 +1,124 @@
+$NetBSD: patch-t2pkg.c,v 1.1 2019/05/03 11:04:34 hauke Exp $
+
+Move to openssl 1.1 api
+
+--- t2pkg.c.orig       2010-12-13 03:42:49.000000000 +0000
++++ t2pkg.c
+@@ -23,6 +23,7 @@
+ #include <sys/vfs.h>
+ #endif /* linux */
+ 
++#include "openssl_compat.h"
+ #include "applefile.h"
+ #include "base64.h"
+ #include "transcript.h"
+@@ -61,7 +62,7 @@ copy_file( struct transcript *t, char *d
+     char              *trancksum = t->t_pinfo.pi_cksum_b64;
+     char              *path = t->t_pinfo.pi_name;
+     ssize_t           rr, size = 0;
+-    EVP_MD_CTX          mdctx;
++    EVP_MD_CTX          *mdctx = EVP_MD_CTX_new();
+     unsigned char       md_value[ EVP_MAX_MD_SIZE ];
+     char                      cksum_b64[ SZ_BASE64_E( EVP_MAX_MD_SIZE ) ];
+ #ifdef __APPLE__
+@@ -83,7 +84,7 @@ copy_file( struct transcript *t, char *d
+           fprintf( stderr, "line %d: no checksum\n", t->t_linenum );
+           return( -1 );
+       }
+-      EVP_DigestInit( &mdctx, md );
++      EVP_DigestInit( mdctx, md );
+     }
+ 
+     if (( rfd = open( src, O_RDONLY, 0 )) < 0 ) {
+@@ -150,7 +151,7 @@ copy_file( struct transcript *t, char *d
+           goto error2;
+       }
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, ( char * )&header, ( unsigned int )rr );
++          EVP_DigestUpdate( mdctx, ( char * )&header, ( unsigned int )rr );
+       }
+       size -= rr;
+       if ( showprogress ) {
+@@ -175,7 +176,7 @@ copy_file( struct transcript *t, char *d
+       as_entry_netswap( &as_ents[ AS_DFE ] );
+ 
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, ( char * )&as_ents, ( unsigned int )rr );
++          EVP_DigestUpdate( mdctx, ( char * )&as_ents, ( unsigned int )rr );
+       }
+       size -= rr;
+       if ( showprogress ) {
+@@ -198,7 +199,7 @@ copy_file( struct transcript *t, char *d
+           goto error2;
+       }
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, finfo, ( unsigned int )rr );
++          EVP_DigestUpdate( mdctx, finfo, ( unsigned int )rr );
+       }
+       if ( showprogress ) {
+           progressupdate( rr, path );
+@@ -229,7 +230,7 @@ copy_file( struct transcript *t, char *d
+               goto error2;
+           }
+           if ( cksum ) {
+-              EVP_DigestUpdate( &mdctx, buf, ( unsigned int )rr );
++              EVP_DigestUpdate( mdctx, buf, ( unsigned int )rr );
+           }
+           if ( showprogress ) {
+               progressupdate( rr, path );
+@@ -248,7 +249,7 @@ copy_file( struct transcript *t, char *d
+        * entries to the checksum digest.
+        */
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, &as_header, AS_HEADERLEN );
++          EVP_DigestUpdate( mdctx, &as_header, AS_HEADERLEN );
+ 
+           as_ents[AS_FIE].ae_id = ASEID_FINFO;
+           as_ents[AS_FIE].ae_offset = AS_HEADERLEN +
+@@ -274,7 +275,7 @@ copy_file( struct transcript *t, char *d
+           as_entry_netswap( &as_ents[ AS_RFE ] );
+           as_entry_netswap( &as_ents[ AS_DFE ] );
+ 
+-          EVP_DigestUpdate( &mdctx, ( char * )&as_ents,
++          EVP_DigestUpdate( mdctx, ( char * )&as_ents,
+                                           ( 3 * sizeof( struct as_entry )));
+       } 
+       size -= ( AS_HEADERLEN + ( 3 * sizeof( struct as_entry )) + FINFOLEN );
+@@ -292,7 +293,7 @@ copy_file( struct transcript *t, char *d
+           }
+       }
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, ai.ai_data, FINFOLEN );
++          EVP_DigestUpdate( mdctx, ai.ai_data, FINFOLEN );
+       }
+ 
+       /* read and write the finder info and rsrc fork from the system */
+@@ -318,7 +319,7 @@ copy_file( struct transcript *t, char *d
+                   goto error2;
+               }
+               if ( cksum ) {
+-                  EVP_DigestUpdate( &mdctx, buf, rr );
++                  EVP_DigestUpdate( mdctx, buf, rr );
+               }
+               size -= rr;
+               if ( showprogress ) {
+@@ -354,7 +355,7 @@ copy_file( struct transcript *t, char *d
+           goto error2;
+       }
+       if ( cksum ) {
+-          EVP_DigestUpdate( &mdctx, buf, rr );
++          EVP_DigestUpdate( mdctx, buf, rr );
+       }
+       size -= rr;
+       if ( showprogress ) {
+@@ -383,8 +384,9 @@ copy_file( struct transcript *t, char *d
+     }
+ 
+     if ( cksum ) {
+-      EVP_DigestFinal( &mdctx, md_value, &md_len );
++      EVP_DigestFinal( mdctx, md_value, &md_len );
+       base64_e( md_value, md_len, ( char * )cksum_b64 );
++        EVP_MD_CTX_free(mdctx);
+       if ( strcmp( trancksum, cksum_b64 ) != 0 ) {
+           if ( force ) {
+               fprintf( stderr, "warning: " );



Home | Main Index | Thread Index | Old Index