Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
set -ex
apt update
apt install -y git \
build-essential \
autoconf \
automake \
libtool \
ninja-build \
libssl-dev \
libpcre3-dev \
wget
NGINX_VERSION=1.20.1
CMAKE_VERSION=3.18
CMAKE_BUILD=3
mkdir -p tmp
cd tmp
ROOT=$(pwd)
# Fetch all the files we need
wget https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.${CMAKE_BUILD}-Linux-x86_64.sh
git clone -n --single-branch --branch main https://github.com/open-quantum-safe/liboqs.git
cd liboqs
git checkout 2e2ddb4e0493014694820471396984b30d59cf97
cd ..
git clone -n --single-branch --branch OQS-OpenSSL_1_1_1-stable https://github.com/open-quantum-safe/openssl.git
cd openssl
git checkout 63b48cdde3cdf8dab966e31ea277e03e2d233f57
cd ..
wget nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && tar -zxvf nginx-${NGINX_VERSION}.tar.gz
# Install the latest CMake
mkdir cmake
sh cmake-${CMAKE_VERSION}.${CMAKE_BUILD}-Linux-x86_64.sh --skip-license --prefix=${ROOT}/cmake
# build liboqs
cd liboqs
mkdir build && cd build
${ROOT}/cmake/bin/cmake -GNinja -DCMAKE_INSTALL_PREFIX=${ROOT}/openssl/oqs ..
ninja && ninja install
# build nginx (which builds OQS-OpenSSL)
cd ${ROOT}
cd nginx-${NGINX_VERSION}
./configure --prefix=${ROOT}/nginx \
--with-debug \
--with-http_ssl_module --with-openssl=${ROOT}/openssl \
--without-http_gzip_module \
--with-cc-opt="-I ${ROOT}/openssl/oqs/include" \
--with-ld-opt="-L ${ROOT}/openssl/oqs/lib";
sed -i 's/libcrypto.a/libcrypto.a -loqs/g' objs/Makefile;
sed -i 's/EVP_MD_CTX_create/EVP_MD_CTX_new/g; s/EVP_MD_CTX_destroy/EVP_MD_CTX_free/g' src/event/ngx_event_openssl.c;
make && make install;