You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
681 lines
20 KiB
681 lines
20 KiB
/**
|
|
* \file config.h
|
|
*
|
|
* \brief Configuration options (set of defines)
|
|
*
|
|
* This set of compile-time options may be used to enable
|
|
* or disable features selectively, and reduce the global
|
|
* memory footprint.
|
|
*/
|
|
/*
|
|
* Copyright The Mbed TLS Contributors
|
|
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
|
*
|
|
* This file is provided under the Apache License 2.0, or the
|
|
* GNU General Public License v2.0 or later.
|
|
*
|
|
* **********
|
|
* Apache License 2.0:
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
* not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*
|
|
* **********
|
|
*
|
|
* **********
|
|
* GNU General Public License v2.0 or later:
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*
|
|
* **********
|
|
*/
|
|
|
|
#ifndef MBEDTLS_CONFIG_H
|
|
#define MBEDTLS_CONFIG_H
|
|
|
|
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
|
#define _CRT_SECURE_NO_DEPRECATE 1
|
|
#endif
|
|
|
|
#include "drv_osal_lib.h"
|
|
|
|
#ifdef CONFIG_SOCT_CIPHER_MBEDTLS_SUPPORT
|
|
typedef unsigned char uint8_t;
|
|
typedef unsigned short uint16_t;
|
|
typedef unsigned int uint32_t;
|
|
typedef unsigned long long uint64_t;
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_PLATFORM_MEMORY
|
|
*
|
|
* Enable the memory allocation layer.
|
|
*
|
|
* By default mbed TLS uses the system-provided calloc() and free().
|
|
* This allows different allocators (self-implemented or provided) to be
|
|
* provided to the platform abstraction layer.
|
|
*
|
|
* Enabling MBEDTLS_PLATFORM_MEMORY without the
|
|
* MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
|
|
* "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
|
|
* free() function pointer at runtime.
|
|
*
|
|
* Enabling MBEDTLS_PLATFORM_MEMORY and specifying
|
|
* MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
|
|
* alternate function at compile time.
|
|
*
|
|
* Requires: MBEDTLS_PLATFORM_C
|
|
*
|
|
* Enable this layer to allow use of alternative memory allocators.
|
|
*/
|
|
#define MBEDTLS_PLATFORM_MEMORY
|
|
|
|
/**
|
|
* \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
|
*
|
|
* Do not assign standard functions in the platform layer (e.g. calloc() to
|
|
* MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF)
|
|
*
|
|
* This makes sure there are no linking errors on platforms that do not support
|
|
* these functions. You will HAVE to provide alternatives, either at runtime
|
|
* via the platform_set_xxx() functions or at compile time by setting
|
|
* the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a
|
|
* MBEDTLS_PLATFORM_XXX_MACRO.
|
|
*
|
|
* Requires: MBEDTLS_PLATFORM_C
|
|
*
|
|
* Uncomment to prevent default assignment of standard functions in the
|
|
* platform layer.
|
|
*/
|
|
#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
|
|
|
/**
|
|
* \def MBEDTLS_PLATFORM_EXIT_ALT
|
|
*
|
|
* MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the
|
|
* function in the platform abstraction layer.
|
|
*
|
|
* Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will
|
|
* provide a function "mbedtls_platform_set_printf()" that allows you to set an
|
|
* alternative printf function pointer.
|
|
*
|
|
* All these define require MBEDTLS_PLATFORM_C to be defined!
|
|
*
|
|
* \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows;
|
|
* it will be enabled automatically by check_config.h
|
|
*
|
|
* \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as
|
|
* MBEDTLS_PLATFORM_XXX_MACRO!
|
|
*
|
|
* Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME
|
|
*
|
|
* Uncomment a macro to enable alternate implementation of specific base
|
|
* platform function
|
|
*/
|
|
#define MBEDTLS_PLATFORM_SNPRINTF_ALT
|
|
|
|
/**
|
|
* \def MBEDTLS_CIPHER_MODE_CBC
|
|
*
|
|
* Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
|
|
*/
|
|
#if defined(SOFT_AES_SUPPORT) || defined(SOFT_TDES_SUPPORT)
|
|
#define MBEDTLS_CIPHER_MODE_CBC
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_CIPHER_MODE_CFB
|
|
*
|
|
* Enable Cipher Feedback mode (CFB) for symmetric ciphers.
|
|
*/
|
|
#if defined(SOFT_AES_SUPPORT)
|
|
#define MBEDTLS_CIPHER_MODE_CFB
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_CIPHER_MODE_CTR
|
|
*
|
|
* Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
|
|
*/
|
|
#if defined(SOFT_AES_SUPPORT)
|
|
#define MBEDTLS_CIPHER_MODE_CTR
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_CIPHER_MODE_OFB
|
|
*
|
|
* Enable Output Feedback mode (OFB) for symmetric ciphers.
|
|
*/
|
|
#if defined(SOFT_AES_SUPPORT)
|
|
#define MBEDTLS_CIPHER_MODE_OFB
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
|
|
*
|
|
* MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
|
|
* module. By default all supported curves are enabled.
|
|
*
|
|
* Comment macros to disable the curve and functions for it
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_SM2_SUPPORT) || defined(CONFIG_SOCT_CIPHER_SOFT_ECC_SUPPORT)
|
|
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_GENPRIME
|
|
*
|
|
* Enable the prime-number generation code.
|
|
*
|
|
* Requires: MBEDTLS_BIGNUM_C
|
|
*/
|
|
#ifdef CONFIG_SOCT_CIPHER_RSA_SUPPORT
|
|
#define MBEDTLS_GENPRIME
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_PKCS1_V15
|
|
*
|
|
* Enable support for PKCS#1 v1.5 encoding.
|
|
*
|
|
* Requires: MBEDTLS_RSA_C
|
|
*
|
|
* This enables support for PKCS#1 v1.5 operations.
|
|
*/
|
|
#define MBEDTLS_PKCS1_V15
|
|
|
|
/**
|
|
* \def MBEDTLS_PKCS1_V21
|
|
*
|
|
* Enable support for PKCS#1 v2.1 encoding.
|
|
*
|
|
* Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
|
|
*
|
|
* This enables support for RSAES-OAEP and RSASSA-PSS operations.
|
|
*/
|
|
#define MBEDTLS_PKCS1_V21
|
|
|
|
/**
|
|
* \def MBEDTLS_RSA_NO_CRT
|
|
*
|
|
* Do not use the Chinese Remainder Theorem
|
|
* for the RSA private operation.
|
|
*
|
|
* Uncomment this macro to disable the use of CRT in RSA.
|
|
*
|
|
*/
|
|
#define MBEDTLS_RSA_NO_CRT
|
|
|
|
/**
|
|
* \def MBEDTLS_AES_C
|
|
*
|
|
* Enable the AES block cipher.
|
|
*
|
|
* Module: library/aes.c
|
|
* Caller: library/cipher.c
|
|
* library/pem.c
|
|
* library/ctr_drbg.c
|
|
*
|
|
* This module enables the following ciphersuites (if other requisites are
|
|
* enabled as well):
|
|
* MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
|
|
* MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
|
|
* MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
|
|
* MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
|
|
* MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
|
|
* MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
|
|
* MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
|
|
* MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
|
|
* MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
|
|
* MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
|
* MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
|
|
* MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
|
|
* MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
|
|
* MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
|
|
* MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
|
|
* MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
|
|
* MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
|
|
* MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
|
|
* MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
|
|
* MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
|
|
* MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
|
|
* MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
|
|
* MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
|
|
* MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
|
|
* MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
|
|
* MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
|
|
* MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
|
|
* MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
|
|
* MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
|
|
* MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
|
|
* MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
|
|
* MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
|
|
* MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
|
|
* MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
|
|
* MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
|
|
* MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
|
|
* MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
|
|
* MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
|
|
* MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
|
|
* MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
|
|
*
|
|
* PEM_PARSE uses AES for decrypting encrypted keys.
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_AES_CCM_GCM_SUPPORT) || defined(SOFT_AES_SUPPORT)
|
|
#define MBEDTLS_AES_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_ASN1_PARSE_C
|
|
*
|
|
* Enable the generic ASN1 parser.
|
|
*
|
|
* Module: library/asn1.c
|
|
* Caller: library/x509.c
|
|
* library/dhm.c
|
|
* library/pkcs12.c
|
|
* library/pkcs5.c
|
|
* library/pkparse.c
|
|
*/
|
|
#define MBEDTLS_ASN1_PARSE_C
|
|
|
|
/**
|
|
* \def MBEDTLS_ASN1_WRITE_C
|
|
*
|
|
* Enable the generic ASN1 writer.
|
|
*
|
|
* Module: library/asn1write.c
|
|
* Caller: library/ecdsa.c
|
|
* library/pkwrite.c
|
|
* library/x509_create.c
|
|
* library/x509write_crt.c
|
|
* library/x509write_csr.c
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_ECC_SUPPORT)
|
|
#define MBEDTLS_ASN1_WRITE_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_BIGNUM_C
|
|
*
|
|
* Enable the multi-precision integer library.
|
|
*
|
|
* Module: library/bignum.c
|
|
* Caller: library/dhm.c
|
|
* library/ecp.c
|
|
* library/ecdsa.c
|
|
* library/rsa.c
|
|
* library/rsa_internal.c
|
|
* library/ssl_tls.c
|
|
*
|
|
* This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_RSA_SUPPORT)
|
|
#define MBEDTLS_BIGNUM_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_CCM_C
|
|
*
|
|
* Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
|
|
*
|
|
* Module: library/ccm.c
|
|
*
|
|
* Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
|
|
*
|
|
* This module enables the AES-CCM ciphersuites, if other requisites are
|
|
* enabled as well.
|
|
*/
|
|
#ifdef CONFIG_SOCT_CIPHER_SOFT_AES_CCM_GCM_SUPPORT
|
|
#define MBEDTLS_CCM_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_CIPHER_C
|
|
*
|
|
* Enable the generic cipher layer.
|
|
*
|
|
* Module: library/cipher.c
|
|
* Caller: library/ssl_tls.c
|
|
*
|
|
* Uncomment to enable generic cipher wrappers.
|
|
*/
|
|
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_AES_CCM_GCM_SUPPORT) || defined(SOFT_AES_SUPPORT) || defined(SOFT_TDES_SUPPORT)
|
|
#define MBEDTLS_CIPHER_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_DES_C
|
|
*
|
|
* Enable the DES block cipher.
|
|
*
|
|
* Module: library/des.c
|
|
* Caller: library/pem.c
|
|
* library/cipher.c
|
|
*
|
|
* This module enables the following ciphersuites (if other requisites are
|
|
* enabled as well):
|
|
* MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
|
|
* MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
|
|
* MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
|
|
* MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
|
|
* MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
|
|
* MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
|
|
* MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA
|
|
* MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA
|
|
* MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
|
|
* MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
|
|
*
|
|
* PEM_PARSE uses DES/3DES for decrypting encrypted keys.
|
|
*
|
|
* \warning DES is considered a weak cipher and its use constitutes a
|
|
* security risk. We recommend considering stronger ciphers instead.
|
|
*/
|
|
#if defined(SOFT_TDES_SUPPORT)
|
|
#define MBEDTLS_DES_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_ECDH_C
|
|
*
|
|
* Enable the elliptic curve Diffie-Hellman library.
|
|
*
|
|
* Module: library/ecdh.c
|
|
* Caller: library/ssl_cli.c
|
|
* library/ssl_srv.c
|
|
*
|
|
* This module is used by the following key exchanges:
|
|
* ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
|
|
*
|
|
* Requires: MBEDTLS_ECP_C
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_ECC_SUPPORT)
|
|
#define MBEDTLS_ECDH_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_ECDSA_C
|
|
*
|
|
* Enable the elliptic curve DSA library.
|
|
*
|
|
* Module: library/ecdsa.c
|
|
* Caller:
|
|
*
|
|
* This module is used by the following key exchanges:
|
|
* ECDHE-ECDSA
|
|
*
|
|
* Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_ECC_SUPPORT)
|
|
#define MBEDTLS_ECDSA_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_ECP_C
|
|
*
|
|
* Enable the elliptic curve over GF(p) library.
|
|
*
|
|
* Module: library/ecp.c
|
|
* Caller: library/ecdh.c
|
|
* library/ecdsa.c
|
|
* library/ecjpake.c
|
|
*
|
|
* Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_SM2_SUPPORT) || defined(CONFIG_SOCT_CIPHER_SOFT_ECC_SUPPORT)
|
|
#define MBEDTLS_ECP_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_GCM_C
|
|
*
|
|
* Enable the Galois/Counter Mode (GCM) for AES.
|
|
*
|
|
* Module: library/gcm.c
|
|
*
|
|
* Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
|
|
*
|
|
* This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
|
|
* requisites are enabled as well.
|
|
*/
|
|
#ifdef CONFIG_SOCT_CIPHER_SOFT_AES_CCM_GCM_SUPPORT
|
|
#define MBEDTLS_GCM_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_MD_C
|
|
*
|
|
* Enable the generic message digest layer.
|
|
*
|
|
* Module: library/md.c
|
|
* Caller:
|
|
*
|
|
* Uncomment to enable generic message digest wrappers.
|
|
*/
|
|
#ifdef CONFIG_SOCT_CIPHER_RSA_SUPPORT
|
|
#define MBEDTLS_MD_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_OID_C
|
|
*
|
|
* Enable the OID database.
|
|
*
|
|
* Module: library/oid.c
|
|
* Caller: library/asn1write.c
|
|
* library/pkcs5.c
|
|
* library/pkparse.c
|
|
* library/pkwrite.c
|
|
* library/rsa.c
|
|
* library/x509.c
|
|
* library/x509_create.c
|
|
* library/x509_crl.c
|
|
* library/x509_crt.c
|
|
* library/x509_csr.c
|
|
* library/x509write_crt.c
|
|
* library/x509write_csr.c
|
|
*
|
|
* This modules translates between OIDs and internal values.
|
|
*/
|
|
#define MBEDTLS_OID_C
|
|
|
|
/**
|
|
* \def MBEDTLS_PLATFORM_C
|
|
*
|
|
* Enable the platform abstraction layer that allows you to re-assign
|
|
* functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
|
|
*
|
|
* Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
|
|
* or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
|
|
* above to be specified at runtime or compile time respectively.
|
|
*
|
|
* \note This abstraction layer must be enabled on Windows (including MSYS2)
|
|
* as other module rely on it for a fixed snprintf implementation.
|
|
*
|
|
* Module: library/platform.c
|
|
* Caller: Most other .c files
|
|
*
|
|
* This module enables abstraction of common (libc) functions.
|
|
*/
|
|
#define MBEDTLS_PLATFORM_C
|
|
|
|
/**
|
|
* \def MBEDTLS_RSA_C
|
|
*
|
|
* Enable the RSA public-key cryptosystem.
|
|
*
|
|
* Module: library/rsa.c
|
|
* library/rsa_internal.c
|
|
* Caller: library/ssl_cli.c
|
|
* library/ssl_srv.c
|
|
* library/ssl_tls.c
|
|
* library/x509.c
|
|
*
|
|
* This module is used by the following key exchanges:
|
|
* RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
|
|
*
|
|
* Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
|
|
*/
|
|
#ifdef CONFIG_SOCT_CIPHER_RSA_SUPPORT
|
|
#define MBEDTLS_RSA_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_SHA1_C
|
|
*
|
|
* Enable the SHA1 cryptographic hash algorithm.
|
|
*
|
|
* Module: library/sha1.c
|
|
* Caller: library/md.c
|
|
* library/ssl_cli.c
|
|
* library/ssl_srv.c
|
|
* library/ssl_tls.c
|
|
* library/x509write_crt.c
|
|
*
|
|
* This module is required for SSL/TLS up to version 1.1, for TLS 1.2
|
|
* depending on the handshake parameters, and for SHA1-signed certificates.
|
|
*
|
|
* \warning SHA-1 is considered a weak message digest and its use constitutes
|
|
* a security risk. If possible, we recommend avoiding dependencies
|
|
* on it, and considering stronger message digests instead.
|
|
*
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_SHA1_SUPPORT) || defined(MBEDTLS_PKCS1_V15) || defined(MBEDTLS_PKCS1_V21)
|
|
#define MBEDTLS_SHA1_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_SHA224_C
|
|
*
|
|
* Enable the SHA-224 cryptographic hash algorithm.
|
|
*
|
|
* Requires: MBEDTLS_SHA256_C. The library does not currently support enabling
|
|
* SHA-224 without SHA-256.
|
|
*
|
|
* Module: library/sha256.c
|
|
* Caller: library/md.c
|
|
* library/ssl_cookie.c
|
|
*
|
|
* This module adds support for SHA-224.
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_SHA256_SUPPORT) || defined(MBEDTLS_PKCS1_V15) || defined(MBEDTLS_PKCS1_V21)
|
|
#define MBEDTLS_SHA224_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_SHA256_C
|
|
*
|
|
* Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
|
|
*
|
|
* Module: library/sha256.c
|
|
* Caller: library/entropy.c
|
|
* library/md.c
|
|
* library/ssl_cli.c
|
|
* library/ssl_srv.c
|
|
* library/ssl_tls.c
|
|
*
|
|
* This module adds support for SHA-224 and SHA-256.
|
|
* This module is required for the SSL/TLS 1.2 PRF function.
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_SHA256_SUPPORT) || defined(MBEDTLS_PKCS1_V15) || defined(MBEDTLS_PKCS1_V21)
|
|
#define MBEDTLS_SHA256_C
|
|
#endif
|
|
|
|
/**
|
|
* \def MBEDTLS_SHA512_C
|
|
*
|
|
* Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
|
|
*
|
|
* Module: library/sha512.c
|
|
* Caller: library/entropy.c
|
|
* library/md.c
|
|
* library/ssl_cli.c
|
|
* library/ssl_srv.c
|
|
*
|
|
* This module adds support for SHA-384 and SHA-512.
|
|
*/
|
|
#if defined(CONFIG_SOCT_CIPHER_SOFT_SHA512_SUPPORT) || defined(MBEDTLS_PKCS1_V15) || defined(MBEDTLS_PKCS1_V21)
|
|
#define MBEDTLS_SHA512_C
|
|
#endif
|
|
|
|
/* MPI / BIGNUM options */
|
|
#define MBEDTLS_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
|
|
|
|
/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */
|
|
/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */
|
|
#define MBEDTLS_PLATFORM_CALLOC_MACRO crypto_calloc /**< Default allocator macro to use, can be undefined */
|
|
#define MBEDTLS_PLATFORM_FREE_MACRO crypto_free /**< Default free macro to use, can be undefined */
|
|
#define MBEDTLS_PLATFORM_PRINTF_MACRO printk /**< Default printf macro to use, can be undefined */
|
|
|
|
/**
|
|
* Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
|
|
* signature and ciphersuite selection. Without this build-time option, SHA-1
|
|
* support must be activated explicitly through mbedtls_ssl_conf_sig_hashes.
|
|
* The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by
|
|
* default. At the time of writing, there is no practical attack on the use
|
|
* of SHA-1 in handshake signatures, hence this option is turned on by default
|
|
* to preserve compatibility with existing peers, but the general
|
|
* warning applies nonetheless:
|
|
*
|
|
* \warning SHA-1 is considered a weak message digest and its use constitutes
|
|
* a security risk. If possible, we recommend avoiding dependencies
|
|
* on it, and considering stronger message digests instead.
|
|
*
|
|
*/
|
|
#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
|
|
|
|
/* Target and application specific configurations
|
|
*
|
|
* Allow user to override any previous default.
|
|
*
|
|
*/
|
|
#if defined(MBEDTLS_USER_CONFIG_FILE)
|
|
#include MBEDTLS_USER_CONFIG_FILE
|
|
#endif
|
|
|
|
#include "check_config.h"
|
|
|
|
#endif /* MBEDTLS_CONFIG_H */
|
|
|
|
#define MBEDTLS_RSA_NO_CRT
|