From 3f8150e3915dcca8c6f36060655329478cde301f Mon Sep 17 00:00:00 2001 From: Federico Pellegrin Date: Sun, 16 Oct 2022 05:46:26 +0200 Subject: [PATCH] TLS: update CRL load time also when loading from file Similarly as done when loading a CRL directly, this allows to have the CA chain recalculated for ongoing connections also when using CRLs from files. --- hal/tls/mbedtls/tls_mbedtls.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hal/tls/mbedtls/tls_mbedtls.c b/hal/tls/mbedtls/tls_mbedtls.c index aa289222..4d26973f 100644 --- a/hal/tls/mbedtls/tls_mbedtls.c +++ b/hal/tls/mbedtls/tls_mbedtls.c @@ -465,8 +465,12 @@ TLSConfiguration_addCRLFromFile(TLSConfiguration self, const char* filename) { int ret = mbedtls_x509_crl_parse_file(&(self->crl), filename); - if (ret != 0) + if (ret != 0) { DEBUG_PRINT("TLS", "mbedtls_x509_crl_parse_file returned %d\n", ret); + } + else { + self->crlUpdated = Hal_getTimeInMs(); + } return (ret == 0); }