boring-nginx: update dockerfile

This commit is contained in:
Wonderfall 2017-03-03 23:42:42 +01:00
parent 19da4021dd
commit b7a569609e
2 changed files with 3 additions and 45 deletions

View File

@ -29,8 +29,6 @@ ARG NGINX_3RD_PARTY_MODULES=" \
--add-module=/tmp/headers-more-nginx-module \ --add-module=/tmp/headers-more-nginx-module \
--add-module=/tmp/ngx_brotli" --add-module=/tmp/ngx_brotli"
COPY tls1_3.patch /tmp/tls1_3.patch
RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& NB_CORES=${BUILD_CORES-$(getconf _NPROCESSORS_CONF)} \ && NB_CORES=${BUILD_CORES-$(getconf _NPROCESSORS_CONF)} \
&& BUILD_DEPS=" \ && BUILD_DEPS=" \
@ -65,14 +63,12 @@ RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/a
&& cd /tmp && git clone https://github.com/openresty/headers-more-nginx-module --depth=1 \ && cd /tmp && git clone https://github.com/openresty/headers-more-nginx-module --depth=1 \
&& git clone https://boringssl.googlesource.com/boringssl --depth=1 \ && git clone https://boringssl.googlesource.com/boringssl --depth=1 \
&& cd boringssl \ && cd boringssl \
&& sed -n 's/\$avx = 0/\$avx = 2/p' crypto/*/asm/*.pl \ && sed -i 's@out \([>=]\) TLS1_2_VERSION@out \1 TLS1_3_VERSION@' ssl/ssl_lib.c \
&& sed -n 's/\$addx = 0/\$addx = 1/p' crypto/*/asm/*.pl \ && sed -i 's@ssl->version[ ]*=[ ]*TLS1_2_VERSION@ssl->version = TLS1_3_VERSION@' ssl/s3_lib.c \
&& sed -n 's/\$avx = 1/\$avx = 2/p' crypto/*/asm/*.pl \ && sed -i 's@(SSL3_VERSION, TLS1_2_VERSION@(SSL3_VERSION, TLS1_3_VERSION@' ssl/ssl_test.cc \
&& sed -n 's/\$shaext=0/\$shaext=1/p' crypto/*/asm/*.pl \
&& sed -i 's@\$shaext[ ]*=[ ]*0;@\$shaext = 1;@' crypto/*/asm/*.pl \ && sed -i 's@\$shaext[ ]*=[ ]*0;@\$shaext = 1;@' crypto/*/asm/*.pl \
&& sed -i 's@\$avx[ ]*=[ ]*[0|1];@\$avx = 2;@' crypto/*/asm/*.pl \ && sed -i 's@\$avx[ ]*=[ ]*[0|1];@\$avx = 2;@' crypto/*/asm/*.pl \
&& sed -i 's@\$addx[ ]*=[ ]*0;@\$addx = 1;@' crypto/*/asm/*.pl \ && sed -i 's@\$addx[ ]*=[ ]*0;@\$addx = 1;@' crypto/*/asm/*.pl \
&& patch -p1 < /tmp/tls1_3.patch \
&& mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. \ && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. \
&& make -j ${NB_CORES} && cd .. \ && make -j ${NB_CORES} && cd .. \
&& mkdir -p .openssl/lib/ && cd .openssl && ln -s ../include && cd .. \ && mkdir -p .openssl/lib/ && cd .openssl && ln -s ../include && cd .. \

View File

@ -1,38 +0,0 @@
diff -Naur boringssl/ssl/s3_lib.c boringssl-patched/ssl/s3_lib.c
--- boringssl/ssl/s3_lib.c 2017-02-19 03:26:26.485717137 +0100
+++ boringssl-patched/ssl/s3_lib.c 2017-02-19 03:21:59.196469813 +0100
@@ -185,7 +185,7 @@
* TODO(davidben): Move this field into |s3|, have it store the normalized
* protocol version, and implement this pre-negotiation quirk in |SSL_version|
* at the API boundary rather than in internal state. */
- ssl->version = TLS1_2_VERSION;
+ ssl->version = TLS1_3_VERSION;
return 1;
}
diff -Naur boringssl/ssl/ssl_lib.c boringssl-patched/ssl/ssl_lib.c
--- boringssl/ssl/ssl_lib.c 2017-02-19 03:26:26.485717137 +0100
+++ boringssl-patched/ssl/ssl_lib.c 2017-02-19 03:22:58.504765391 +0100
@@ -951,10 +951,6 @@
uint16_t version) {
if (version == 0) {
*out = method->max_version;
- /* TODO(svaldez): Enable TLS 1.3 by default once fully implemented. */
- if (*out > TLS1_2_VERSION) {
- *out = TLS1_2_VERSION;
- }
return 1;
}
diff -Naur boringssl/ssl/ssl_test.cc boringssl-patched/ssl/ssl_test.cc
--- boringssl/ssl/ssl_test.cc 2017-02-19 03:26:26.485717137 +0100
+++ boringssl-patched/ssl/ssl_test.cc 2017-02-19 03:25:50.377592542 +0100
@@ -3116,7 +3116,7 @@
!TestBadSSL_SESSIONEncoding(kBadSessionVersion) ||
!TestBadSSL_SESSIONEncoding(kBadSessionTrailingData) ||
// TODO(svaldez): Update this when TLS 1.3 is enabled by default.
- !TestDefaultVersion(SSL3_VERSION, TLS1_2_VERSION, &TLS_method) ||
+ !TestDefaultVersion(SSL3_VERSION, TLS1_3_VERSION, &TLS_method) ||
!TestDefaultVersion(SSL3_VERSION, SSL3_VERSION, &SSLv3_method) ||
!TestDefaultVersion(TLS1_VERSION, TLS1_VERSION, &TLSv1_method) ||
!TestDefaultVersion(TLS1_1_VERSION, TLS1_1_VERSION, &TLSv1_1_method) ||