|
| 1 | +/* user_settings_tls12.h |
| 2 | + * |
| 3 | + * Copyright (C) 2006-2024 wolfSSL Inc. |
| 4 | + * |
| 5 | + * This file is part of wolfSSL. |
| 6 | + * |
| 7 | + * wolfSSL is free software; you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU General Public License as published by |
| 9 | + * the Free Software Foundation; either version 2 of the License, or |
| 10 | + * (at your option) any later version. |
| 11 | + * |
| 12 | + * wolfSSL is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU General Public License |
| 18 | + * along with this program; if not, write to the Free Software |
| 19 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
| 20 | + */ |
| 21 | + |
| 22 | +/* Example for TLS v1.2 client only, ECC only, AES GCM only, SHA2-256 only */ |
| 23 | +/* Derived using: |
| 24 | + * ./configure --disable-rsa --disable-dh --disable-tls13 --disable-chacha --disable-poly1305 --disable-sha224 --disable-sha --disable-md5 |
| 25 | + * And generated wolfssl/options.h |
| 26 | + */ |
| 27 | + |
| 28 | +#ifndef WOLFSSL_USER_SETTINGS_H |
| 29 | +#define WOLFSSL_USER_SETTINGS_H |
| 30 | + |
| 31 | +#ifdef __cplusplus |
| 32 | +extern "C" { |
| 33 | +#endif |
| 34 | + |
| 35 | +/* ------------------------------------------------------------------------- */ |
| 36 | +/* Platform */ |
| 37 | +/* ------------------------------------------------------------------------- */ |
| 38 | +#define WOLFSSL_USER_IO /* Use the SetIO callbacks, not the internal wolfio.c socket code */ |
| 39 | +#define WOLFSSL_IGNORE_FILE_WARN /* ignore file includes not required */ |
| 40 | +//#define WOLFSSL_SMALL_STACK /* option to reduce stack size, offload to heap */ |
| 41 | +#define NO_FILESYSTEM |
| 42 | +#define NO_WRITEV |
| 43 | +#define NO_SIG_WRAPPER |
| 44 | + |
| 45 | +/* ------------------------------------------------------------------------- */ |
| 46 | +/* Math */ |
| 47 | +/* ------------------------------------------------------------------------- */ |
| 48 | +/* Math Options */ |
| 49 | +#if 1 /* Single-precision (SP) wolf math - ECC only */ |
| 50 | + #define WOLFSSL_HAVE_SP_ECC /* use sp_c32.c for math */ |
| 51 | + #define WOLFSSL_SP_SMALL /* use smaller version of code */ |
| 52 | + #define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */ |
| 53 | + /* optional Cortex-M3+ speedup with inline assembly */ |
| 54 | + //#define WOLFSSL_SP_ARM_CORTEX_M_ASM |
| 55 | +#elif 1 |
| 56 | + /* Multi-precision wolf math */ |
| 57 | + #define WOLFSSL_SP_MATH_ALL /* use sp_int.c generic math */ |
| 58 | + #define WOLFSSL_SP_SMALL /* use smaller version of code */ |
| 59 | +#else |
| 60 | + /* Fast Math - tfm.c */ |
| 61 | + #define USE_FAST_MATH |
| 62 | + #define TFM_TIMING_RESISTANT |
| 63 | + #define WOLFSSL_NO_ASM |
| 64 | +#endif |
| 65 | + |
| 66 | +/* ------------------------------------------------------------------------- */ |
| 67 | +/* TLS */ |
| 68 | +/* ------------------------------------------------------------------------- */ |
| 69 | +/* Enable TLS v1.2 (on by default) */ |
| 70 | +#undef WOLFSSL_NO_TLS12 |
| 71 | +/* Disable TLS server code */ |
| 72 | +#define NO_WOLFSSL_SERVER |
| 73 | +//#define NO_WOLFSSL_CLIENT |
| 74 | +/* Disable TLS v1.3 code */ |
| 75 | +#undef WOLFSSL_TLS13 |
| 76 | +/* Disable older TLS version prior to 1.2 */ |
| 77 | +#define NO_OLD_TLS |
| 78 | + |
| 79 | +/* Enable default TLS extensions */ |
| 80 | +#define HAVE_TLS_EXTENSIONS |
| 81 | +#define HAVE_SUPPORTED_CURVES |
| 82 | +#define HAVE_EXTENDED_MASTER |
| 83 | +#define HAVE_ENCRYPT_THEN_MAC |
| 84 | +#define HAVE_SERVER_RENEGOTIATION_INFO |
| 85 | +//#define HAVE_SNI /* optional Server Name Indicator (SNI) */ |
| 86 | + |
| 87 | +/* ASN */ |
| 88 | +#define WOLFSSL_ASN_TEMPLATE /* use newer ASN template asn.c code (default) */ |
| 89 | + |
| 90 | +/* Disable Features */ |
| 91 | +#define NO_SESSION_CACHE /* disable session resumption */ |
| 92 | +#define NO_PSK /* pre-shared-key support */ |
| 93 | + |
| 94 | +/* ------------------------------------------------------------------------- */ |
| 95 | +/* Algorithms */ |
| 96 | +/* ------------------------------------------------------------------------- */ |
| 97 | +/* RNG */ |
| 98 | +#define HAVE_HASHDRBG /* Use DRBG SHA2-256 and seed */ |
| 99 | + |
| 100 | +/* Enable ECC */ |
| 101 | +#define HAVE_ECC |
| 102 | +#define ECC_USER_CURVES /* Enable only ECC curves specific */ |
| 103 | +#undef NO_ECC256 /* Enable SECP256R1 only (on by default) */ |
| 104 | +#define ECC_TIMING_RESISTANT /* Enable Timing Resistance */ |
| 105 | +/* Optional ECC calculation speed improvement if not using SP implementation */ |
| 106 | +//#define ECC_SHAMIR |
| 107 | + |
| 108 | +/* Enable SHA2-256 only (on by default) */ |
| 109 | +#undef NO_SHA256 |
| 110 | +//#define USE_SLOW_SHA256 /* Reduces code size by not partially unrolling */ |
| 111 | + |
| 112 | +/* Enable AES GCM only */ |
| 113 | +#define HAVE_AESGCM |
| 114 | +#define GCM_SMALL /* use small GHASH table */ |
| 115 | +#define NO_AES_CBC /* Disable AES CBC */ |
| 116 | + |
| 117 | +/* Optional Features */ |
| 118 | +//#define WOLFSSL_BASE64_ENCODE /* Enable Base64 encoding */ |
| 119 | + |
| 120 | + |
| 121 | +/* Disable Algorithms */ |
| 122 | +#define NO_RSA |
| 123 | +#define NO_DH |
| 124 | +#define NO_SHA |
| 125 | +#define NO_DSA |
| 126 | +#define NO_RC4 |
| 127 | +#define NO_MD4 |
| 128 | +#define NO_MD5 |
| 129 | +#define NO_DES3 |
| 130 | +#define NO_PWDBASED |
| 131 | +#define WOLFSSL_NO_SHAKE128 |
| 132 | +#define WOLFSSL_NO_SHAKE256 |
| 133 | + |
| 134 | +/* ------------------------------------------------------------------------- */ |
| 135 | +/* Debugging */ |
| 136 | +/* ------------------------------------------------------------------------- */ |
| 137 | +#undef DEBUG_WOLFSSL |
| 138 | +#undef NO_ERROR_STRINGS |
| 139 | +#if 0 |
| 140 | + #define DEBUG_WOLFSSL |
| 141 | +#else |
| 142 | + #if 1 |
| 143 | + #define NO_ERROR_STRINGS |
| 144 | + #endif |
| 145 | +#endif |
| 146 | + |
| 147 | +#ifdef __cplusplus |
| 148 | +} |
| 149 | +#endif |
| 150 | + |
| 151 | + |
| 152 | +#endif /* WOLFSSL_USER_SETTINGS_H */ |
0 commit comments