- Add fail-closed wolfSSL small-math policy and vectors - Backport DHCP, EMS, and X.509 allocation fixes - Extend source override validation and operational documentation
28 lines
1017 B
C
28 lines
1017 B
C
/* SPDX-License-Identifier: GPL-3.0-only */
|
|
#ifndef SAK_WOLF_CRYPTO_POLICY_H
|
|
#define SAK_WOLF_CRYPTO_POLICY_H
|
|
|
|
#include <wolfssl/wolfcrypt/settings.h>
|
|
|
|
/* PR9275 selects small math on Xtensa to avoid compiler-introduced timing
|
|
* differences. Check resolved settings, not just command-line intentions.
|
|
* https://github.com/wolfSSL/wolfssl/pull/9275
|
|
*/
|
|
#if !defined(HAVE_CURVE25519) || !defined(CURVE25519_SMALL)
|
|
#error "wolf crypto policy: X25519 requires CURVE25519_SMALL"
|
|
#endif
|
|
#if !defined(HAVE_ED25519) || !defined(ED25519_SMALL)
|
|
#error "wolf crypto policy: Ed25519 requires ED25519_SMALL"
|
|
#endif
|
|
/* 5.8.2 excludes small math from automatic blinding and rejects this pairing.
|
|
* Do not force blinding back on: key layout and function signatures differ.
|
|
*/
|
|
#ifdef WOLFSSL_CURVE25519_BLINDING
|
|
#error "wolf crypto policy: small X25519 is incompatible with blinding"
|
|
#endif
|
|
#if defined(HAVE_CURVE448) || defined(HAVE_ED448)
|
|
#error "wolf crypto policy: review PR9275 small math before enabling 448"
|
|
#endif
|
|
|
|
#endif
|