mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-13 13:50:21 +00:00
protocomm: Added option to enable/disable supported security versions.
This commit is contained in:
@@ -143,20 +143,35 @@ esp_err_t esp_local_ctrl_start(const esp_local_ctrl_config_t *config)
|
||||
return ret;
|
||||
}
|
||||
|
||||
protocomm_security_t *proto_sec_handle;
|
||||
protocomm_security_t *proto_sec_handle = NULL;
|
||||
switch (local_ctrl_inst_ctx->config.proto_sec.version) {
|
||||
case PROTOCOM_SEC_CUSTOM:
|
||||
proto_sec_handle = local_ctrl_inst_ctx->config.proto_sec.custom_handle;
|
||||
break;
|
||||
case PROTOCOM_SEC1:
|
||||
#ifdef CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1
|
||||
proto_sec_handle = (protocomm_security_t *) &protocomm_security1;
|
||||
#else
|
||||
// Enable SECURITY_VERSION_1 in Protocomm configuration menu
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
#endif
|
||||
break;
|
||||
case PROTOCOM_SEC2:
|
||||
#ifdef CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2
|
||||
proto_sec_handle = (protocomm_security_t *) &protocomm_security2;
|
||||
break;
|
||||
#else
|
||||
// Enable SECURITY_VERSION_2 in Protocomm configuration menu
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
#endif
|
||||
case PROTOCOM_SEC0:
|
||||
default:
|
||||
#ifdef CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0
|
||||
proto_sec_handle = (protocomm_security_t *) &protocomm_security0;
|
||||
#else
|
||||
// Enable SECURITY_VERSION_0 in Protocomm configuration menu
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
ret = protocomm_set_security(local_ctrl_inst_ctx->pc, "esp_local_ctrl/session",
|
||||
|
Reference in New Issue
Block a user