|
| 1 | +/* user_settings.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 build settings for Infineon Modus Toolbox */ |
| 23 | +/* Enables wolfSSL TLS v1.2-v1.3 and TPM support */ |
| 24 | +/* SHA-1, SHA-2, AES CBC/GCM, ECDHE, ECDSA, RSA, HMAC, HKDF */ |
| 25 | + |
| 26 | +#ifndef WOLF_USER_SETTINGS_TPM_H |
| 27 | +#define WOLF_USER_SETTINGS_TPM_H |
| 28 | + |
| 29 | +#ifdef __cplusplus |
| 30 | +extern "C" { |
| 31 | +#endif |
| 32 | + |
| 33 | +/* Platform / Porting */ |
| 34 | +#define NO_FILESYSTEM /* File system disable */ |
| 35 | +#define SINGLE_THREADED /* No threading */ |
| 36 | +#define WOLFSSL_USER_IO /* user recv/send callbacks for network IO */ |
| 37 | +#define NO_WRITEV |
| 38 | +#define NO_MAIN_DRIVER |
| 39 | +#define WOLFSSL_IGNORE_FILE_WARN /* ignore file include warnings */ |
| 40 | +#define WOLFSSL_SMALL_STACK /* limit stack usage */ |
| 41 | +#define BENCH_EMBEDDED |
| 42 | + |
| 43 | +/* TLS (allow TLS v1.3 or v1.2) */ |
| 44 | +#define WOLFSSL_TLS13 |
| 45 | +//#define WOLFSSL_NO_TLS12 |
| 46 | +#define NO_OLD_TLS |
| 47 | +#define WOLFSSL_EITHER_SIDE /* allow context to be created for either server or client */ |
| 48 | + |
| 49 | +#define HAVE_TLS_EXTENSIONS |
| 50 | +#define HAVE_SUPPORTED_CURVES |
| 51 | +#define HAVE_SERVER_RENEGOTIATION_INFO |
| 52 | +#define HAVE_ENCRYPT_THEN_MAC |
| 53 | + |
| 54 | +#ifdef WOLFSSL_TLS13 |
| 55 | + #define HAVE_HKDF |
| 56 | + #define WC_RSA_PSS |
| 57 | + #define WOLFSSL_PSS_LONG_SALT |
| 58 | +#endif |
| 59 | + |
| 60 | +/* Enable crypto callbacks - for TPM offloading */ |
| 61 | +#define WOLF_CRYPTO_CB |
| 62 | + |
| 63 | +/* Enable SP math all (sp_int.c) with multi-precision support */ |
| 64 | +#define WOLFSSL_SP_MATH_ALL |
| 65 | + |
| 66 | +#if 1 |
| 67 | + /* Single Precision math for ECC 256 and RSA 2048 */ |
| 68 | + #define WOLFSSL_HAVE_SP_RSA |
| 69 | + #define WOLFSSL_HAVE_SP_ECC |
| 70 | + #define WOLFSSL_SP_SMALL |
| 71 | +#endif |
| 72 | + |
| 73 | +#if 0 |
| 74 | + /* only single precision math */ |
| 75 | + #define WOLFSSL_SP_MATH |
| 76 | +#endif |
| 77 | + |
| 78 | +/* Enable hardening (timing resistance) */ |
| 79 | +#define TFM_TIMING_RESISTANT |
| 80 | +#define ECC_TIMING_RESISTANT |
| 81 | +#define WC_RSA_BLINDING |
| 82 | + |
| 83 | +/* Enable PRNG (SHA2-256) */ |
| 84 | +#define HAVE_HASHDRBG |
| 85 | + |
| 86 | +/* Asymmetric */ |
| 87 | +#if 1 /* RSA - needed to encrypt salt */ |
| 88 | + #undef NO_RSA |
| 89 | + #ifdef USE_LOW_RESOURCE |
| 90 | + #define WOLFSSL_RSA_PUBLIC_ONLY |
| 91 | + #define WOLFSSL_RSA_VERIFY_INLINE |
| 92 | + #define NO_CHECK_PRIVATE_KEY |
| 93 | + #endif |
| 94 | +#else |
| 95 | + #define NO_RSA |
| 96 | +#endif |
| 97 | + |
| 98 | +#if 1 /* ECC - needed for encrypt ECC salt */ |
| 99 | + #define HAVE_ECC |
| 100 | + #define ECC_USER_CURVES /* default to only SECP256R1 */ |
| 101 | +#endif |
| 102 | + |
| 103 | +#if 0 /* DH - TPM doesn't support it */ |
| 104 | + #undef NO_DH |
| 105 | + #define HAVE_FFDHE_2048 |
| 106 | + #define HAVE_DH_DEFAULT_PARAMS |
| 107 | +#else |
| 108 | + #define NO_DH |
| 109 | +#endif |
| 110 | + |
| 111 | +/* Symmetric Hash */ |
| 112 | +#undef NO_SHA /* allow SHA-1 */ |
| 113 | +#undef NO_SHA256 /* allow SHA2-256 */ |
| 114 | +#define WOLFSSL_SHA384 |
| 115 | +#define WOLFSSL_SHA512 |
| 116 | + |
| 117 | +/* Symmetric Cipher */ |
| 118 | +#define WOLFSSL_AES_CFB |
| 119 | +#define HAVE_AES_DECRYPT |
| 120 | + |
| 121 | +#define HAVE_AES_KEYWRAP |
| 122 | +#define WOLFSSL_AES_DIRECT |
| 123 | +#define HAVE_AESGCM |
| 124 | +#define GCM_TABLE_4BIT |
| 125 | + |
| 126 | +/* Features */ |
| 127 | +#define WOLFSSL_ASN_TEMPLATE |
| 128 | + |
| 129 | +#define WOLFSSL_CERT_GEN |
| 130 | +#define WOLFSSL_CERT_REQ |
| 131 | +#define WOLFSSL_CERT_EXT |
| 132 | + |
| 133 | +#define HAVE_PKCS7 |
| 134 | +#define HAVE_X963_KDF |
| 135 | +#define WOLFSSL_BASE64_ENCODE |
| 136 | + |
| 137 | +#if 1 |
| 138 | + #define HAVE_SESSION_TICKETS |
| 139 | + #define SMALL_SESSION_CACHE |
| 140 | +#else |
| 141 | + #define NO_SESSION_CACHE |
| 142 | +#endif |
| 143 | + |
| 144 | +/* Disables */ |
| 145 | +#define NO_PKCS8 |
| 146 | +#define NO_PKCS12 |
| 147 | +#define NO_PWDBASED |
| 148 | +#define NO_DSA |
| 149 | +#define NO_DES3 |
| 150 | +#define NO_RC4 |
| 151 | +#define NO_PSK |
| 152 | +#define NO_MD4 |
| 153 | +#define NO_MD5 |
| 154 | +#define WOLFSSL_NO_SHAKE128 |
| 155 | +#define WOLFSSL_NO_SHAKE256 |
| 156 | + |
| 157 | +/* Logging */ |
| 158 | +#ifdef ENABLE_SECURE_SOCKETS_LOGS |
| 159 | + #define DEBUG_WOLFSSL |
| 160 | +#else |
| 161 | + #define NO_ERROR_STRINGS |
| 162 | +#endif |
| 163 | + |
| 164 | +#ifdef __cplusplus |
| 165 | +} |
| 166 | +#endif |
| 167 | + |
| 168 | +#endif /* WOLF_USER_SETTINGS_TPM_H */ |
0 commit comments