Skip to content

Commit

Permalink
ensure OpenSSL3 is linked to liboqs during script build (open-quantum…
Browse files Browse the repository at this point in the history
…-safe#212)

Signed-off-by: Felipe Ventura <felipe.ventura@entrust.com>
  • Loading branch information
baentsch authored and feventura committed Mar 13, 2024
1 parent c25b1e9 commit 4dfeffd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion scripts/fullbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ if [ -z "$OPENSSL_INSTALL" ]; then
if [ $? -ne 0 ]; then
echo "openssl build failed. Exiting."
exit -1
else
# some cmake versions don't look in "lib64", so aid their search with this softlink
cd $OSSL_PREFIX && if [ -d "lib64" ]; then ln -s lib64 lib; fi && cd ..
export OPENSSL_INSTALL=$OSSL_PREFIX
fi
else
if [ -d ".local" ]; then
export OPENSSL_INSTALL=`pwd`/.local
fi
fi
fi
Expand Down Expand Up @@ -85,12 +93,20 @@ if [ -z $liboqs_DIR ]; then
fi
fi

# Ensure liboqs is built against OpenSSL3, not a possibly still system-
# installed OpenSSL111: We otherwise have mismatching symbols at runtime
# (detected particularly late when building shared)
if [ ! -z $OPENSSL_INSTALL ]; then
export CMAKE_OPENSSL_LOCATION="-DOPENSSL_ROOT_DIR=$OPENSSL_INSTALL"
else
export CMAKE_OPENSSL_LOCATION=""
fi
# for full debug build add: -DCMAKE_BUILD_TYPE=Debug
# to optimize for size add -DOQS_ALGS_ENABLED= suitably to one of these values:
# STD: only include NIST standardized algorithms
# NIST_R4: only include algorithms in round 4 of the NIST competition
# All: include all algorithms supported by liboqs (default)
cd liboqs && cmake -GNinja $DOQS_ALGS_ENABLED -DCMAKE_INSTALL_PREFIX=$(pwd)/../.local -S . -B _build && cd _build && ninja && ninja install && cd ../..
cd liboqs && cmake -GNinja $DOQS_ALGS_ENABLED $CMAKE_OPENSSL_LOCATION -DCMAKE_INSTALL_PREFIX=$(pwd)/../.local -S . -B _build && cd _build && ninja && ninja install && cd ../..
if [ $? -ne 0 ]; then
echo "liboqs build failed. Exiting."
exit -1
Expand Down

0 comments on commit 4dfeffd

Please sign in to comment.