Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Oct 2014 12:48:31 +0000 (UTC)
From:      Jimmy Olgeni <olgeni@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r370520 - in head/lang/erlang-runtime17: . files
Message-ID:  <201410091248.s99CmVWn063529@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: olgeni
Date: Thu Oct  9 12:48:31 2014
New Revision: 370520
URL: https://svnweb.freebsd.org/changeset/ports/370520
QAT: https://qat.redports.org/buildarchive/r370520/

Log:
  Fix SSL handshake when SNI-extension is empty.
  
  While I'm here:
  
  - Reduce diff with the main Erlang port
  - Do not mute install commands
  
  PR:		194214
  Submitted by:	Dave Cottlehuber

Added:
  head/lang/erlang-runtime17/files/patch-lib_ssl_src_ssl__handshake.erl   (contents, props changed)
  head/lang/erlang-runtime17/files/patch-lib_ssl_test_ssl__handshake__SUITE.erl   (contents, props changed)
Modified:
  head/lang/erlang-runtime17/Makefile

Modified: head/lang/erlang-runtime17/Makefile
==============================================================================
--- head/lang/erlang-runtime17/Makefile	Thu Oct  9 12:38:54 2014	(r370519)
+++ head/lang/erlang-runtime17/Makefile	Thu Oct  9 12:48:31 2014	(r370520)
@@ -3,6 +3,7 @@
 
 PORTNAME=	erlang
 PORTVERSION=	17.3
+PORTREVISION=	1
 CATEGORIES=	lang parallel java
 MASTER_SITES=	http://www.erlang.org/download/:erlangorg		\
 		http://erlang.stacken.kth.se/download/:erlangorg	\
@@ -37,7 +38,7 @@ SCTP_DESC=	Enable SCTP support
 SMP_DESC=	Enable SMP support
 WX_DESC=	Enable WX application
 GS_DESC=	Enable GS application (deprecated)
-DTRACE_DESC=	Enable DTrace support (experimental)
+DTRACE_DESC=	Enable DTrace support
 
 OPTIONS_DEFAULT=SMP OPENSSL THREADS SCTP KQUEUE
 
@@ -62,9 +63,11 @@ DISTFILES+=	${ERLANG_DOCS}:erlangorg
 # probes fixed does not match the number of defined probes (54 != 132,
 # respectively)" you probably misconfigured DTrace in some way.
 
+.if ${OSVERSION} < 1000000
 .if ${ARCH} == "amd64" && ${PORT_OPTIONS:MDTRACE} && ! ${PORT_OPTIONS:MGCC}
 IGNORE=		DTRACE support on amd64 requires GCC option
 .endif
+.endif
 
 .if ${PORT_OPTIONS:MGCC}
 USE_GCC?=	yes
@@ -165,12 +168,12 @@ post-install:
 			-C ${STAGEDIR}${PREFIX}/lib/${ERLANG_LIB} \
 			"man/man$${SECTION}/*.$${SECTION}" || ${TRUE}; \
 	done
-	@${RM} -rf ${STAGEDIR}${PREFIX}/lib/${ERLANG_LIB}/man/cat?
+	${RM} -rf ${STAGEDIR}${PREFIX}/lib/${ERLANG_LIB}/man/cat?
 
 .if ${PORT_OPTIONS:MDOCS}
-	@${TAR} --unlink -xzpf ${DISTDIR}/${DIST_SUBDIR}/${ERLANG_DOCS} \
+	${TAR} --unlink -xzpf ${DISTDIR}/${DIST_SUBDIR}/${ERLANG_DOCS} \
 		-C ${STAGEDIR}${PREFIX}/lib/${ERLANG_LIB}
-	@${INSTALL_DATA} ${WRKSRC}/lib/dialyzer/doc/*.txt \
+	${INSTALL_DATA} ${WRKSRC}/lib/dialyzer/doc/*.txt \
 		${STAGEDIR}${PREFIX}/lib/${ERLANG_LIB}/lib/dialyzer-*/doc/
 .endif
 

Added: head/lang/erlang-runtime17/files/patch-lib_ssl_src_ssl__handshake.erl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/erlang-runtime17/files/patch-lib_ssl_src_ssl__handshake.erl	Thu Oct  9 12:48:31 2014	(r370520)
@@ -0,0 +1,15 @@
+
+$FreeBSD$
+
+--- lib/ssl/src/ssl_handshake.erl.orig
++++ lib/ssl/src/ssl_handshake.erl
+@@ -1732,6 +1732,9 @@
+ 							#ec_point_formats{ec_point_format_list =
+ 									      ECPointFormats}});
+ 
++dec_hello_extensions(<<?UINT16(?SNI_EXT), ?UINT16(Len), Rest/binary>>, Acc) when Len == 0 ->
++    dec_hello_extensions(Rest, Acc#hello_extensions{sni = ""}); %% Server may send an empy SNI
++
+ dec_hello_extensions(<<?UINT16(?SNI_EXT), ?UINT16(Len),
+                 ExtData:Len/binary, Rest/binary>>, Acc) ->
+     <<?UINT16(_), NameList/binary>> = ExtData,

Added: head/lang/erlang-runtime17/files/patch-lib_ssl_test_ssl__handshake__SUITE.erl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/erlang-runtime17/files/patch-lib_ssl_test_ssl__handshake__SUITE.erl	Thu Oct  9 12:48:31 2014	(r370520)
@@ -0,0 +1,27 @@
+
+$FreeBSD$
+
+--- lib/ssl/test/ssl_handshake_SUITE.erl.orig
++++ lib/ssl/test/ssl_handshake_SUITE.erl
+@@ -39,6 +39,7 @@
+ 	  decode_unknown_hello_extension_correctly,
+ 	  encode_single_hello_sni_extension_correctly,
+ 	  decode_single_hello_sni_extension_correctly,
++	  decode_empty_server_sni_correctly,
+ 	  select_proper_tls_1_2_rsa_default_hashsign].
+ 
+ %%--------------------------------------------------------------------
+@@ -106,6 +107,13 @@
+     Decoded = ssl_handshake:decode_hello_extensions(SNI),
+     Exts = Decoded.
+ 
++decode_empty_server_sni_correctly(_Config) ->
++    Exts = #hello_extensions{sni = ""},
++    SNI = <<?UINT16(?SNI_EXT),?UINT16(0)>>,
++    Decoded = ssl_handshake:decode_hello_extensions(SNI),
++    Exts = Decoded.
++
++
+ select_proper_tls_1_2_rsa_default_hashsign(_Config) ->
+     % RFC 5246 section 7.4.1.4.1 tells to use {sha1,rsa} as default signature_algorithm for RSA key exchanges
+     {sha, rsa} = ssl_handshake:select_hashsign_algs(undefined, ?rsaEncryption, {3,3}),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410091248.s99CmVWn063529>