BLE 패스키 인증 전 NUS 명령 실행 방지 - 사이버 보안 대응(2차 NUS RX 차단, FW 핸들러 실행 방지)
- 패스키로 인증되지 않은 경우 명령 버퍼에 복사하지 않고 return - 파서, 측정 등 진행 X- 연결 끊김 이벤트 시 명령 버퍼 초기화- 개발 모드(BLE_DEV_MODE=1)인 경우 미적용
This commit is contained in:
@@ -616,9 +616,6 @@ static void nus_data_handler(ble_nus_evt_t * p_evt)
|
||||
{
|
||||
if (p_evt->type == BLE_NUS_EVT_RX_DATA)
|
||||
{
|
||||
cmd_type_t = CMD_BLE;
|
||||
ble_got_new_data = true;
|
||||
|
||||
/* Central may have increased connection interval; re-request fast interval (once per 30s) */
|
||||
{
|
||||
static uint32_t last_update_tick = 0;
|
||||
@@ -1070,6 +1067,7 @@ static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
|
||||
disc_reason, unintended_disc ? " [UNINTENDED]" : "");
|
||||
|
||||
ble_connection_st = 0;
|
||||
pending_cmd_len = 0; // Clear pending command buffer
|
||||
m_conn_handle = BLE_CONN_HANDLE_INVALID;
|
||||
m_tx_in_progress = false;
|
||||
|
||||
@@ -1101,8 +1099,9 @@ static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
|
||||
case BLE_GAP_EVT_CONNECTED:
|
||||
DBG_PRINTF("[BLE] Connected\r\n");
|
||||
|
||||
#if FEATURE_SECURE_CONNECTION
|
||||
ble_connection_st = 1;
|
||||
#if BLE_DEV_MODE
|
||||
/* Dev: no passkey/SEC — allow NUS TX/RX as soon as GAP is up (prod uses PM_EVT_CONN_SEC_SUCCEEDED). */
|
||||
ble_connection_st = BLE_CONNECTED_ST;
|
||||
battery_timer_start();
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user