Check-in [641eee5dc4]
Overview
Comment:Updated to latest version of TclTLS and update common build system to deal with more diverse Tcl configure scripts
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:641eee5dc4622271cab46d24a10a8dfaeccdb94c
User & Date: rkeene on 2016-12-13 19:32:50
Other Links: manifest | tags
Context
2016-12-13
19:33
Updated to latest release of LibreSSL check-in: 80d6f159a6 user: rkeene tags: trunk
19:32
Updated to latest version of TclTLS and update common build system to deal with more diverse Tcl configure scripts check-in: 641eee5dc4 user: rkeene tags: trunk
2016-12-09
15:00
Updated to latest version of tcc4tcl check-in: 05b1c2cb3a user: rkeene tags: trunk
Changes

Modified common/common.sh from [5226117d88] to [de80aa2117].

   201    201   			CFLAGS="${save_cflags} -fPIC"
   202    202   		else
   203    203   			CFLAGS="${save_cflags}"
   204    204   		fi
   205    205   		export CFLAGS
   206    206   
   207    207   		if [ "${isshared}" = '0' ]; then
   208         -			sed 's@USE_TCL_STUBS@XXX_TCL_STUBS@g' configure > configure.new
   209         -
   210    208   			pkg_configure_shared_build='0'
   211    209   		else
   212         -			sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
   213         -
   214    210   			pkg_configure_shared_build='1'
   215    211   		fi
   216    212   
   217         -		cat configure.new > configure
   218         -		rm -f configure.new
          213  +		if [ "${isshared}" = '0' ]; then
          214  +			tryopt="${tryopt} --disable-stubs --enable-static"
          215  +		fi
          216  +
          217  +		if ! grep '[-]-disable-stubs' configure >/dev/null 2>/dev/null; then
          218  +			if [ "${isshared}" = '0' ]; then
          219  +				sed 's@USE_TCL_STUBS@XXX_TCL_STUBS@g' configure > configure.new
          220  +			else
          221  +				sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' configure > configure.new
          222  +			fi
          223  +
          224  +			cat configure.new > configure
          225  +			rm -f configure.new
          226  +		fi
   219    227   
   220    228   		./configure $tryopt --prefix="${installdir}" --exec-prefix="${installdir}" --libdir="${installdir}/lib" --with-tcl="${TCLCONFIGDIR}" "${configure_extra[@]}" ${CONFIGUREEXTRA} && break
   221    229   	done
   222    230   
   223    231   	return 0
   224    232   }
   225    233   

Modified tls/build.sh from [e69d6c7eca] to [1916312581].

     1      1   #! /usr/bin/env bash
     2      2   
     3      3   # BuildCompatible: KitCreator
     4      4   
     5         -version="1.6.7"
     6         -url="http://sourceforge.net/projects/tls/files/tls/${TLSVERS}/tls${TLSVERS}-src.tar.gz"
     7         -sha256='5119de3e5470359b97a8a00d861c9c48433571ee0167af0a952de66c99d3a3b8'
            5  +version="1.7.8"
            6  +url="http://tcltls.rkeene.org/uv/tcltls-${version}.tar.gz"
            7  +sha256='30ee49330db795f86bc850487421ea923fba7d95d4758b2a61eef3baf0fe0f9e'
            8  +configure_extra=('--enable-deterministic')
     8      9   
     9     10   function buildSSLLibrary() {
    10     11   	local version url hash
    11     12   	local archive
    12     13   
    13     14   	version='2.4.2'
    14     15   	url="http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${version}.tar.gz"
................................................................................
    43     44   	@echo Nothing to do
    44     45   _EOF_
    45     46   
    46     47   		${MAKE:-make} V=1 || exit 1
    47     48   
    48     49   		${MAKE:-make} V=1 install || exit 1
    49     50   	) || return 1
           51  +
           52  +	PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${SSLDIR}/lib/pkgconfig"
           53  +	export PKG_CONFIG_PATH
    50     54   
    51     55   	SSLDIR="$(pwd)/libressl-${version}/INST"
    52         -	addlibs_LOCALSSL="$(PKG_CONFIG_PATH="${SSLDIR}/lib/pkgconfig" "${PKG_CONFIG:-pkg-config}" libssl libcrypto --libs --static)"
           56  +
           57  +	return 0
    53     58   }
    54     59   
    55     60   function preconfigure() {
    56     61   	# Determine SSL directory
    57     62   	if [ -z "${CPP}" ]; then
    58     63   		CPP="${CC:-cc} -E"
    59     64   	fi
................................................................................
    75     80   			echo "Unable to find OpenSSL, aborting." >&2
    76     81   
    77     82   			return 1
    78     83   		fi
    79     84   	fi
    80     85   
    81     86   	# Add SSL library to configure options
    82         -	configure_extra=(--with-ssl-dir="${SSLDIR}")
    83         -
    84         -	# Disable SSLv2, newer SSL libraries drop support for it entirely
    85         -	CFLAGS="${CFLAGS} -DNO_SSL2=1"
    86         -
    87         -	# Disable SSLv3, newer SSL libraries drop support for it entirely
    88         -	CFLAGS="${CFLAGS} -DNO_SSL3=1"
    89         -	export CFLAGS
    90         -}
    91         -
    92         -function postconfigure() {
    93         -	local linkaddfile
    94         -	local addlibs
    95         -
    96         -	# Determine SSL library directory
    97         -	SSL_LIB_DIR="$(${MAKE:-make} --print-data-base | awk '/^SSL_LIB_DIR = /{ print }' | sed 's@^SSL_LIB_DIR = *@@')"
    98         -
    99         -	echo "SSL_LIB_DIR = ${SSL_LIB_DIR}"
           87  +	configure_extra=("${configure_extra[@]}" --with-openssl-dir="${SSLDIR}")
   100     88   }
   101     89   
   102     90   function postinstall() {
   103         -	# Create pkgIndex if needed
   104         -	if [ ! -e "${installdir}/lib/tls${version}/pkgIndex.tcl" ]; then
   105         -		cat << _EOF_ > "${installdir}/lib/tls${version}/pkgIndex.tcl"
   106         -package ifneeded tls ${version} \
   107         -    "[list source [file join \$dir tls.tcl]] ; \
   108         -     [list load {} tls]"
   109         -_EOF_
   110         -	fi
   111         -
   112         -	# Determine name of static object
   113         -	linkaddfile="$(find "${installdir}" -name '*.a' | head -n 1)"
   114         -	if [ -n "${linkaddfile}" ]; then
   115         -		linkaddfile="${linkaddfile}.linkadd"
   116         -
   117         -		if [ -n "${addlibs_LOCALSSL}" ]; then
   118         -			addlibs="${addlibs_LOCALSSL}"
           91  +	for file in *.linkadd; do
           92  +		if [ ! -e "${file}" ]; then
           93  +			continue
   119     94   		fi
   120     95   
   121         -		if [ -z "${addlibs}" ]; then
   122         -			if [ "${KC_TLS_LINKSSLSTATIC}" = '1' ]; then
   123         -				addlibs="$("${PKG_CONFIG:-pkg-config}" libssl libcrypto --libs --static)"
   124         -			else
   125         -				addlibs="$("${PKG_CONFIG:-pkg-config}" libssl libcrypto --libs)"
   126         -			fi
   127         -		fi
   128         -
   129         -		if [ -z "${addlibs}" ]; then
   130         -			addlibs="-L${SSL_LIB_DIR:-/lib} -lssl -lcrypto"
   131         -			addlibs_staticOnly=""
   132         -		fi
   133         -
   134         -		addlibs="${addlibs} ${KC_TLS_LINKADD}"
   135         -
   136         -		if [ "${KC_TLS_LINKSSLSTATIC}" = '1' ]; then
   137         -			echo "#STATIC ${addlibs} ${addlibs_staticOnly}"
   138         -		else
   139         -			echo "${addlibs}"
   140         -		fi > "${linkaddfile}"
   141         -	fi
           96  +		cp "${file}" "${installdir}/lib"/*/
           97  +	done
   142     98   }

Deleted tls/patches/all/tls-1.6-eoffix.diff version [a489f87c5b].

     1         -diff -uNr tls1.6/tlsIO.c tls1.6-eof-1dgp/tlsIO.c
     2         ---- tls1.6/tlsIO.c	2008-03-17 19:59:02.000000000 -0500
     3         -+++ tls1.6-eof-1dgp/tlsIO.c	2014-07-07 22:41:14.017514735 -0500
     4         -@@ -729,6 +729,19 @@
     5         - 	statePtr->timer = (Tcl_TimerToken) NULL;
     6         -     }
     7         - 
     8         -+    if (statePtr->flags & TLS_TCL_CALLBACK) {
     9         -+	return 0;
    10         -+    }
    11         -+
    12         -+    if (statePtr->flags & TLS_TCL_INIT
    13         -+	    && !SSL_is_init_finished(statePtr->ssl)) {
    14         -+	int errorCode;
    15         -+	if (Tls_WaitForConnect(statePtr, &errorCode) <= 0
    16         -+		&& errorCode == EAGAIN) {
    17         -+	    return 0;
    18         -+	}
    19         -+    }
    20         -+
    21         -     return mask;
    22         - }
    23         - 
    24         -@@ -900,6 +913,9 @@
    25         - 		    continue;
    26         - 		}
    27         - 	    } else if (err == 0) {
    28         -+		if (Tcl_Eof(statePtr->self)) {
    29         -+		    return 0;
    30         -+		}
    31         - 		dprintf(stderr,"CR! ");
    32         - 		*errorCodePtr = ECONNRESET;
    33         - 		return -1;

Deleted tls/patches/all/tls-1.6-fixmemleak-bugid3041925.diff version [13a18a6baa].

     1         -diff -uNr tls1.6.orig/tls.c tls1.6-fixmemleak-bugid3041925/tls.c
     2         ---- tls1.6.orig/tls.c	2008-03-19 17:06:13.000000000 -0500
     3         -+++ tls1.6-fixmemleak-bugid3041925/tls.c	2010-10-08 13:03:39.000000000 -0500
     4         -@@ -1156,6 +1156,8 @@
     5         - 	peer	= SSL_get_certificate(statePtr->ssl);
     6         -     if (peer) {
     7         - 	objPtr = Tls_NewX509Obj(interp, peer);
     8         -+
     9         -+	if (objc == 2) X509_free(peer);
    10         -     } else {
    11         - 	objPtr = Tcl_NewListObj(0, NULL);
    12         -     }

Deleted tls/patches/all/tls-1.6-peercertificate-1rsk.diff version [aa51f17273].

     1         -diff -uNr tls1.6/tlsX509.c tls1.6-patched/tlsX509.c
     2         ---- tls1.6/tlsX509.c	2005-02-07 14:51:03.000000000 -0500
     3         -+++ tls1.6-patched/tlsX509.c	2013-01-07 00:47:59.000000000 -0500
     4         -@@ -100,12 +100,14 @@
     5         -     char serial[BUFSIZ];
     6         -     char notBefore[BUFSIZ];
     7         -     char notAfter[BUFSIZ];
     8         -+    char certStr[BUFSIZ];
     9         - #ifndef NO_SSL_SHA
    10         -     int shai;
    11         -     char sha_hash[SHA_DIGEST_LENGTH*2];
    12         -     const char *shachars="0123456789ABCDEF";
    13         - #endif
    14         - 
    15         -+    certStr[0] = 0;
    16         -     if ((bio = BIO_new(BIO_s_mem())) == NULL) {
    17         - 	subject[0] = 0;
    18         - 	issuer[0]  = 0;
    19         -@@ -132,6 +134,13 @@
    20         - 	serial[n] = 0;
    21         - 	BIO_flush(bio);
    22         - 
    23         -+        if (PEM_write_bio_X509(bio, cert)) {
    24         -+            n = BIO_read(bio, certStr, min(BIO_pending(bio), BUFSIZ - 1));
    25         -+            n = max(n, 0);
    26         -+            certStr[n] = 0;
    27         -+            BIO_flush(bio);
    28         -+        }
    29         -+
    30         - 	BIO_free(bio);
    31         -     }
    32         - 
    33         -@@ -175,5 +184,10 @@
    34         -     Tcl_ListObjAppendElement( interp, certPtr,
    35         - 	    Tcl_NewStringObj( serial, -1) );
    36         - 
    37         -+    Tcl_ListObjAppendElement( interp, certPtr,
    38         -+	    Tcl_NewStringObj( "certificate", -1) );
    39         -+    Tcl_ListObjAppendElement( interp, certPtr,
    40         -+	    Tcl_NewStringObj( certStr, -1) );
    41         -+
    42         -     return certPtr;
    43         - }

Deleted tls/patches/all/tls-1.6.7-fixcrosscompile.diff version [66976acd97].

     1         -diff -uNr tls1.6.7.orig/Makefile.in tls1.6.7-fixcrosscompile/Makefile.in
     2         ---- tls1.6.7.orig/Makefile.in	2010-08-11 20:28:06.000000000 -0500
     3         -+++ tls1.6.7-fixcrosscompile/Makefile.in	2015-10-28 10:47:10.714214000 -0500
     4         -@@ -229,7 +229,7 @@
     5         - $(PKG_LIB_FILE): $(PKG_OBJECTS)
     6         - 	-rm -f $(PKG_LIB_FILE)
     7         - 	${MAKE_LIB}
     8         --	$(RANLIB) $(PKG_LIB_FILE)
     9         -+	-$(RANLIB) $(PKG_LIB_FILE)
    10         - 
    11         - #========================================================================
    12         - # We need to enumerate the list of .c to .o lines here.
    13         -diff -uNr tls1.6.7.orig/configure tls1.6.7-fixcrosscompile/configure
    14         ---- tls1.6.7.orig/configure	2015-07-07 12:16:02.000000000 -0500
    15         -+++ tls1.6.7-fixcrosscompile/configure	2015-10-28 10:42:09.324214000 -0500
    16         -@@ -1387,7 +1387,9 @@
    17         - fi
    18         - 
    19         - 	    EXEEXT=".exe"
    20         --	    TEA_PLATFORM="windows"
    21         -+		if [ -z "${TEA_PLATFORM}" ]; then
    22         -+			TEA_PLATFORM="windows"
    23         -+		fi
    24         - 	    ;;
    25         - 	*CYGWIN_*)
    26         - 	    CYGPATH=echo
    27         -@@ -1397,7 +1399,9 @@
    28         - 	*)
    29         - 	    CYGPATH=echo
    30         - 	    EXEEXT=""
    31         --	    TEA_PLATFORM="unix"
    32         -+		if [ -z "${TEA_PLATFORM}" ]; then
    33         -+			TEA_PLATFORM="unix"
    34         -+		fi
    35         - 	    ;;
    36         -     esac
    37         - 
    38         -@@ -1682,13 +1686,17 @@
    39         - echo $ECHO_N "checking for cygwin variant... $ECHO_C" >&6
    40         - 	    case ${TCL_EXTRA_CFLAGS} in
    41         - 		*-mwin32*|*-mno-cygwin*)
    42         --		    TEA_PLATFORM="windows"
    43         -+			if [ -z "${TEA_PLATFORM}" ]; then
    44         -+				TEA_PLATFORM="windows"
    45         -+			fi
    46         - 		    CFLAGS="$CFLAGS -mwin32"
    47         - 		    echo "$as_me:$LINENO: result: win32" >&5
    48         - echo "${ECHO_T}win32" >&6
    49         - 		    ;;
    50         - 		*)
    51         --		    TEA_PLATFORM="unix"
    52         -+			if [ -z "${TEA_PLATFORM}" ]; then
    53         -+				TEA_PLATFORM="unix"
    54         -+			fi
    55         - 		    echo "$as_me:$LINENO: result: unix" >&5
    56         - echo "${ECHO_T}unix" >&6
    57         - 		    ;;
    58         -@@ -10316,7 +10324,7 @@
    59         -     fi
    60         -     if test -n "${OPENSSL}"; then
    61         - 
    62         --    vars="ssleay32.lib libeay32.lib"
    63         -+    vars="ssl.lib crypto.lib"
    64         -     for i in $vars; do
    65         - 	if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
    66         - 	    # Convert foo.lib to -lfoo for GCC.  No-op if not *.lib

Deleted tls/patches/all/tls-1.6.7-peercertificate.diff version [99b020c0ab].

     1         -diff -uNr tls1.6.7.orig/tlsX509.c tls1.6.7-peercertificate/tlsX509.c
     2         ---- tls1.6.7.orig/tlsX509.c	2004-06-29 05:58:08.000000000 -0500
     3         -+++ tls1.6.7-peercertificate/tlsX509.c	2015-10-28 10:19:04.914214000 -0500
     4         -@@ -100,12 +100,14 @@
     5         -     char serial[BUFSIZ];
     6         -     char notBefore[BUFSIZ];
     7         -     char notAfter[BUFSIZ];
     8         -+    char certStr[BUFSIZ];
     9         - #ifndef NO_SSL_SHA
    10         -     int shai;
    11         -     char sha_hash[SHA_DIGEST_LENGTH*2];
    12         -     const char *shachars="0123456789ABCDEF";
    13         - #endif
    14         - 
    15         -+    certStr[0] = 0;
    16         -     if ((bio = BIO_new(BIO_s_mem())) == NULL) {
    17         - 	subject[0] = 0;
    18         - 	issuer[0]  = 0;
    19         -@@ -132,6 +134,13 @@
    20         - 	serial[n] = 0;
    21         - 	BIO_flush(bio);
    22         - 
    23         -+        if (PEM_write_bio_X509(bio, cert)) {
    24         -+            n = BIO_read(bio, certStr, min(BIO_pending(bio), BUFSIZ - 1));
    25         -+            n = max(n, 0);
    26         -+            certStr[n] = 0;
    27         -+            BIO_flush(bio);
    28         -+        }
    29         -+
    30         - 	BIO_free(bio);
    31         -     }
    32         - 
    33         -@@ -175,5 +184,10 @@
    34         -     Tcl_ListObjAppendElement( interp, certPtr,
    35         - 	    Tcl_NewStringObj( serial, -1) );
    36         - 
    37         -+    Tcl_ListObjAppendElement( interp, certPtr,
    38         -+	    Tcl_NewStringObj( "certificate", -1) );
    39         -+    Tcl_ListObjAppendElement( interp, certPtr,
    40         -+	    Tcl_NewStringObj( certStr, -1) );
    41         -+
    42         -     return certPtr;
    43         - }