Skip to content

Commit c0eec89

Browse files
authored
bumps arduinojson, libssh and esp-df (#52)
1 parent a90444e commit c0eec89

File tree

10 files changed

+83
-46
lines changed

10 files changed

+83
-46
lines changed

.github/workflows/esp_idf.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
uses: actions/checkout@v2
1313
with:
1414
submodules: 'recursive'
15-
- name: ESP-IDF v5.1.2 build esp32s3
15+
- name: ESP-IDF v5.4 build esp32s3
1616
uses: espressif/esp-idf-ci-action@v1
1717
with:
18-
esp_idf_version: v5.1.2
18+
esp_idf_version: v5.4
1919
target: esp32s3
2020
command: 'idf.py set-target esp32s3 build'

components/LibSSH-ESP32

Submodule LibSSH-ESP32 updated 94 files

components/ssh/src/server.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,22 @@ ListenError Server::Listen(const HandlerCallback& handler)
160160

161161
ESP_LOGI(TAG, "[%s] new connection from: %s", sessInfo.Id.c_str(), sessInfo.ClientIP.c_str());
162162

163-
ESP_LOGD(TAG, "[%s] starts key exchange...", sessInfo.Id.c_str());
163+
ESP_LOGI(TAG, "[%s] starts key exchange...", sessInfo.Id.c_str());
164164
rc = ssh_handle_key_exchange(sshSession);
165165
if (rc != SSH_OK) {
166166
ESP_LOGW(TAG, "[%s] key exchange failed: %s", sessInfo.Id.c_str(), ssh_get_error(sshSession));
167167
return ListenError::Accept;
168168
}
169169

170-
ESP_LOGD(TAG, "[%s] auth client...", sessInfo.Id.c_str());
170+
ESP_LOGI(TAG, "[%s] auth client...", sessInfo.Id.c_str());
171171
auto userInfo = authenticate(sshSession, sessInfo);
172172
if (!userInfo) {
173173
ESP_LOGW(TAG, "[%s] auth failed, abort", sessInfo.Id.c_str());
174174
return ListenError::Auth;
175175
}
176176
sessInfo.User = std::move(userInfo.value());
177177

178-
ESP_LOGD(TAG, "[%s] wait for a channel session...", sessInfo.Id.c_str());
178+
ESP_LOGI(TAG, "[%s] wait for a channel session...", sessInfo.Id.c_str());
179179
ssh_message message = nullptr;
180180
ssh_channel chan = nullptr;
181181
do {
@@ -227,6 +227,10 @@ ListenError Server::Listen(const HandlerCallback& handler)
227227
}
228228

229229
if (ssh_message_subtype(message) != SSH_CHANNEL_REQUEST_EXEC) {
230+
if (ssh_message_subtype(message) != SSH_CHANNEL_REQUEST_ENV) {
231+
ESP_LOGW(TAG, "[%s] requested invalid channel %d:%d", sessInfo.Id.c_str(), ssh_message_type(message), ssh_message_subtype(message));
232+
};
233+
230234
ssh_message_reply_default(message);
231235
ssh_message_free(message);
232236
continue;

components/ui/src/button.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <sdkconfig.h>
22
#include "ui/button.h"
3-
#include "config.h"
43

54

65
using namespace UI;

dependencies.lock

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,91 @@
11
dependencies:
22
bblanchon/arduinojson:
3-
component_hash: 463812931f99cb7a554d64311288f537b43daaca3eed2427557b907af393447c
3+
component_hash: 21b41e6cce335cefc142c457ceb50eb45621ff9ea6fd0a0ee349a642e48a47a3
4+
dependencies: []
45
source:
5-
service_url: https://api.components.espressif.com/
6+
registry_url: https://components.espressif.com/
67
type: service
7-
version: 6.21.5
8+
version: 7.3.0
89
espressif/esp_lcd_touch:
9-
component_hash: d4d8f2dc33205797169a97a02e0d89a8982f59fe0509129b54422052b8522f59
10+
component_hash: 779b4ba2464a3ae85681e4b860caa5fdc35801458c23f3039ee761bae7f442a4
11+
dependencies:
12+
- name: idf
13+
require: private
14+
version: '>=4.4.2'
1015
source:
11-
service_url: https://api.components.espressif.com/
16+
registry_url: https://components.espressif.com
1217
type: service
13-
version: 1.1.1
18+
version: 1.1.2
1419
espressif/esp_lcd_touch_cst816s:
1520
component_hash: 270bd7df3a2a5cffa3a626c4709fc03237d83fd9daa6fb70c833a2f1875f0f68
21+
dependencies:
22+
- name: idf
23+
require: private
24+
version: '>=4.4.2'
25+
- name: espressif/esp_lcd_touch
26+
registry_url: https://components.espressif.com
27+
require: public
28+
version: ^1.0.4
1629
source:
17-
service_url: https://api.components.espressif.com/
30+
registry_url: https://components.espressif.com/
1831
type: service
1932
version: 1.0.3
2033
espressif/esp_tinyusb:
21-
component_hash: 43d73c626724054db083ad2a537e8af223e3bca7a915fc38a9d9c6c7f2920a69
34+
component_hash: fe1135e7a419b0c6034117aea46d4ad8048618de50f3ae774b1526ae571f1ec6
35+
dependencies:
36+
- name: idf
37+
require: private
38+
version: '>=5.0'
39+
- name: espressif/tinyusb
40+
registry_url: https://components.espressif.com
41+
require: public
42+
version: '>=0.14.2'
2243
source:
23-
service_url: https://api.components.espressif.com/
44+
registry_url: https://components.espressif.com/
2445
type: service
25-
version: 1.4.3
46+
version: 1.7.1
2647
espressif/libsodium:
27-
component_hash: f6e982479a2389cb6868e8fb761cf23aba6c355a8090b3e906299807775f58a3
48+
component_hash: 25b968723c584a2742ca36cebe5a7ef049c6767e059f7b1e1eec69946019025d
49+
dependencies:
50+
- name: idf
51+
require: private
52+
version: '>=4.2'
2853
source:
29-
service_url: https://api.components.espressif.com/
54+
registry_url: https://components.espressif.com/
3055
type: service
31-
version: 1.0.20~1
56+
version: 1.0.20~2
3257
espressif/tinyusb:
33-
component_hash: a11195d4c7c385aa2b1430009486dd4007920307d13b7db474a62ff040907d8f
58+
component_hash: 0f96faa5e29d5a04553ba7050b9051c1f6b549b9340681eb7afdda419a8dff2e
59+
dependencies:
60+
- name: idf
61+
require: private
62+
version: '>=5.0'
3463
source:
35-
service_url: https://api.components.espressif.com/
64+
registry_url: https://components.espressif.com
3665
type: service
37-
version: 0.15.0~4
66+
targets:
67+
- esp32s2
68+
- esp32s3
69+
- esp32p4
70+
version: 0.18.0~1
3871
idf:
39-
component_hash: null
4072
source:
4173
type: idf
42-
version: 5.1.2
74+
version: 5.4.0
4375
lvgl/lvgl:
44-
component_hash: 948bff879a345149b83065535bbc4a026ce9f47498a22881e432a264b9098015
76+
component_hash: d7c1ac037ae6e85d94897f807d6e7ba0946a83e720074fc95a4f6241da9f9f53
77+
dependencies: []
4578
source:
46-
service_url: https://api.components.espressif.com/
79+
registry_url: https://components.espressif.com/
4780
type: service
48-
version: 8.3.11
49-
manifest_hash: 274d2cea5a7bbaa200ff3e38c33582d8878030d2b62013f54b7efa6c84f1440c
81+
version: 8.4.0
82+
direct_dependencies:
83+
- bblanchon/arduinojson
84+
- espressif/esp_lcd_touch_cst816s
85+
- espressif/esp_tinyusb
86+
- espressif/libsodium
87+
- idf
88+
- lvgl/lvgl
89+
manifest_hash: 86a1bbad848f6e431c9b1d1fc6f00c1fa63de16ee067779dc86b801507d06fab
5090
target: esp32s3
51-
version: 1.0.0
91+
version: 2.0.0

main/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ menu "BoundBox Runtime"
3333
int "SSHD task stack size"
3434
default 32768
3535

36-
config COMMAND_BUFFER_SIZE
37-
int "Command buffer size"
38-
default 16384
39-
4036
config SHUTDOWN_ON_ASSERT
4137
bool "Use shutdown instead of assert (board will be available after manual rst)"
4238
default false

main/commands.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ namespace
108108
bool HandleSecretsStore(Secrets* secrets, const SSH::SessionInfo& sessInfo, const JsonObjectConst& req, JsonObject& rsp)
109109
{
110110
JsonObjectConst secretsJson = req["secrets"].as<JsonObjectConst>();
111-
if (!secretsJson.containsKey("host_key")) {
111+
if (!secretsJson["host_key"].is<std::string>()) {
112112
rsp["error_code"] = CMD_ERR_CODE_SECRETS_STORE_INVALID_HOST_KEY;
113-
rsp["error_msg"] = "empty host key";
113+
rsp["error_msg"] = "invalid or empty host key";
114114
return false;
115115
}
116116

117-
if (!secretsJson.containsKey("secret_key")) {
117+
if (!secretsJson["secret_key"].is<std::string>()) {
118118
rsp["error_code"] = CMD_ERR_CODE_SECRETS_STORE_INVALID_SECRET_KEY;
119119
rsp["error_msg"] = "empty host key";
120120
return false;
@@ -172,14 +172,14 @@ Error Commands::Initialize(Authenticator* auth, Secrets* secrets)
172172
Error Commands::Dispatch(const SSH::SessionInfo& sessInfo, std::string_view cmdName, SSH::Stream& stream)
173173
{
174174
ESP_LOGI(TAG, "[%s] called command: %s", sessInfo.Id.c_str(), cmdName.cbegin());
175-
DynamicJsonDocument req(CONFIG_COMMAND_BUFFER_SIZE);
175+
JsonDocument req;
176176
DeserializationError jsonErr = deserializeJson(req, stream);
177177
if (jsonErr && jsonErr != DeserializationError::Code::EmptyInput) {
178178
ESP_LOGE(TAG, "[%s] unable to read request: %s", sessInfo.Id.c_str(), jsonErr.c_str());
179179
return Error::CommandFailed;
180180
}
181181

182-
DynamicJsonDocument rspDoc(CONFIG_COMMAND_BUFFER_SIZE);
182+
JsonDocument rspDoc;
183183
JsonObject rsp = rspDoc.to<JsonObject>();
184184

185185
bool ok = Handle(sessInfo, cmdName, req.as<JsonObjectConst>(), rsp);
@@ -247,13 +247,13 @@ bool Commands::Handle(const SSH::SessionInfo& sessInfo, std::string_view cmdName
247247
};
248248

249249
if (cmdName == "/help") {
250-
JsonArray jsonCommands = rsp.createNestedArray("commands");
250+
JsonArray jsonCommands = rsp["commands"].to<JsonArray>();
251251
for (const auto& cmd : commands) {
252252
if (!cmd.UsedAllowed && sessInfo.User.Role != SSH::UserRole::SysOp) {
253253
continue;
254254
}
255255

256-
JsonObject jsonCmd = jsonCommands.createNestedObject();
256+
JsonObject jsonCmd = jsonCommands.add<JsonObject>();
257257
jsonCmd["command"] = cmd.Name;
258258
jsonCmd["description"] = cmd.Help;
259259
}

main/idf_component.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dependencies:
2-
idf: "^5.1.0"
2+
idf: "^5.4.0"
33
lvgl/lvgl: "^8.3.11"
4-
bblanchon/arduinojson: "^6.21.4"
4+
bblanchon/arduinojson: "^7.3.0"

main/secrets.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Error Secrets::Erase()
131131

132132
Error Secrets::FromJson(const JsonObjectConst& obj) noexcept
133133
{
134-
if (!obj.containsKey("host_key") || !obj.containsKey("secret_key")) {
134+
if (!obj["host_key"].is<std::string>() || !obj["secret_key"].is<std::string>()) {
135135
return Error::ShitHappens;
136136
}
137137

sdkconfig.defaults

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
2-
CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y
32
CONFIG_ESPTOOLPY_FLASHFREQ="80m"
43
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
54
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
@@ -34,7 +33,6 @@ CONFIG_TINYUSB_DESC_SERIAL_STRING="31337"
3433

3534
CONFIG_LWIP_LOCAL_HOSTNAME="BoundBox"
3635
CONFIG_ETH_SPI_ETHERNET_W5500=y
37-
CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=n
3836

3937
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
4038

0 commit comments

Comments
 (0)