tls: add method to reset used CRL (certificate revocation list)

Add a method to be able to reset the CRL, otherwise any previously
added CRL will stay there until the object is totally destroyed.
This proves to be needed for cases when we need to delete the
CRL (ie. it expired) during the lifetime of the server.
v1.6_develop_387
Federico Pellegrin 3 years ago committed by Michael Zillgith
parent 5fe5657157
commit 9ddb10faea

@ -296,6 +296,13 @@ TLSConfiguration_addCRL(TLSConfiguration self, uint8_t* crl, int crlLen);
PAL_API bool PAL_API bool
TLSConfiguration_addCRLFromFile(TLSConfiguration self, const char* filename); TLSConfiguration_addCRLFromFile(TLSConfiguration self, const char* filename);
/**
* \brief Removes any CRL (certificate revocation list) currently in use
*
*/
PAL_API void
TLSConfiguration_resetCRL(TLSConfiguration self);
/** /**
* Release all resource allocated by the TLSConfiguration instance * Release all resource allocated by the TLSConfiguration instance
* *

@ -475,6 +475,14 @@ TLSConfiguration_addCRLFromFile(TLSConfiguration self, const char* filename)
return (ret == 0); return (ret == 0);
} }
void
TLSConfiguration_resetCRL(TLSConfiguration self)
{
mbedtls_x509_crl_free(&(self->crl));
mbedtls_x509_crl_init(&(self->crl));
self->crlUpdated = Hal_getTimeInMs();
}
void void
TLSConfiguration_setRenegotiationTime(TLSConfiguration self, int timeInMs) TLSConfiguration_setRenegotiationTime(TLSConfiguration self, int timeInMs)
{ {

Loading…
Cancel
Save