|
26 | 26 | */ |
27 | 27 |
|
28 | 28 | #ifndef MBEDTLS_CONFIG_H |
| 29 | + |
| 30 | +#include "platform/inc/platform_mbed.h" |
| 31 | + |
| 32 | +/* |
| 33 | + * Only use features that do not require an entropy source when |
| 34 | + * DEVICE_ENTROPY_SOURCE is not defined in mbed OS. |
| 35 | + */ |
| 36 | +#if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) |
| 37 | +#include "mbedtls/config-no-entropy.h" |
| 38 | +#else |
29 | 39 | #define MBEDTLS_CONFIG_H |
30 | 40 |
|
31 | 41 | #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) |
|
71 | 81 | * The time does not need to be correct, only time differences are used, |
72 | 82 | * by contrast with MBEDTLS_HAVE_TIME_DATE |
73 | 83 | * |
| 84 | + * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT, |
| 85 | + * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and |
| 86 | + * MBEDTLS_PLATFORM_STD_TIME. |
| 87 | + * |
74 | 88 | * Comment if your system does not support time functions |
75 | 89 | */ |
76 | 90 | #define MBEDTLS_HAVE_TIME |
|
148 | 162 | * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as |
149 | 163 | * MBEDTLS_PLATFORM_XXX_MACRO! |
150 | 164 | * |
| 165 | + * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME |
| 166 | + * |
151 | 167 | * Uncomment a macro to enable alternate implementation of specific base |
152 | 168 | * platform function |
153 | 169 | */ |
|
1954 | 1970 | * environment: |
1955 | 1971 | * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS |
1956 | 1972 | * |
1957 | | - * Module: library/net.c |
| 1973 | + * Module: library/net_sockets.c |
1958 | 1974 | * |
1959 | 1975 | * This module provides networking routines. |
1960 | 1976 | */ |
|
2503 | 2519 | /* Entropy options */ |
2504 | 2520 | //#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */ |
2505 | 2521 | //#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */ |
| 2522 | +//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */ |
2506 | 2523 |
|
2507 | 2524 | /* Memory buffer allocator options */ |
2508 | 2525 | //#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ |
|
2512 | 2529 | //#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */ |
2513 | 2530 | //#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */ |
2514 | 2531 | //#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */ |
2515 | | -//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined */ |
| 2532 | +//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ |
2516 | 2533 | //#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */ |
2517 | 2534 | //#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ |
2518 | 2535 | /* Note: your snprintf must correclty zero-terminate the buffer! */ |
|
2528 | 2545 | //#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */ |
2529 | 2546 | //#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */ |
2530 | 2547 | //#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */ |
2531 | | -//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined */ |
2532 | | -//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined */ |
| 2548 | +//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ |
| 2549 | +//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ |
2533 | 2550 | //#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */ |
2534 | 2551 | //#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */ |
2535 | 2552 | /* Note: your snprintf must correclty zero-terminate the buffer! */ |
|
2563 | 2580 |
|
2564 | 2581 | /* X509 options */ |
2565 | 2582 | //#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */ |
| 2583 | +//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */ |
2566 | 2584 |
|
2567 | 2585 | /* \} name SECTION: Customisation configuration options */ |
2568 | 2586 |
|
2569 | 2587 | /* Target and application specific configurations */ |
2570 | | -//#define YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE "target_config.h" |
| 2588 | +//#define YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE "mbedtls/target_config.h" |
| 2589 | + |
| 2590 | +#if defined(TARGET_LIKE_MBED) && defined(YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE) |
| 2591 | +#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE |
| 2592 | +#endif |
2571 | 2593 |
|
2572 | 2594 | /* |
2573 | 2595 | * Allow user to override any previous default. |
|
2584 | 2606 |
|
2585 | 2607 | #include "check_config.h" |
2586 | 2608 |
|
| 2609 | +#endif /* !MBEDTLS_ENTROPY_HARDWARE_ALT */ |
2587 | 2610 | #endif /* MBEDTLS_CONFIG_H */ |
0 commit comments