rp2/mbedtls: Enable certificate validity time validation.

This commit is contained in:
Ian Davies
2022-07-03 18:35:17 +01:00
committed by Damien George
parent 10f85fee18
commit b560b9fe71
2 changed files with 15 additions and 0 deletions

View File

@@ -29,6 +29,9 @@
#include "mbedtls_config.h"
#include "hardware/rtc.h"
#include "shared/timeutils/timeutils.h"
extern uint8_t rosc_random_u8(size_t cycles);
int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len, size_t *olen) {
@@ -39,4 +42,10 @@ int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len, size_t
return 0;
}
time_t rp2_rtctime_seconds(time_t *timer) {
datetime_t t;
rtc_get_datetime(&t);
return timeutils_seconds_since_epoch(t.year, t.month, t.day, t.hour, t.min, t.sec);
}
#endif