Skip to content

Commit f054b3b

Browse files
fanquakerustyrussell
authored andcommitted
build: fixup check for HAVE_GOOD_LIBSODIUM
The current check fails when building with newer GCC, i.e: ```bash error: ‘crypto_secretstream_xchacha20poly1305_init_push’ reading 32 bytes from a region of size 3 [-Werror=stringop-overread] 12 | crypto_secretstream_xchacha20poly1305_init_push(&crypto_state, header, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 13 | data); ``` This inadvertently results in the release binaries for Ubuntu 22.04 & 24.04, not having a runtime libsodium dependency, but instead using the bundled lib. It's not clear to me this is actually enough to fix (all) the release builds, as the build containers need to have `libsodium-dev`, not just `libsodium` in them, and it's not clear to me which packages are actually present looking at the repro build scripts. Changelog-Fixed: build: libsodium configure check fixed to work with newer GCC.
1 parent 54ee08b commit f054b3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

configure

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,11 @@ int main(void)
398398
{
399399
crypto_secretstream_xchacha20poly1305_state crypto_state;
400400
unsigned char header[crypto_secretstream_xchacha20poly1305_HEADERBYTES];
401-
unsigned char data[] = { 1, 2, 3 };
401+
unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES];
402402
403+
crypto_secretstream_xchacha20poly1305_keygen(key);
403404
crypto_secretstream_xchacha20poly1305_init_push(&crypto_state, header,
404-
data);
405+
key);
405406
printf("%p\n", crypto_aead_chacha20poly1305_ietf_encrypt);
406407
printf("%d\n", crypto_aead_chacha20poly1305_ietf_NPUBBYTES);
407408
return 0;

0 commit comments

Comments
 (0)