wolfssl
wolfssl copied to clipboard
Introduce cmake SET_WOLFSSL_DEFINITIONS; Add Kyber and OQS
Description
This PR adds a new cmake helper function SET_WOLFSSL_DEFINITIONS and adds support for Kyber and LIBOQS as noted in https://github.com/wolfSSL/wolfssl/issues/7425
The additional items mentioned in the comments https://github.com/wolfSSL/wolfssl/issues/7425#issuecomment-2056780549 were move to the TODO section, not addressed in this PR:
# - XMSS
# - LMS
# - dual-certs
See also the request in https://github.com/wolfSSL/wolfssl/issues/7427 and my cmake_policy CMP0128 NEW in https://github.com/wolfSSL/wolfssl/pull/7479.
Sample new cmake output:
-- Enabling WOLFSSL_EXPERIMENTAL_SETTINGS
-- Enabling WOLFSSL_EXPERIMENTAL_SETTINGS - success
-- Looking for WOLFSSL_OQS
-- Looking for WOLFSSL_OQS - not found
-- Looking for WOLFSSL_KYBER
-- Looking for WOLFSSL_KYBER - not found
-- Warning: WOLFSSL_EXPERIMENTAL enabled, but no experimental features enabled.
or
-- Looking for WOLFSSL_EXPERIMENTAL
-- Looking for WOLFSSL_EXPERIMENTAL - not found
CMake Error at CMakeLists.txt:678 (message):
Error: WOLFSSL_OQS requires WOLFSSL_EXPERIMENTAL at this time.
-- Configuring incomplete, errors occurred!
See o-test.txt sample output from the o-test.sh script mentioned below.
Fixes zd# n/a
Testing
How did you test?
Tested on WSL using the example scripts noted in https://github.com/wolfSSL/wolfssl/issues/7425#issuecomment-2071177128 (see also this o-test.sh and sample output) such as:
rm -rf ./build
echo "--------------------------------"
echo "No OQS, No Experimental"
echo "--------------------------------"
cmake -Wno-dev -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
-DWOLFSSL_CURVE25519=ON \
-DWOLFSSL_CURVE448=ON \
-DWOLFSSL_ED25519=ON \
-DWOLFSSL_ED448=ON \
-DWOLFSSL_REPRODUCIBLE_BUILD=ON \
-DWOLFSSL_EXAMPLES=ON \
-DWOLFSSL_CRYPT_TESTS=ON \
|| exit 1
cmake --build build --verbose
Checklist
- [ ] added tests
- [ ] updated/added doxygen
- [ ] updated appropriate READMEs
- [ ] Updated manual and documentation
Jenkins retest this please.
Jenkins retest this please