Fix crypter.h missing <openssl/crypto.h> include for OPENSSL_cleanse

Latent header-hygiene bug: crypter.h calls OPENSSL_cleanse at lines 99-100
but never declared the dependency. Built fine because the precompiled
header on triangles_common pulled in <openssl/crypto.h> transitively, so
every translation unit that included crypter.h also got the symbol.

Surfaced by enabling -DBUILD_TESTS=ON: test_triangles is configured
without REUSE_FROM the PCH, so test/sigopcount_tests.cpp fails to find
OPENSSL_cleanse when crypter.h is reached transitively via key.h/wallet.h.

Adding the explicit include is the principled fix — headers should
declare their own dependencies rather than rely on the consumer's
precompiled-header configuration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-29 14:30:41 -07:00
parent 47c9293849
commit 47e358dc18
+2
View File
@@ -8,6 +8,8 @@
#include "key.h"
#include "serialize.h"
#include <openssl/crypto.h> /* for OPENSSL_cleanse */
const unsigned int WALLET_CRYPTO_KEY_SIZE = 32;
const unsigned int WALLET_CRYPTO_SALT_SIZE = 8;