forked from espressif/esp-idf
Merge branch 'feature/mbedtls/add_menuconfig_component' into 'master'
components/mbedtls: add time and time data configuration at menuconfig See merge request !268
This commit is contained in:
@@ -81,4 +81,24 @@ config MBEDTLS_HARDWARE_SHA
|
|||||||
be calculated fully in hardware and the rest will be calculated
|
be calculated fully in hardware and the rest will be calculated
|
||||||
(at least partially calculated) in software.
|
(at least partially calculated) in software.
|
||||||
|
|
||||||
|
config MBEDTLS_HAVE_TIME
|
||||||
|
bool "Enable mbedtls time"
|
||||||
|
depends on !ESP32_TIME_SYSCALL_USE_NONE
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
System has time.h and time().
|
||||||
|
The time does not need to be correct, only time differences are used,
|
||||||
|
|
||||||
|
config MBEDTLS_HAVE_TIME_DATE
|
||||||
|
bool "Enable mbedtls time data"
|
||||||
|
depends on MBEDTLS_HAVE_TIME
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
System has time.h and time(), gmtime() and the clock is correct.
|
||||||
|
The time needs to be correct (not necesarily very accurate, but at least
|
||||||
|
the date should be correct). This is used to verify the validity period of
|
||||||
|
X.509 certificates.
|
||||||
|
|
||||||
|
It is suggested that you should get the real time by "SNTP".
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@@ -74,7 +74,9 @@
|
|||||||
*
|
*
|
||||||
* Comment if your system does not support time functions
|
* Comment if your system does not support time functions
|
||||||
*/
|
*/
|
||||||
//#define MBEDTLS_HAVE_TIME
|
#ifdef CONFIG_MBEDTLS_HAVE_TIME
|
||||||
|
#define MBEDTLS_HAVE_TIME
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def MBEDTLS_HAVE_TIME_DATE
|
* \def MBEDTLS_HAVE_TIME_DATE
|
||||||
@@ -86,7 +88,9 @@
|
|||||||
*
|
*
|
||||||
* Comment if your system does not have a correct clock.
|
* Comment if your system does not have a correct clock.
|
||||||
*/
|
*/
|
||||||
//#define MBEDTLS_HAVE_TIME_DATE
|
#ifdef CONFIG_MBEDTLS_HAVE_TIME_DATE
|
||||||
|
#define MBEDTLS_HAVE_TIME_DATE
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def MBEDTLS_PLATFORM_MEMORY
|
* \def MBEDTLS_PLATFORM_MEMORY
|
||||||
|
@@ -29,6 +29,16 @@
|
|||||||
|
|
||||||
#if !defined(MBEDTLS_NET_C)
|
#if !defined(MBEDTLS_NET_C)
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_PLATFORM_C)
|
||||||
|
#include "mbedtls/platform.h"
|
||||||
|
#else
|
||||||
|
#include <stdlib.h>
|
||||||
|
#define mbedtls_calloc calloc
|
||||||
|
#define mbedtls_free free
|
||||||
|
#define mbedtls_time time
|
||||||
|
#define mbedtls_time_t time_t
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "mbedtls/net.h"
|
#include "mbedtls/net.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
#include "lwip/netdb.h"
|
#include "lwip/netdb.h"
|
||||||
#include "lwip/dns.h"
|
#include "lwip/dns.h"
|
||||||
|
|
||||||
|
#include "mbedtls/platform.h"
|
||||||
#include "mbedtls/net.h"
|
#include "mbedtls/net.h"
|
||||||
#include "mbedtls/debug.h"
|
#include "mbedtls/debug.h"
|
||||||
#include "mbedtls/ssl.h"
|
#include "mbedtls/ssl.h"
|
||||||
|
@@ -9,7 +9,7 @@ config TARGET_DOMAIN
|
|||||||
config TARGET_PORT_NUMBER
|
config TARGET_PORT_NUMBER
|
||||||
int "Target port number"
|
int "Target port number"
|
||||||
range 0 65535
|
range 0 65535
|
||||||
default 433
|
default 443
|
||||||
help
|
help
|
||||||
Target port number for the example to connect to.
|
Target port number for the example to connect to.
|
||||||
|
|
||||||
@@ -25,4 +25,4 @@ config WIFI_PASSWORD
|
|||||||
help
|
help
|
||||||
WiFi password (WPA or WPA2) for the example to use.
|
WiFi password (WPA or WPA2) for the example to use.
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
Reference in New Issue
Block a user