Skip to content

Commit 0140455

Browse files
committed
feat(tls_cxx): Publish mbedtls component
Adds examples and tests. Also supports DTLS now.
1 parent c4d9cc6 commit 0140455

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1181
-23
lines changed

.github/workflows/publish-docs-component.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,6 @@ jobs:
9999
components/console_cmd_ifconfig;
100100
components/console_cmd_wifi;
101101
components/esp_wifi_remote;
102+
components/mbedtls_cxx;
102103
namespace: "espressif"
103104
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}

.github/workflows/tls_cxx__build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "mbedtls-cxx: build-tests"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened, labeled]
9+
10+
jobs:
11+
build_tls_cxx:
12+
if: contains(github.event.pull_request.labels.*.name, 'tls_cxx') || github.event_name == 'push'
13+
name: Build
14+
strategy:
15+
matrix:
16+
idf_ver: ["latest", "release-v5.2", "release-v5.1"]
17+
test: [ { app: client, path: "examples/tls_client" }, { app: udp, path: "examples/udp_mutual_auth" }, { app: test, path: "tests/uart_mutual_auth" } ]
18+
runs-on: ubuntu-20.04
19+
container: espressif/idf:${{ matrix.idf_ver }}
20+
steps:
21+
- name: Checkout esp-protocols
22+
uses: actions/checkout@v3
23+
with:
24+
submodules: recursive
25+
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
26+
shell: bash
27+
run: |
28+
${IDF_PATH}/install.sh --enable-pytest
29+
. ${IDF_PATH}/export.sh
30+
python ./ci/build_apps.py ./components/mbedtls_cxx/${{ matrix.test.path }} -vv --preserve-all

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ repos:
6161
- repo: local
6262
hooks:
6363
- id: commit message scopes
64-
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common, eppp, wifi_remote"
65-
entry: '\A(?!(feat|fix|ci|bump|test|docs)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|wifi_remote)\)\:)'
64+
name: "commit message must be scoped with: mdns, modem, websocket, asio, mqtt_cxx, console, common, eppp, wifi_remote, tls_cxx"
65+
entry: '\A(?!(feat|fix|ci|bump|test|docs)\((mdns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|wifi_remote|tls_cxx)\)\:)'
6666
language: pygrep
6767
args: [--multiline]
6868
stages: [commit-msg]

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ Please refer to instructions in [ESP-IDF](https://github.com/espressif/esp-idf)
5757
### esp_wifi_remote
5858

5959
* Brief introduction [README](components/esp_wifi_remote/README.md)
60+
61+
### mbedtls_cxx
62+
63+
* Brief introduction [README](components/mbedtls_cxx/README.md)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
idf_component_register(SRCS mbedtls_wrap.cpp
2-
tls_transport.cpp
1+
idf_component_register(SRCS tls_transport.cpp
32
INCLUDE_DIRS include
4-
REQUIRES tcp_transport)
3+
REQUIRES tcp_transport
4+
PRIV_REQUIRES mbedtls_cxx)

components/esp_modem/examples/modem_tcp_client/components/extra_tcp_transports/tls_transport.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
static const char *TAG = "tls_transport";
1313

14+
using namespace idf::mbedtls_cxx;
15+
1416
class TlsTransport: public Tls {
1517
public:
1618
explicit TlsTransport(esp_transport_handle_t parent) : Tls(), transport_(parent) {}

components/esp_modem/examples/modem_tcp_client/main/idf_component.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ dependencies:
22
espressif/esp_modem:
33
version: "^1.0.1"
44
override_path: "../../../"
5+
espressif/mbedtls_cxx:
6+
version: "*"
7+
override_path: "../../../../mbedtls_cxx"

components/esp_modem/test/target_ota/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# in this exact order for cmake to work correctly
33
cmake_minimum_required(VERSION 3.8)
44

5-
set(EXTRA_COMPONENT_DIRS "../.." "../../examples/modem_tcp_client/components")
5+
set(EXTRA_COMPONENT_DIRS "../.." "../../../mbedtls_cxx")
66

77
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
88
project(ota_test)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
idf_component_register(SRCS manual_ota.cpp transport_batch_tls.cpp
22
INCLUDE_DIRS "."
3-
PRIV_REQUIRES extra_tcp_transports esp_http_client app_update)
3+
PRIV_REQUIRES mbedtls_cxx esp_http_client app_update)

components/esp_modem/test/target_ota/components/manual_ota/transport_batch_tls.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#define TAG "batch-tls"
1212

13+
using namespace idf::mbedtls_cxx;
14+
1315
class TlsTransport: public Tls {
1416
public:
1517
explicit TlsTransport(esp_transport_handle_t parent):

0 commit comments

Comments
 (0)