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

[Bug]: liboqs build fails with clang #7108

Closed
guidovranken opened this issue Jan 4, 2024 · 0 comments · Fixed by #7111 or #7114
Closed

[Bug]: liboqs build fails with clang #7108

guidovranken opened this issue Jan 4, 2024 · 0 comments · Fixed by #7111 or #7114
Assignees
Labels

Comments

@guidovranken
Copy link
Contributor

Contact Details

No response

Version

current master (commit 9db2077)

Description

Building wolfssl with liboqs fails with clang (I'm using Clang 15) due to an implicit casting in wolfcrypt/src/port/liboqs/liboqs.c. Possibly the consequence of #7026

Reproduction steps

export CC=clang
git clone https://github.com/open-quantum-safe/liboqs.git
git clone --depth 1 https://github.com/wolfSSL/wolfssl.git
mkdir liboqs-install/
cd liboqs/
git checkout 0.8.0
mkdir build/
cd build/
cmake -DCMAKE_INSTALL_PREFIX:PATH=$(realpath ../../liboqs-install) -DOQS_USE_OPENSSL=0 ..
make -j$(nproc)
make install
cd ../../wolfssl/
autoreconf -ivf
./configure --enable-static --disable-examples --disable-crypttests --enable-aesccm --enable-aescfb --enable-aesctr --enable-aeseax --enable-aesgcm-stream --enable-aeskeywrap --enable-aesofb --enable-aessiv --enable-arc4 --enable-asn=original --enable-blake2 --enable-blake2s --enable-camellia --enable-certext --enable-cmac --enable-compkey --enable-crl --enable-cryptocb --enable-curve25519 --enable-curve448 --enable-des3 --enable-dsa --enable-dtls --enable-dtls13 --enable-dtlscid --enable-earlydata --enable-ecccustcurves --enable-ecccustcurves=all --enable-eccencrypt --enable-eccsi --enable-ed25519 --enable-ed25519-stream --enable-ed448 --enable-ed448-stream --enable-harden --enable-hkdf --enable-hrrcookie --enable-indef --enable-keygen --enable-md2 --enable-md4 --enable-nullcipher --enable-ocsp --enable-ocspstapling --enable-oldtls --enable-postauth --enable-psk --enable-pwdbased --enable-ripemd --enable-scrypt --enable-secure-renegotiation --enable-session-ticket --enable-shake128 --enable-shake256 --enable-siphash --enable-smallstack --enable-sni --enable-srp --enable-srtp --enable-sslv3 --enable-tls13 --enable-tlsv10 --enable-tlsx --enable-x963kdf --enable-xchacha --enable-xts --with-eccminsz=0 --enable-hpke --enable-ocspstapling2 --enable-pkcs7 --enable-dtls-frag-ch --with-liboqs=$(realpath ../liboqs-install/)
make

Relevant log output

wolfcrypt/src/port/liboqs/liboqs.c:53:62: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'word32' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
    int ret = wc_RNG_GenerateBlock(liboqsCurrentRNG, buffer, numOfBytes);
              ~~~~~~~~~~~~~~~~~~~~                           ^~~~~~~~~~
1 error generated.
Frauschi added a commit to Laboratory-for-Safe-and-Secure-Systems/wolfssl that referenced this issue Jan 4, 2024
Fix implicit type conversion from size_t to word32 in liboqs.c source
file to make it build with clang.

Fixes wolfSSL#7108.

Signed-off-by: Tobias Frauenschläger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants