Skip to content

Commit ba27281

Browse files
committed
change(esp-tls): add option to enable/disable the full set of OCSP checks for wolfSSL
1 parent 6673376 commit ba27281

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

components/esp-tls/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,12 @@ menu "ESP-TLS"
115115
help
116116
Enable detailed debug prints for wolfSSL SSL library.
117117

118+
config ESP_TLS_OCSP_CHECKALL
119+
bool "Enabled full OCSP checks for ESP-TLS"
120+
depends on ESP_TLS_USING_WOLFSSL
121+
default y
122+
help
123+
Enable a fuller set of OCSP checks: checking revocation status of intermediate certificates,
124+
optional fallbacks to CRLs, etc.
125+
118126
endmenu

components/esp-tls/esp_tls_wolfssl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,12 @@ static esp_err_t set_client_config(const char *hostname, size_t hostlen, esp_tls
316316
}
317317

318318
#ifdef CONFIG_WOLFSSL_HAVE_OCSP
319+
int ocsp_options = 0;
320+
#ifdef ESP_TLS_OCSP_CHECKALL
321+
ocsp_options |= WOLFSSL_OCSP_CHECKALL;
322+
#endif
319323
/* enable OCSP certificate status check for this TLS context */
320-
if ((ret = wolfSSL_CTX_EnableOCSP((WOLFSSL_CTX *)tls->priv_ctx, WOLFSSL_OCSP_CHECKALL)) != WOLFSSL_SUCCESS) {
324+
if ((ret = wolfSSL_CTX_EnableOCSP((WOLFSSL_CTX *)tls->priv_ctx, ocsp_options)) != WOLFSSL_SUCCESS) {
321325
ESP_LOGE(TAG, "wolfSSL_CTX_EnableOCSP failed, returned %d", ret);
322326
return ESP_ERR_WOLFSSL_CTX_SETUP_FAILED;
323327
}

0 commit comments

Comments
 (0)