/* * sx_ntfy_mbedtls_config.h -- minimal mbedTLS 3.6 configuration for * plugin_ntfy (SCORPIOX BOT open-source ntfy channel connector). * * This file REPLACES mbedtls/mbedtls_config.h wholesale (the build passes * -DMBEDTLS_CONFIG_FILE="sx_ntfy_mbedtls_config.h"). mbedTLS ships ~90 * options that are all OFF unless listed, so everything this client needs is * named here explicitly -- there is no "upstream default" to lean on. * * What this config is, deliberately: * TLS 1.2 CLIENT ONLY. No server code (no MBEDTLS_SSL_SRV_C), no PSA * keystore, no file I/O (the trust anchors arrive as an in-memory PEM * bundle), no network helpers (MBEDTLS_NET_C is off -- plugin_ntfy owns * its own non-blocking sockets and feeds them to mbedtls through * mbedtls_ssl_set_bio(), which is the only way to keep a hard deadline on * every phase of the handshake and of a long-lived subscription read). * * X.509 chain verification and hostname verification stay ON. There is no * MBEDTLS_SSL_VERIFY_NONE code path compiled into this plugin at all: the * transport refuses to talk when the certificate does not check out. * * Vendored from the same mbedTLS 3.6.6 tree that scorpiox code builds with * (clang scorpiox/vendor/mbedtls), so both share one audited source. */ #ifndef SX_NTFY_MBEDTLS_CONFIG_H #define SX_NTFY_MBEDTLS_CONFIG_H /* ------------------------------------------------------------------ */ /* System support */ /* ------------------------------------------------------------------ */ #define MBEDTLS_HAVE_ASM #define MBEDTLS_HAVE_TIME #define MBEDTLS_HAVE_TIME_DATE /* certificate notBefore/notAfter */ #define MBEDTLS_PLATFORM_C /* ------------------------------------------------------------------ */ /* Symmetric ciphers + modes used by the TLS 1.2 suites we allow */ /* ------------------------------------------------------------------ */ #define MBEDTLS_AES_C #define MBEDTLS_AES_ROM_TABLES /* ROM S-boxes: smaller, constant-time */ #define MBEDTLS_CIPHER_C #define MBEDTLS_CIPHER_MODE_CBC #define MBEDTLS_CIPHER_MODE_CTR /* required internally by GCM */ #define MBEDTLS_GCM_C /* AES-GCM is what real servers pick */ #define MBEDTLS_CCM_C #define MBEDTLS_CIPHER_NULL_CIPHER /* not requested; kept off by omission */ /* ------------------------------------------------------------------ */ /* Hashes / MAC */ /* ------------------------------------------------------------------ */ #define MBEDTLS_MD_C #define MBEDTLS_SHA1_C /* legacy suites only (server chooses) */ #define MBEDTLS_SHA224_C #define MBEDTLS_SHA256_C #define MBEDTLS_SHA384_C #define MBEDTLS_SHA512_C #define MBEDTLS_MD5_C /* some legacy cert chains still sign MD5 */ #define MBEDTLS_POLY1305_C #define MBEDTLS_CHACHAPOLY_C #define MBEDTLS_CHACHA20_C /* ------------------------------------------------------------------ */ /* RNG */ /* ------------------------------------------------------------------ */ #define MBEDTLS_ENTROPY_C #define MBEDTLS_CTR_DRBG_C /* ------------------------------------------------------------------ */ /* ASN.1 / OIDs / PEM */ /* ------------------------------------------------------------------ */ #define MBEDTLS_ASN1_PARSE_C #define MBEDTLS_ASN1_WRITE_C #define MBEDTLS_OID_C #define MBEDTLS_BASE64_C #define MBEDTLS_PEM_PARSE_C /* the bundled trust anchors are PEM */ /* ------------------------------------------------------------------ */ /* X.509 -- verification is ON, always */ /* ------------------------------------------------------------------ */ #define MBEDTLS_X509_USE_C #define MBEDTLS_X509_CRT_PARSE_C /* ------------------------------------------------------------------ */ /* Public keys (key exchange + signature verification) */ /* ------------------------------------------------------------------ */ #define MBEDTLS_PK_C #define MBEDTLS_PK_PARSE_C #define MBEDTLS_PK_WRITE_C /* SPKI export for the certificate pin */ #define MBEDTLS_BIGNUM_C #define MBEDTLS_RSA_C #define MBEDTLS_PKCS1_V15 /* RSA key exchange */ #define MBEDTLS_PKCS1_V21 /* RSA-PSS signatures in TLS 1.2 */ #define MBEDTLS_ECP_C #define MBEDTLS_ECDH_C #define MBEDTLS_ECDSA_C #define MBEDTLS_ECP_DP_SECP256R1_ENABLED #define MBEDTLS_ECP_DP_SECP384R1_ENABLED #define MBEDTLS_ECP_DP_SECP521R1_ENABLED #define MBEDTLS_ECP_DP_X25519_ENABLED #define MBEDTLS_ECP_DP_SECP224R1_ENABLED #define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED #define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED /* ------------------------------------------------------------------ */ /* TLS 1.2 client */ /* ------------------------------------------------------------------ */ #define MBEDTLS_SSL_CLI_C #define MBEDTLS_SSL_TLS_C #define MBEDTLS_SSL_PROTO_TLS1_2 #define MBEDTLS_SSL_SESSION_TICKETS /* reconnect without a full handshake */ /* * Server Name Indication. * * This file replaces mbedtls_config.h wholesale, so upstream's "on by * default" does NOT apply: without this line ssl_write_hostname_ext() is * compiled out, mbedtls_ssl_set_hostname() still sets the verification name * but the ClientHello carries no SNI extension, and any host serving several * sites from one IP (every CDN fronting an ntfy relay) drops the handshake * with a fatal alert. Off-by-default config files are where TLS bugs hide. */ #define MBEDTLS_SSL_SERVER_NAME_INDICATION /* Keep the peer certificate after the handshake -- plugin_ntfy reports the * leaf fingerprint / checks SPKI pins against it. */ #define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE /* ------------------------------------------------------------------ */ /* Misc */ /* ------------------------------------------------------------------ */ #define MBEDTLS_ERROR_C /* mbedtls_strerror for the log file */ #define MBEDTLS_VERSION_C /* Explicitly NOT defined (each one is a deliberate decision, not an * oversight): MBEDTLS_NET_C, MBEDTLS_SSL_SRV_C, MBEDTLS_FS_IO, * MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PKCS5_C, MBEDTLS_PKCS12_C, MBEDTLS_X509_CRL_PARSE_C, * MBEDTLS_X509_CSR_PARSE_C, MBEDTLS_DEBUG_C, MBEDTLS_ECP_DP_SECP192R1_ENABLED, * MBEDTLS_KEY_EXCHANGE_DHE_* (no finite-field DH: one fewer code path and * modern servers never need it), MBEDTLS_SSL_RENEGOTIATION. */ #endif /* SX_NTFY_MBEDTLS_CONFIG_H */