mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-13 05:47:11 +00:00
Added support for security1 in local control
1. Added config options to chose from protocom security. It can be chosen 0/1 or custom. Possible to set POP as well 2. Added support in `esp_local_ctrl.py` test script for sec_ver selection Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <protocomm.h>
|
||||
#include <protocomm_security0.h>
|
||||
#include <protocomm_security1.h>
|
||||
|
||||
#include <esp_local_ctrl.h>
|
||||
#include "esp_local_ctrl_priv.h"
|
||||
@@ -149,8 +150,21 @@ esp_err_t esp_local_ctrl_start(const esp_local_ctrl_config_t *config)
|
||||
return ret;
|
||||
}
|
||||
|
||||
protocomm_security_t *proto_sec_handle;
|
||||
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:
|
||||
proto_sec_handle = (protocomm_security_t *) &protocomm_security1;
|
||||
break;
|
||||
case PROTOCOM_SEC0:
|
||||
default:
|
||||
proto_sec_handle = (protocomm_security_t *) &protocomm_security0;
|
||||
break;
|
||||
}
|
||||
ret = protocomm_set_security(local_ctrl_inst_ctx->pc, "esp_local_ctrl/session",
|
||||
&protocomm_security0, NULL);
|
||||
proto_sec_handle, local_ctrl_inst_ctx->config.proto_sec.pop);
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Failed to set session endpoint");
|
||||
esp_local_ctrl_stop();
|
||||
|
Reference in New Issue
Block a user