Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Botan 3.2.0 and 3.3.0 #10

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion fedora-36-amd64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ RUN dnf -y update
RUN /opt/tools/tools.sh build_and_install_libiconv && \
/opt/tools/tools.sh build_and_install_gpg lts && \
/opt/tools/tools.sh build_and_install_gpg stable && \
/opt/tools/tools.sh build_and_install_botan 3.1.1
/opt/tools/tools.sh build_and_install_botan 3.1.1 && \
/opt/tools/tools.sh build_and_install_botan 3.2.0 && \
/opt/tools/tools.sh build_and_install_botan 3.3.0
52 changes: 52 additions & 0 deletions tools/botan3-pqc-modules
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
aead
aes
auto_rng
bigint
blowfish
camellia
cast128
cbc
cfb
crc24
curve25519
des
dl_algo
dl_group
dsa
eax
ecc_key
ecdh
ecdsa
ed25519
elgamal
eme_pkcs1
emsa_pkcs1
emsa_raw
ffi
hash
raw_hash
hmac
hmac_drbg
idea
kdf
md5
ocb
pgp_s2k
rfc3394
rmd160
rsa
sha1
sha2_32
sha2_64
sha3
sm2
sm3
sm4
sp800_56a
twofish
kyber
dilithium
sphincsplus_sha2
sphincsplus_shake
hkdf
kmac
22 changes: 20 additions & 2 deletions tools/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ build_and_install_jsonc() {
rm -rf "${jsonc_build}"
}

botan_has_pqc_support() {
# Check whether version is in numeric format
if ! echo "$1" | grep -qE '^[0-9]+(\.[0-9]+)+$'; then
return 1
fi
# Check whether botan version >= 3.2.0
if [ "$(printf "3.2.0\n%s" "$1" | sort -V | head -n1)" = "3.2.0" ]; then
return 0
else
return 1
fi
}

build_and_install_botan() {
BOTAN_VERSION="${1:-system}"

Expand Down Expand Up @@ -139,8 +152,13 @@ build_and_install_botan() {
local osparam=()
local cpuparam=()
local osslparam=()
local modules=$(cat "$DIR_TOOLS"/botan3-modules | tr '\n' ',')
[[ "${botan_v}" == "2" ]] && osslparam+=("--without-openssl") && modules=$(cat "$DIR_TOOLS"/botan-modules | tr '\n' ',')
local modules
if botan_has_pqc_support "${BOTAN_VERSION}"; then
modules=$(tr '\n' ',' < "${DIR_TOOLS}/botan3-pqc-modules")
else
modules=$(tr '\n' ',' < "${DIR_TOOLS}/botan3-modules")
fi
[[ "${botan_v}" == "2" ]] && osslparam+=("--without-openssl") && modules=$(tr '\n' ',' < "${DIR_TOOLS}/botan-modules")


echo "Building botan with modules: ${modules}"
Expand Down
Loading