Skip to content

Commit 491bb14

Browse files
committed
build: test for timingsafe_bcmp
Code introduced in #15649 added usage of `timingsafe_bcmp()`, if available, otherwise falling back to our own implementation. However the relevant build system check was never added, so currently, we'll always just use our implementation, as HAVE_TIMINGSAFE_BCMP will never be defined. Add the check for timingsafe_bcmp. Note that as far as I'm aware, it's only available on OpenBSD.
1 parent e3c08eb commit 491bb14

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,8 @@ AC_CHECK_DECLS([setsid])
998998

999999
AC_CHECK_DECLS([pipe2])
10001000

1001+
AC_CHECK_FUNCS([timingsafe_bcmp])
1002+
10011003
AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
10021004
[#if HAVE_ENDIAN_H
10031005
#include <endian.h>

src/crypto/chacha_poly_aead.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5+
#if defined(HAVE_CONFIG_H)
6+
#include <config/bitcoin-config.h>
7+
#endif
8+
59
#include <crypto/chacha_poly_aead.h>
610

711
#include <crypto/poly1305.h>

0 commit comments

Comments
 (0)