113498266Sopenharmony_ci/***************************************************************************
213498266Sopenharmony_ci *                                  _   _ ____  _
313498266Sopenharmony_ci *  Project                     ___| | | |  _ \| |
413498266Sopenharmony_ci *                             / __| | | | |_) | |
513498266Sopenharmony_ci *                            | (__| |_| |  _ <| |___
613498266Sopenharmony_ci *                             \___|\___/|_| \_\_____|
713498266Sopenharmony_ci *
813498266Sopenharmony_ci * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
913498266Sopenharmony_ci *
1013498266Sopenharmony_ci * This software is licensed as described in the file COPYING, which
1113498266Sopenharmony_ci * you should have received as part of this distribution. The terms
1213498266Sopenharmony_ci * are also available at https://curl.se/docs/copyright.html.
1313498266Sopenharmony_ci *
1413498266Sopenharmony_ci * You may opt to use, copy, modify, merge, publish, distribute and/or sell
1513498266Sopenharmony_ci * copies of the Software, and permit persons to whom the Software is
1613498266Sopenharmony_ci * furnished to do so, under the terms of the COPYING file.
1713498266Sopenharmony_ci *
1813498266Sopenharmony_ci * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
1913498266Sopenharmony_ci * KIND, either express or implied.
2013498266Sopenharmony_ci *
2113498266Sopenharmony_ci * SPDX-License-Identifier: curl
2213498266Sopenharmony_ci *
2313498266Sopenharmony_ci ***************************************************************************/
2413498266Sopenharmony_ci/*
2513498266Sopenharmony_ciBy default wolfSSL has a very conservative configuration that can result in
2613498266Sopenharmony_ciconnections to servers failing due to certificate or algorithm problems.
2713498266Sopenharmony_ciTo remedy this issue for libcurl I've generated this options file that
2813498266Sopenharmony_cibuild-wolfssl will copy to the wolfSSL include directories and will result in
2913498266Sopenharmony_cimaximum compatibility.
3013498266Sopenharmony_ci
3113498266Sopenharmony_ciThese are the configure options that were used to build wolfSSL v5.1.1 in
3213498266Sopenharmony_cimingw and generate the options in this file:
3313498266Sopenharmony_ci
3413498266Sopenharmony_ciC_EXTRA_FLAGS="\
3513498266Sopenharmony_ci  -Wno-attributes \
3613498266Sopenharmony_ci  -Wno-unused-but-set-variable \
3713498266Sopenharmony_ci  -DFP_MAX_BITS=16384 \
3813498266Sopenharmony_ci  -DHAVE_SECRET_CALLBACK \
3913498266Sopenharmony_ci  -DTFM_TIMING_RESISTANT \
4013498266Sopenharmony_ci  -DUSE_WOLF_STRTOK \
4113498266Sopenharmony_ci  -DWOLFSSL_DES_ECB \
4213498266Sopenharmony_ci  -DWOLFSSL_STATIC_DH \
4313498266Sopenharmony_ci  -DWOLFSSL_STATIC_RSA \
4413498266Sopenharmony_ci  " \
4513498266Sopenharmony_ci./configure --prefix=/usr/local \
4613498266Sopenharmony_ci  --disable-jobserver \
4713498266Sopenharmony_ci  --enable-aesgcm \
4813498266Sopenharmony_ci  --enable-alpn \
4913498266Sopenharmony_ci  --enable-altcertchains \
5013498266Sopenharmony_ci  --enable-certgen \
5113498266Sopenharmony_ci  --enable-des3 \
5213498266Sopenharmony_ci  --enable-dh \
5313498266Sopenharmony_ci  --enable-dsa \
5413498266Sopenharmony_ci  --enable-ecc \
5513498266Sopenharmony_ci  --enable-eccshamir \
5613498266Sopenharmony_ci  --enable-fastmath \
5713498266Sopenharmony_ci  --enable-opensslextra \
5813498266Sopenharmony_ci  --enable-ripemd \
5913498266Sopenharmony_ci  --enable-sessioncerts \
6013498266Sopenharmony_ci  --enable-sha512 \
6113498266Sopenharmony_ci  --enable-sni \
6213498266Sopenharmony_ci  --enable-tlsv10 \
6313498266Sopenharmony_ci  --enable-supportedcurves \
6413498266Sopenharmony_ci  --enable-tls13 \
6513498266Sopenharmony_ci  --enable-testcert \
6613498266Sopenharmony_ci  > config.out 2>&1
6713498266Sopenharmony_ci
6813498266Sopenharmony_ciTwo generated options HAVE_THREAD_LS and _POSIX_THREADS were removed since they
6913498266Sopenharmony_ciare inapplicable for our Visual Studio build. Currently thread local storage is
7013498266Sopenharmony_cionly used by the Fixed Point cache ECC which we're not enabling. However even
7113498266Sopenharmony_ciif we later may decide to enable the cache it will fallback on mutexes when
7213498266Sopenharmony_cithread local storage is not available. wolfSSL is using __declspec(thread) to
7313498266Sopenharmony_cicreate the thread local storage and that could be a problem for LoadLibrary.
7413498266Sopenharmony_ci
7513498266Sopenharmony_ciRegarding the options that were added via C_EXTRA_FLAGS:
7613498266Sopenharmony_ci
7713498266Sopenharmony_ciFP_MAX_BITS=16384
7813498266Sopenharmony_cihttps://www.yassl.com/forums/topic423-cacertorgs-ca-cert-verify-failed-but-withdisablefastmath-it-works.html
7913498266Sopenharmony_ci"Since root.crt uses a 4096-bit RSA key, you'll need to increase the fastmath
8013498266Sopenharmony_cibuffer size.  You can do this using the define:
8113498266Sopenharmony_ciFP_MAX_BITS and setting it to 8192."
8213498266Sopenharmony_ci
8313498266Sopenharmony_ciHAVE_SECRET_CALLBACK
8413498266Sopenharmony_ciBuild wolfSSL with wolfSSL_set_tls13_secret_cb which allows saving TLS 1.3
8513498266Sopenharmony_cisecrets to SSLKEYLOGFILE.
8613498266Sopenharmony_ci
8713498266Sopenharmony_ciTFM_TIMING_RESISTANT
8813498266Sopenharmony_cihttps://wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html
8913498266Sopenharmony_ciFrom section 2.4.5 Increasing Performance, USE_FAST_MATH:
9013498266Sopenharmony_ci"Because the stack memory usage can be larger when using fastmath, we recommend
9113498266Sopenharmony_cidefining TFM_TIMING_RESISTANT as well when using this option."
9213498266Sopenharmony_ci
9313498266Sopenharmony_ciUSE_WOLF_STRTOK
9413498266Sopenharmony_ciBuild wolfSSL to always use its internal strtok instead of C runtime strtok.
9513498266Sopenharmony_ci
9613498266Sopenharmony_ciWOLFSSL_DES_ECB
9713498266Sopenharmony_ciBuild wolfSSL with wolfSSL_DES_ecb_encrypt which is needed by libcurl for NTLM.
9813498266Sopenharmony_ci
9913498266Sopenharmony_ciWOLFSSL_STATIC_DH:    Allow TLS_ECDH_ ciphers
10013498266Sopenharmony_ciWOLFSSL_STATIC_RSA:   Allow TLS_RSA_ ciphers
10113498266Sopenharmony_cihttps://github.com/wolfSSL/wolfssl/blob/v3.6.6/README.md#note-1
10213498266Sopenharmony_ciStatic key cipher suites are deprecated and disabled by default since v3.6.6.
10313498266Sopenharmony_ci*/
10413498266Sopenharmony_ci
10513498266Sopenharmony_ci/* wolfssl options.h
10613498266Sopenharmony_ci * generated from configure options
10713498266Sopenharmony_ci *
10813498266Sopenharmony_ci * Copyright (C) 2006-2022 wolfSSL Inc.
10913498266Sopenharmony_ci *
11013498266Sopenharmony_ci * This file is part of wolfSSL. (formerly known as CyaSSL)
11113498266Sopenharmony_ci *
11213498266Sopenharmony_ci */
11313498266Sopenharmony_ci
11413498266Sopenharmony_ci#ifndef WOLFSSL_OPTIONS_H
11513498266Sopenharmony_ci#define WOLFSSL_OPTIONS_H
11613498266Sopenharmony_ci
11713498266Sopenharmony_ci
11813498266Sopenharmony_ci#ifdef __cplusplus
11913498266Sopenharmony_ciextern "C" {
12013498266Sopenharmony_ci#endif
12113498266Sopenharmony_ci
12213498266Sopenharmony_ci#undef  FP_MAX_BITS
12313498266Sopenharmony_ci#define FP_MAX_BITS 16384
12413498266Sopenharmony_ci
12513498266Sopenharmony_ci#undef  HAVE_SECRET_CALLBACK
12613498266Sopenharmony_ci#define HAVE_SECRET_CALLBACK
12713498266Sopenharmony_ci
12813498266Sopenharmony_ci#undef  TFM_TIMING_RESISTANT
12913498266Sopenharmony_ci#define TFM_TIMING_RESISTANT
13013498266Sopenharmony_ci
13113498266Sopenharmony_ci#undef  USE_WOLF_STRTOK
13213498266Sopenharmony_ci#define USE_WOLF_STRTOK
13313498266Sopenharmony_ci
13413498266Sopenharmony_ci#undef  WOLFSSL_DES_ECB
13513498266Sopenharmony_ci#define WOLFSSL_DES_ECB
13613498266Sopenharmony_ci
13713498266Sopenharmony_ci#undef  WOLFSSL_STATIC_DH
13813498266Sopenharmony_ci#define WOLFSSL_STATIC_DH
13913498266Sopenharmony_ci
14013498266Sopenharmony_ci#undef  WOLFSSL_STATIC_RSA
14113498266Sopenharmony_ci#define WOLFSSL_STATIC_RSA
14213498266Sopenharmony_ci
14313498266Sopenharmony_ci#undef  TFM_TIMING_RESISTANT
14413498266Sopenharmony_ci#define TFM_TIMING_RESISTANT
14513498266Sopenharmony_ci
14613498266Sopenharmony_ci#undef  ECC_TIMING_RESISTANT
14713498266Sopenharmony_ci#define ECC_TIMING_RESISTANT
14813498266Sopenharmony_ci
14913498266Sopenharmony_ci#undef  WC_RSA_BLINDING
15013498266Sopenharmony_ci#define WC_RSA_BLINDING
15113498266Sopenharmony_ci
15213498266Sopenharmony_ci#undef  WOLFSSL_USE_ALIGN
15313498266Sopenharmony_ci#define WOLFSSL_USE_ALIGN
15413498266Sopenharmony_ci
15513498266Sopenharmony_ci#undef  WOLFSSL_RIPEMD
15613498266Sopenharmony_ci#define WOLFSSL_RIPEMD
15713498266Sopenharmony_ci
15813498266Sopenharmony_ci#undef  WOLFSSL_SHA512
15913498266Sopenharmony_ci#define WOLFSSL_SHA512
16013498266Sopenharmony_ci
16113498266Sopenharmony_ci#undef  WOLFSSL_SHA384
16213498266Sopenharmony_ci#define WOLFSSL_SHA384
16313498266Sopenharmony_ci
16413498266Sopenharmony_ci#undef  SESSION_CERTS
16513498266Sopenharmony_ci#define SESSION_CERTS
16613498266Sopenharmony_ci
16713498266Sopenharmony_ci#undef  HAVE_HKDF
16813498266Sopenharmony_ci#define HAVE_HKDF
16913498266Sopenharmony_ci
17013498266Sopenharmony_ci#undef  HAVE_ECC
17113498266Sopenharmony_ci#define HAVE_ECC
17213498266Sopenharmony_ci
17313498266Sopenharmony_ci#undef  TFM_ECC256
17413498266Sopenharmony_ci#define TFM_ECC256
17513498266Sopenharmony_ci
17613498266Sopenharmony_ci#undef  ECC_SHAMIR
17713498266Sopenharmony_ci#define ECC_SHAMIR
17813498266Sopenharmony_ci
17913498266Sopenharmony_ci#undef  WOLFSSL_ALLOW_TLSV10
18013498266Sopenharmony_ci#define WOLFSSL_ALLOW_TLSV10
18113498266Sopenharmony_ci
18213498266Sopenharmony_ci#undef  WC_RSA_PSS
18313498266Sopenharmony_ci#define WC_RSA_PSS
18413498266Sopenharmony_ci
18513498266Sopenharmony_ci#undef  NO_HC128
18613498266Sopenharmony_ci#define NO_HC128
18713498266Sopenharmony_ci
18813498266Sopenharmony_ci#undef  NO_RABBIT
18913498266Sopenharmony_ci#define NO_RABBIT
19013498266Sopenharmony_ci
19113498266Sopenharmony_ci#undef  HAVE_POLY1305
19213498266Sopenharmony_ci#define HAVE_POLY1305
19313498266Sopenharmony_ci
19413498266Sopenharmony_ci#undef  HAVE_ONE_TIME_AUTH
19513498266Sopenharmony_ci#define HAVE_ONE_TIME_AUTH
19613498266Sopenharmony_ci
19713498266Sopenharmony_ci#undef  HAVE_CHACHA
19813498266Sopenharmony_ci#define HAVE_CHACHA
19913498266Sopenharmony_ci
20013498266Sopenharmony_ci#undef  HAVE_HASHDRBG
20113498266Sopenharmony_ci#define HAVE_HASHDRBG
20213498266Sopenharmony_ci
20313498266Sopenharmony_ci#undef  HAVE_TLS_EXTENSIONS
20413498266Sopenharmony_ci#define HAVE_TLS_EXTENSIONS
20513498266Sopenharmony_ci
20613498266Sopenharmony_ci#undef  HAVE_SNI
20713498266Sopenharmony_ci#define HAVE_SNI
20813498266Sopenharmony_ci
20913498266Sopenharmony_ci#undef  HAVE_TLS_EXTENSIONS
21013498266Sopenharmony_ci#define HAVE_TLS_EXTENSIONS
21113498266Sopenharmony_ci
21213498266Sopenharmony_ci#undef  HAVE_ALPN
21313498266Sopenharmony_ci#define HAVE_ALPN
21413498266Sopenharmony_ci
21513498266Sopenharmony_ci#undef  HAVE_TLS_EXTENSIONS
21613498266Sopenharmony_ci#define HAVE_TLS_EXTENSIONS
21713498266Sopenharmony_ci
21813498266Sopenharmony_ci#undef  HAVE_SUPPORTED_CURVES
21913498266Sopenharmony_ci#define HAVE_SUPPORTED_CURVES
22013498266Sopenharmony_ci
22113498266Sopenharmony_ci#undef  HAVE_FFDHE_2048
22213498266Sopenharmony_ci#define HAVE_FFDHE_2048
22313498266Sopenharmony_ci
22413498266Sopenharmony_ci#undef  HAVE_SUPPORTED_CURVES
22513498266Sopenharmony_ci#define HAVE_SUPPORTED_CURVES
22613498266Sopenharmony_ci
22713498266Sopenharmony_ci#undef  WOLFSSL_TLS13
22813498266Sopenharmony_ci#define WOLFSSL_TLS13
22913498266Sopenharmony_ci
23013498266Sopenharmony_ci#undef  HAVE_TLS_EXTENSIONS
23113498266Sopenharmony_ci#define HAVE_TLS_EXTENSIONS
23213498266Sopenharmony_ci
23313498266Sopenharmony_ci#undef  HAVE_EXTENDED_MASTER
23413498266Sopenharmony_ci#define HAVE_EXTENDED_MASTER
23513498266Sopenharmony_ci
23613498266Sopenharmony_ci#undef  WOLFSSL_ALT_CERT_CHAINS
23713498266Sopenharmony_ci#define WOLFSSL_ALT_CERT_CHAINS
23813498266Sopenharmony_ci
23913498266Sopenharmony_ci#undef  WOLFSSL_TEST_CERT
24013498266Sopenharmony_ci#define WOLFSSL_TEST_CERT
24113498266Sopenharmony_ci
24213498266Sopenharmony_ci#undef  NO_RC4
24313498266Sopenharmony_ci#define NO_RC4
24413498266Sopenharmony_ci
24513498266Sopenharmony_ci#undef  HAVE_ENCRYPT_THEN_MAC
24613498266Sopenharmony_ci#define HAVE_ENCRYPT_THEN_MAC
24713498266Sopenharmony_ci
24813498266Sopenharmony_ci#undef  NO_PSK
24913498266Sopenharmony_ci#define NO_PSK
25013498266Sopenharmony_ci
25113498266Sopenharmony_ci#undef  NO_MD4
25213498266Sopenharmony_ci#define NO_MD4
25313498266Sopenharmony_ci
25413498266Sopenharmony_ci#undef  WOLFSSL_ENCRYPTED_KEYS
25513498266Sopenharmony_ci#define WOLFSSL_ENCRYPTED_KEYS
25613498266Sopenharmony_ci
25713498266Sopenharmony_ci#undef  USE_FAST_MATH
25813498266Sopenharmony_ci#define USE_FAST_MATH
25913498266Sopenharmony_ci
26013498266Sopenharmony_ci#undef  WC_NO_ASYNC_THREADING
26113498266Sopenharmony_ci#define WC_NO_ASYNC_THREADING
26213498266Sopenharmony_ci
26313498266Sopenharmony_ci#undef  HAVE_DH_DEFAULT_PARAMS
26413498266Sopenharmony_ci#define HAVE_DH_DEFAULT_PARAMS
26513498266Sopenharmony_ci
26613498266Sopenharmony_ci#undef  WOLFSSL_CERT_GEN
26713498266Sopenharmony_ci#define WOLFSSL_CERT_GEN
26813498266Sopenharmony_ci
26913498266Sopenharmony_ci#undef  OPENSSL_EXTRA
27013498266Sopenharmony_ci#define OPENSSL_EXTRA
27113498266Sopenharmony_ci
27213498266Sopenharmony_ci#undef  WOLFSSL_ALWAYS_VERIFY_CB
27313498266Sopenharmony_ci#define WOLFSSL_ALWAYS_VERIFY_CB
27413498266Sopenharmony_ci
27513498266Sopenharmony_ci#undef  WOLFSSL_VERIFY_CB_ALL_CERTS
27613498266Sopenharmony_ci#define WOLFSSL_VERIFY_CB_ALL_CERTS
27713498266Sopenharmony_ci
27813498266Sopenharmony_ci#undef  WOLFSSL_EXTRA_ALERTS
27913498266Sopenharmony_ci#define WOLFSSL_EXTRA_ALERTS
28013498266Sopenharmony_ci
28113498266Sopenharmony_ci#undef  HAVE_EXT_CACHE
28213498266Sopenharmony_ci#define HAVE_EXT_CACHE
28313498266Sopenharmony_ci
28413498266Sopenharmony_ci#undef  WOLFSSL_FORCE_CACHE_ON_TICKET
28513498266Sopenharmony_ci#define WOLFSSL_FORCE_CACHE_ON_TICKET
28613498266Sopenharmony_ci
28713498266Sopenharmony_ci#undef  WOLFSSL_AKID_NAME
28813498266Sopenharmony_ci#define WOLFSSL_AKID_NAME
28913498266Sopenharmony_ci
29013498266Sopenharmony_ci#undef  HAVE_CTS
29113498266Sopenharmony_ci#define HAVE_CTS
29213498266Sopenharmony_ci
29313498266Sopenharmony_ci#undef  GCM_TABLE_4BIT
29413498266Sopenharmony_ci#define GCM_TABLE_4BIT
29513498266Sopenharmony_ci
29613498266Sopenharmony_ci#undef  HAVE_AESGCM
29713498266Sopenharmony_ci#define HAVE_AESGCM
29813498266Sopenharmony_ci
29913498266Sopenharmony_ci#undef  HAVE_WC_INTROSPECTION
30013498266Sopenharmony_ci#define HAVE_WC_INTROSPECTION
30113498266Sopenharmony_ci
30213498266Sopenharmony_ci
30313498266Sopenharmony_ci#ifdef __cplusplus
30413498266Sopenharmony_ci} /* end of extern "C" */
30513498266Sopenharmony_ci#endif
30613498266Sopenharmony_ci
30713498266Sopenharmony_ci
30813498266Sopenharmony_ci#endif /* WOLFSSL_OPTIONS_H */
309