-
Notifications
You must be signed in to change notification settings - Fork 74
/
build_bssl.sh.patch
65 lines (54 loc) · 2.28 KB
/
build_bssl.sh.patch
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
57
58
59
60
61
62
63
64
65
diff --git a/script/build_bssl.sh b/script/build_bssl.sh
index cb7f229..60e0822 100755
--- a/script/build_bssl.sh
+++ b/script/build_bssl.sh
@@ -6,7 +6,11 @@ cd src
if [ ! -d "boringssl" ]; then
- git clone https://github.com/google/boringssl.git
+ # download boringssl and liboqs from oqs
+ echo "Downloading oqs boringssl"
+ git clone --branch master https://github.com/open-quantum-safe/boringssl.git
+
+ git clone --branch $LIBOQS_TAG --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs.git
fi
if [ -d "go" ]; then
@@ -17,9 +21,6 @@ echo $PATH
fi
cd boringssl
-git reset --hard
-git checkout master
-git pull
#git checkout 49de1fc291
#git checkout bfe527fa35735e8e045cbfb42b012e13ca68f9cf
@@ -27,7 +28,7 @@ git pull
#git checkout b117a3a0b7bd11fe6ebd503ec6b45d6b910b41a1
# HTTP/3 v1 and ID-34 support
#git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9
-git checkout cf8d3ad3cea51cf7184307d54f465da62b7d8408
+# git checkout cf8d3ad3cea51cf7184307d54f465da62b7d8408
rm -rf build
@@ -37,8 +38,13 @@ patch -p1 < ../../patches/boringssl/bssl_max_early_data_sz.patch
#patch -p1 < ../../patches/boringssl/bssl_no_eoed.patch
sed -i -e "s/-Werror//" CMakeLists.txt
-mkdir build
-cd build
+# Build liboqs both as shared and static library
+cd ../liboqs && mkdir build-static && cd build-static && cmake -G"Ninja" -DCMAKE_INSTALL_PREFIX=/opt/third-party/src/boringssl/oqs -DOQS_USE_OPENSSL=OFF .. && ninja && ninja install
+cd .. && mkdir build && cd build && cmake -G"Ninja" -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/opt/third-party/src/boringssl/oqs -DOQS_USE_OPENSSL=OFF .. && ninja && ninja install
+
+cp /opt/third-party/src/liboqs/build/lib/liboqs.so /usr/local/lib && ldconfig
+cd ../../boringssl && mkdir build && cd build
+
cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC"
#cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS="-fPIC -DOPENSSL_C11_ATOMIC" -DCMAKE_CXX_FLAGS="-fPIC -DOPENSSL_C11_ATOMIC"
make -j4
@@ -50,9 +56,11 @@ make -j4
cd ..
cp crypto/libcrypto.a ../../../lib
-cp ssl/libssl.a ../../../lib
+cp ssl/libssl.a ../../../lib
cp decrepit/libdecrepit.a ../../../lib
+cp ../oqs/lib/liboqs* ../../../lib
cd ..
+cp -r oqs/include/oqs ../../include/
cp -r include/openssl ../../include/