Skip to contentSkip to conversation

Add mbedtls support and sample applications

PATCH Superseded [email protected] 2 participants 7 messages May 26, 2021 – May 28, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add mbedtls support and sample applications

From: Amit Kucheria <[email protected]>

MBed TLS is a library that implements cryptographic primitives and SSL/TLS and DTLS protocols that are needed in secure network communications.

Add it to the kernel include files to build and link against applications that need mbedtls. Add a few sample applications that utilize mbedtls library too.

Amit Kucheria (5):
zephyr-kernel: Clone mbedtls
zephyr-echo-client: Add recipe for echo client
zephyr-http-client: Add recipe for http client
zephyr-websocket-client: Add recipe for websocket client
zephyr-mqtt-publisher: Add recipe for mqtt publisher

 recipes-kernel/zephyr-kernel/zephyr-echo-client.bb           | 5 +++++
 recipes-kernel/zephyr-kernel/zephyr-http-client.bb           | 5 +++++
 recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc        | 1 +
 recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.0-rc1.inc | 1 +
 recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc           | 1 +
 recipes-kernel/zephyr-kernel/zephyr-mqtt-publisher.bb        | 5 +++++
 recipes-kernel/zephyr-kernel/zephyr-websocket-client.bb      | 5 +++++
 7 files changed, 23 insertions(+)
 create mode 100644 recipes-kernel/zephyr-kernel/zephyr-echo-client.bb
 create mode 100644 recipes-kernel/zephyr-kernel/zephyr-http-client.bb
 create mode 100644 recipes-kernel/zephyr-kernel/zephyr-mqtt-publisher.bb
 create mode 100644 recipes-kernel/zephyr-kernel/zephyr-websocket-client.bb
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/5 zephyr-kernel: Clone mbedtls

From: Amit Kucheria <[email protected]>

MBed TLS is a library that implements cryptographic primitives and SSL/TLS and DTLS protocols that are needed in secure network communications.

Add it to the kernel include files to build and link against applications that need mbedtls.

---
 recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc        | 1 +
 recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.0-rc1.inc | 1 +
 recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc           | 1 +
 3 files changed, 3 insertions(+)
recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc +1 -0
index 330fe59aebe5..c9acbbbc3645 100644
@@ -28,6 +28,7 @@ ZEPHYR_MODULES = ""
 ZEPHYR_MODULES_append_arm = "\;${S}/modules/cmsis"
 ZEPHYR_MODULES_append_nordic = "\;${S}/modules/hal/nordic"
 ZEPHYR_MODULES_append_stm32 = "\;${S}/modules/hal/stm32"
+ZEPHYR_MODULES_append_mbedtls = "\;${S}/modules/lib/mbedtls"
 ZEPHYR_MODULES_append_openamp = "\;${S}/modules/lib/open-amp\;${S}/modules/hal/libmetal"
 
 EXTRA_OECMAKE_append = " -DZEPHYR_MODULES=${ZEPHYR_MODULES}"
recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.0-rc1.inc +1 -0
index 6ea15931607d..a0e358ecd4f4 100644
@@ -6,5 +6,6 @@ SRCREV_stm32 = "f8ff8d25aa0a9e65948040c7b47ec67f3fa300df"
 SRCREV_open-amp = "6010f0523cbc75f551d9256cf782f173177acdef"
 SRCREV_libmetal = "39d049d4ae68e6f6d595fce7de1dcfc1024fb4eb"
 SRCREV_tinycrypt = "3e9a49d2672ec01435ffbf0d788db6d95ef28de0"
+SRCREV_mbedtls = "5765cb7f75a9973ae9232d438e361a9d7bbc49e7"
 
 PV = "2.6.0-rc1+git${SRCPV}"
recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc +1 -0
index 9fc08baaf210..8dcfec6f1f88 100644
@@ -17,6 +17,7 @@ SRC_URI = "\
     git://github.com/zephyrproject-rtos/cmsis.git;protocol=https;destsuffix=git/modules/cmsis;name=cmsis \
     git://github.com/zephyrproject-rtos/hal_nordic.git;protocol=https;destsuffix=git/modules/hal/nordic;name=nordic \
     git://github.com/zephyrproject-rtos/hal_stm32.git;protocol=https;destsuffix=git/modules/hal/stm32;name=stm32 \
+    git://github.com/zephyrproject-rtos/mbedtls.git;protocol=https;destsuffix=git/modules/lib/mbedtls;name=mbedtls \
     git://github.com/zephyrproject-rtos/open-amp.git;protocol=https;destsuffix=git/modules/lib/open-amp;name=open-amp \
     git://github.com/zephyrproject-rtos/libmetal.git;protocol=https;destsuffix=git/modules/hal/libmetal;name=libmetal \
     git://github.com/zephyrproject-rtos/tinycrypt.git;protocol=https;destsuffix=git/modules/crypto/tinycrypt;name=tinycrypt \
Signature · 1 line
2.25.1
#2 lore raw

Re: [meta-zephyr][PATCH 1/5] zephyr-kernel: Clone mbedtls

V2.6.0-rc1 patch is not merged as it is pre-release. Lets wait for stable release. Could you please rebase these patches for v2.5.0 latest master ?

Regards,
Naveen

Quoted 79 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, May 26, 2021 11:36 PM
To: [email protected]; [email protected]; [email protected]; Saini, Naveen Kumar <[email protected]>; [email protected]
Cc: Amit Kucheria <[email protected]>
Subject: [meta-zephyr][PATCH 1/5] zephyr-kernel: Clone mbedtls

From: Amit Kucheria <[email protected]>

MBed TLS is a library that implements cryptographic primitives and SSL/TLS and DTLS protocols that are needed in secure network communications.

Add it to the kernel include files to build and link against applications that need mbedtls.

---
 recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc        | 1 +
 recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.0-rc1.inc | 1 +
 recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc           | 1 +
 3 files changed, 3 insertions(+)
recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc +1 -0
index 330fe59aebe5..c9acbbbc3645 100644
@@ -28,6 +28,7 @@ ZEPHYR_MODULES = ""
 ZEPHYR_MODULES_append_arm = "\;${S}/modules/cmsis"
 ZEPHYR_MODULES_append_nordic = "\;${S}/modules/hal/nordic"
 ZEPHYR_MODULES_append_stm32 = "\;${S}/modules/hal/stm32"
+ZEPHYR_MODULES_append_mbedtls = "\;${S}/modules/lib/mbedtls"
 ZEPHYR_MODULES_append_openamp = "\;${S}/modules/lib/open-

amp\;${S}/modules/hal/libmetal"

EXTRA_OECMAKE_append = " -DZEPHYR_MODULES=${ZEPHYR_MODULES}"

recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.0-rc1.inc +0 -0
index 6ea15931607d..a0e358ecd4f4 100644
@@ -6,5 +6,6 @@ SRCREV_stm32 =

"f8ff8d25aa0a9e65948040c7b47ec67f3fa300df"
SRCREV_open-amp = "6010f0523cbc75f551d9256cf782f173177acdef" SRCREV_libmetal = "39d049d4ae68e6f6d595fce7de1dcfc1024fb4eb" SRCREV_tinycrypt = "3e9a49d2672ec01435ffbf0d788db6d95ef28de0"

recipes-kernel/zephyr-kernel/zephyr-kernel-src-2.6.0-rc1.inc +1 -0
+SRCREV_mbedtls = "5765cb7f75a9973ae9232d438e361a9d7bbc49e7"
 
 PV = "2.6.0-rc1+git${SRCPV}"
recipes- renamed from recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc +0 -0

kernel/zephyr-kernel/zephyr-kernel-src.inc
index 9fc08baaf210..8dcfec6f1f88 100644

recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc +0 -0
@@ -17,6 +17,7 @@ SRC_URI = "\
     git://github.com/zephyrproject-
 rtos/cmsis.git;protocol=https;destsuffix=git/modules/cmsis;name=cmsis \
     git://github.com/zephyrproject-

rtos/hal_nordic.git;protocol=https;destsuffix=git/modules/hal/nordic;name= nordic \
git://github.com/zephyrproject-
rtos/hal_stm32.git;protocol=https;destsuffix=git/modules/hal/stm32;name= stm32 \
+
+ git://github.com/zephyrproject-rtos/mbedtls.git;protocol=https;destsuf
+ fix=git/modules/lib/mbedtls;name=mbedtls \
git://github.com/zephyrproject-rtos/open-
amp.git;protocol=https;destsuffix=git/modules/lib/open-amp;name=open- amp \
git://github.com/zephyrproject-
rtos/libmetal.git;protocol=https;destsuffix=git/modules/hal/libmetal;name=l ibmetal \
git://github.com/zephyrproject-
rtos/tinycrypt.git;protocol=https;destsuffix=git/modules/crypto/tinycrypt;na me=tinycrypt \
--
2.25.1

#3 lore raw

PATCH 2/5 zephyr-echo-client: Add recipe for echo client

In reply to [email protected]

From: Amit Kucheria <[email protected]>

This sample application provides an example of using the the MBEDTLS library.

---
 recipes-kernel/zephyr-kernel/zephyr-echo-client.bb | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 recipes-kernel/zephyr-kernel/zephyr-echo-client.bb
recipes-kernel/zephyr-kernel/zephyr-echo-client.bb new file +5 -0
new file mode 100644
index 000000000000..c17e1e78f6b5
@@ -0,0 +1,5 @@
+include zephyr-sample.inc
+
+ZEPHYR_SRC_DIR = "${S}/samples/net/sockets/echo_client"
+
+ZEPHYR_MODULES_append = "\;${S}/modules/lib/mbedtls"
Signature · 1 line
2.25.1
#4 lore raw

PATCH 3/5 zephyr-http-client: Add recipe for http client

In reply to [email protected]

From: Amit Kucheria <[email protected]>

This sample application provides an example of using the the MBEDTLS library.

---
 recipes-kernel/zephyr-kernel/zephyr-http-client.bb | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 recipes-kernel/zephyr-kernel/zephyr-http-client.bb
recipes-kernel/zephyr-kernel/zephyr-http-client.bb new file +5 -0
new file mode 100644
index 000000000000..cf3c322c20ce
@@ -0,0 +1,5 @@
+include zephyr-sample.inc
+
+ZEPHYR_SRC_DIR = "${S}/samples/net/sockets/http_client"
+
+ZEPHYR_MODULES_append = "\;${S}/modules/lib/mbedtls"
Signature · 1 line
2.25.1
#5 lore raw

PATCH 4/5 zephyr-websocket-client: Add recipe for websocket client

In reply to [email protected]

From: Amit Kucheria <[email protected]>

This sample application provides an example of using the the MBEDTLS library.

---
 recipes-kernel/zephyr-kernel/zephyr-websocket-client.bb | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 recipes-kernel/zephyr-kernel/zephyr-websocket-client.bb
recipes-kernel/zephyr-kernel/zephyr-websocket-client.bb new file +5 -0
new file mode 100644
index 000000000000..428f75e18adb
@@ -0,0 +1,5 @@
+include zephyr-sample.inc
+
+ZEPHYR_SRC_DIR = "${S}/samples/net/sockets/websocket_client"
+
+ZEPHYR_MODULES_append = "\;${S}/modules/lib/mbedtls"
Signature · 1 line
2.25.1
#6 lore raw

PATCH 5/5 zephyr-mqtt-publisher: Add recipe for mqtt publisher

In reply to [email protected]

From: Amit Kucheria <[email protected]>

This sample application provides an example of using the the MBEDTLS library.

---
 recipes-kernel/zephyr-kernel/zephyr-mqtt-publisher.bb | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 recipes-kernel/zephyr-kernel/zephyr-mqtt-publisher.bb
recipes-kernel/zephyr-kernel/zephyr-mqtt-publisher.bb new file +5 -0
new file mode 100644
index 000000000000..b4e306742e44
@@ -0,0 +1,5 @@
+include zephyr-sample.inc
+
+ZEPHYR_SRC_DIR = "${S}/samples/net/mqtt_publisher"
+
+ZEPHYR_MODULES_append = "\;${S}/modules/lib/mbedtls"
Signature · 1 line
2.25.1