randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.47k stars 553 forks source link

2.19.0 misses header guard fix for sha3_round.h #2879

Closed tobiasbrunner closed 2 years ago

tobiasbrunner commented 2 years ago

The header guard was added in https://github.com/randombit/botan/commit/e5c652068ba3994c47c13004cc01d16675096adf, which wasn't backported to the release-2 branch.

Full build output:

   INFO: ./configure.py invoked with options "--amalgamation --disable-modules=pkcs11,tls,x509,xmss --prefix=/usr/local"
   INFO: Configuring to build Botan 2.19.0 (revision git:de5341cd80946cb78f5231097c8ed6a982a29345)
   INFO: Running under 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
   INFO: Autodetected platform information: OS="Linux" machine="x86_64" proc="x86_64"
   INFO: Guessing target OS is linux (use --os to set)
   INFO: Guessing to use compiler gcc (use --cc or CXX to set)
   INFO: Guessing target processor is a x86_64 (use --cpu to set)
   INFO: Using /etc/ssl/certs/ca-certificates.crt as system certificate store
   INFO: Auto-detected compiler version 9.3
   INFO: Auto-detected compiler arch x86_64
   INFO: Target is gcc:9.3-linux-x86_64
   INFO: Assuming target x86_64 is little endian
   INFO: Skipping (dependency failure): asio certstor_flatfile certstor_sql certstor_sqlite3 certstor_system sessions_sql sessions_sqlite3 tls_10 tls_cbc
   INFO: Skipping (disabled by user): pkcs11 tls x509 xmss
   INFO: Skipping (incompatible CPU): aes_armv8 aes_power8 sha1_armv8 sha2_32_armv8 sm4_armv8
   INFO: Skipping (incompatible OS): certstor_system_macos certstor_system_windows commoncrypto getentropy win32_stats
   INFO: Skipping (no enabled compression schemes): compression
   INFO: Skipping (not requested): dyn_load
   INFO: Skipping (requires external dependency): boost bzip2 lzma openssl sqlite3 tpm zlib
   INFO: Loading modules: adler32 aead aes aes_ni aes_vperm aont argon2 aria asn1 auto_rng base base32 base58 base64 bcrypt bcrypt_pbkdf bigint blake2 block blowfish camellia cascade cast128 cast256 cbc cbc_mac ccm cecpq1 cfb chacha chacha20poly1305 chacha_avx2 chacha_rng chacha_simd32 checksum cmac comb4p cpuid crc24 crc32 cryptobox ctr curve25519 des dev_random dh dl_algo dl_group dlies dsa eax ec_group ecc_key ecdh ecdsa ecgdsa ecies eckcdsa ed25519 elgamal eme_oaep eme_pkcs1 eme_raw emsa1 emsa_pkcs1 emsa_pssr emsa_raw emsa_x931 entropy fd_unix ffi filters fpe_fe1 gcm ghash ghash_cpu ghash_vperm gmac gost_28147 gost_3410 gost_3411 hash hash_id hex hkdf hmac hmac_drbg hotp http_util idea idea_sse2 iso9796 kasumi kdf kdf1 kdf1_iso18033 kdf2 keccak keypair lion locking_allocator mac mce mceies md4 md5 mdx_hash mem_pool mgf1 misty1 mode_pad modes mp newhope nist_keywrap noekeon noekeon_simd numbertheory ocb ofb par_hash passhash9 pbes2 pbkdf pbkdf1 pbkdf2 pem pgp_s2k pk_pad poly1305 poly_dbl prf_tls prf_x942 proc_walk processor_rng psk_db pubkey rc4 rdrand_rng rdseed rfc3394 rfc6979 rmd160 rng roughtime rsa salsa20 scrypt seed serpent serpent_avx2 serpent_simd sha1 sha1_sse2 sha1_x86 sha2_32 sha2_32_bmi2 sha2_32_x86 sha2_64 sha2_64_bmi2 sha3 sha3_bmi2 shacal2 shacal2_avx2 shacal2_simd shacal2_x86 shake shake_cipher simd simd_avx2 siphash siv skein sm2 sm3 sm4 socket sodium sp800_108 sp800_56a sp800_56c srp6 stateful_rng stream streebog system_rng thread_utils threefish_512 threefish_512_avx2 tiger tss twofish utils uuid whirlpool x919_mac xtea xts zfec zfec_sse2 zfec_vperm
   INFO: Using symlink to link files into build dir (use --link-method to change)
   INFO: Writing amalgamation header to botan_all.h
   INFO: Writing amalgamation source to botan_all.cpp
  ERROR: Traceback (most recent call last):
  File "./configure.py", line 3441, in <module>
    sys.exit(main(argv=sys.argv))
  File "./configure.py", line 3435, in main
    do_io_for_build(cc, arch, osinfo, using_mods, build_paths, source_paths, template_vars, options)
  File "./configure.py", line 3262, in do_io_for_build
    (amalg_cpp_files, amalg_headers) = AmalgamationGenerator(
  File "./configure.py", line 2738, in generate
    internal_headers = AmalgamationHeader(internal_headers_list)
  File "./configure.py", line 2614, in __init__
    contents = AmalgamationGenerator.read_header(filepath)
  File "./configure.py", line 2677, in read_header
    return AmalgamationGenerator.strip_header_goop(filepath, raw_content)
  File "./configure.py", line 2689, in strip_header_goop
    raise InternalError("No header guard start found in " + header_name)
InternalError: No header guard start found in ./src/lib/hash/sha3/sha3_round.h
randombit commented 2 years ago

Oops thank you. I will also look into adding amalgamation build to CI in the 2x branch to prevent such regressions in the future.

randombit commented 2 years ago

Fixed in #2881 I will release a patch version later today

randombit commented 2 years ago

Fixed in new 2.19.1 release