diff --git a/bogo/fetch-and-build b/bogo/fetch-and-build index 040b783de23..60bb31eba85 100755 --- a/bogo/fetch-and-build +++ b/bogo/fetch-and-build @@ -1,19 +1,22 @@ -#!/bin/sh +#!/bin/bash set -ex +mkdir bogo +pushd bogo + +git init +cat << EOF > .git/info/sparse-checkout +go.mod +ssl/test/runner +util/testresult +EOF + # a known-good commit COMMIT=47a6f5b4bf4d7acd8d5f7d43cb9c94335cec1c60 - -rm -f runner.tar.gz testresult.tar.gz -wget https://boringssl.googlesource.com/boringssl/+archive/$COMMIT/ssl/test/runner.tar.gz -wget https://boringssl.googlesource.com/boringssl/+archive/$COMMIT/util/testresult.tar.gz -mkdir -p bogo -cd bogo/ -mkdir -p testresult -tar -xzf ../runner.tar.gz -( cd testresult && tar -xzf ../../testresult.tar.gz ) +git fetch https://boringssl.googlesource.com/boringssl $COMMIT +git checkout $COMMIT patch -p1 < ../patches/testerrormap.diff -patch -p1 < ../patches/go-1.13-breakage.diff -patch -p1 < ../patches/vendor.diff -go test -c +(cd ssl/test/runner && go test -c) + +popd diff --git a/bogo/patches/go-1.13-breakage.diff b/bogo/patches/go-1.13-breakage.diff deleted file mode 100644 index 233cfd4206b..00000000000 --- a/bogo/patches/go-1.13-breakage.diff +++ /dev/null @@ -1,27 +0,0 @@ -Only in bogo/: bogo.test -diff -ur bogo-orig/curve25519/doc.go bogo/curve25519/doc.go ---- bogo-orig/curve25519/doc.go 2019-12-30 17:53:10.000000000 +0000 -+++ bogo/curve25519/doc.go 2019-12-30 17:56:11.516140453 +0000 -@@ -4,7 +4,7 @@ - - // Package curve25519 provides an implementation of scalar multiplication on - // the elliptic curve known as curve25519. See http://cr.yp.to/ecdh.html --package curve25519 // import "golang.org/x/crypto/curve25519" -+package curve25519 - - // basePoint is the x coordinate of the generator of the curve. - var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -Only in bogo/: hrss -Only in bogo/: mock_quic_transport.go -diff -ur bogo-orig/poly1305/poly1305.go bogo/poly1305/poly1305.go ---- bogo-orig/poly1305/poly1305.go 2019-12-30 17:53:10.000000000 +0000 -+++ bogo/poly1305/poly1305.go 2019-12-30 17:57:49.538531940 +0000 -@@ -16,7 +16,7 @@ - However, in this package AES isn't used and the one-time key is specified - directly. - */ --package poly1305 // import "golang.org/x/crypto/poly1305" -+package poly1305 - - import "crypto/subtle" - diff --git a/bogo/patches/testerrormap.diff b/bogo/patches/testerrormap.diff index f5ae90573cd..ed5213d7de9 100644 --- a/bogo/patches/testerrormap.diff +++ b/bogo/patches/testerrormap.diff @@ -1,6 +1,6 @@ -diff -u original/runner.go bogo/runner.go ---- original/runner.go 2018-09-13 21:07:29.000000000 +0100 -+++ bogo/runner.go 2019-01-20 11:51:00.705040230 +0000 +diff -u original/ssl/test/runner/runner.go bogo/ssl/test/runner/runner.go +--- original/ssl/test/runner/runner.go 2018-09-13 21:07:29.000000000 +0100 ++++ bogo/ssl/test/runner/runner.go 2019-01-20 11:51:00.705040230 +0000 @@ -84,6 +84,14 @@ // like “SSL_ERROR_NO_CYPHER_OVERLAP”. ErrorMap map[string]string diff --git a/bogo/patches/vendor.diff b/bogo/patches/vendor.diff deleted file mode 100644 index d0cda850d4e..00000000000 --- a/bogo/patches/vendor.diff +++ /dev/null @@ -1,38 +0,0 @@ -diff -u bogo-orig/chacha20_poly1305.go bogo/chacha20_poly1305.go ---- bogo-orig/chacha20_poly1305.go 2020-04-11 11:09:43.000000000 +0100 -+++ bogo/chacha20_poly1305.go 2020-04-11 11:10:59.526200057 +0100 -@@ -20,7 +20,7 @@ - "encoding/binary" - "errors" - -- "boringssl.googlesource.com/boringssl/ssl/test/runner/poly1305" -+ "./poly1305" - ) - - // See RFC 7539. -diff -u bogo-orig/key_agreement.go bogo/key_agreement.go ---- bogo-orig/key_agreement.go 2020-04-11 11:09:43.000000000 +0100 -+++ bogo/key_agreement.go 2020-04-11 11:10:38.096679513 +0100 -@@ -17,8 +17,8 @@ - "io" - "math/big" - -- "boringssl.googlesource.com/boringssl/ssl/test/runner/curve25519" -- "boringssl.googlesource.com/boringssl/ssl/test/runner/hrss" -+ "./curve25519" -+ "./hrss" - ) - - type keyType int -diff -u bogo-orig/runner.go bogo/runner.go ---- bogo-orig/runner.go 2020-04-11 11:09:43.000000000 +0100 -+++ bogo/runner.go 2020-04-11 11:11:50.662973209 +0100 -@@ -46,7 +46,7 @@ - "syscall" - "time" - -- "boringssl.googlesource.com/boringssl/util/testresult" -+ "./testresult" - ) - - var ( diff --git a/bogo/runme b/bogo/runme index 79e0efc860a..afce70cd156 100755 --- a/bogo/runme +++ b/bogo/runme @@ -6,7 +6,7 @@ set -xe if [ ! -e ../target/debug/examples/bogo_shim ] ; then - cargo test --no-run --features dangerous_configuration,quic + (cd ../rustls && cargo build --example bogo_shim --features dangerous_configuration,quic) fi if [ ! -e bogo/ ] ; then @@ -17,7 +17,7 @@ fi # Best effort on OS-X case $OSTYPE in darwin*) set +e ;; esac -( cd bogo && ./bogo.test -shim-path ../../target/debug/examples/bogo_shim \ - -shim-config ../config.json \ +( cd bogo/ssl/test/runner && ./runner.test -shim-path ../../../../../target/debug/examples/bogo_shim \ + -shim-config ../../../../config.json \ -pipe -allow-unimplemented ) true