Skip to contentSkip to conversation

mesh: Convert all crypto to ELL

PATCH In review Brian Gix 2 participants 5 messages May 29, 2019 – May 31, 2019

Subsystems (2)
lore
Share & tools
lore

Brian Gix

author
#0 lore raw

cover mesh: Convert all crypto to ELL

I am copying a larger than normal list of "interested parties" of this patch to (finally) convert the Bluetooth Mesh daemon to using the ELL cipher and checksum APIs.

This will have one major side effect in that it will no longer support kernels older than v4.9 (I am personally using v5.0.17). I am told that (some?) Freescale platforms also will have problems regardless of kernel version.

This does not change any functionality in the mesh daemon otherwise.

Brian Gix (1):
mesh: Convert crypto to use ELL wrappers

 Makefile.am   |   4 +
 mesh/crypto.c | 518 ++++++----------------------------------------------------
 2 files changed, 58 insertions(+), 464 deletions(-)
Signature · 1 line
2.14.5
author
#1 lore raw

PATCH 1/1 mesh: Convert crypto to use ELL wrappers

Use ELL implementations of aead-ccm(aes), ecb(aes) and cmac(aes). These standard encryption and hashing routines are provided by ELL.

---
 Makefile.am   |   4 +
 mesh/crypto.c | 518 ++++++----------------------------------------------------
 2 files changed, 58 insertions(+), 464 deletions(-)
Makefile.am +4 -0
index f84a1faba..2583fbdd9 100644
@@ -116,6 +116,8 @@ ell_headers = ell/util.h \
 			ell/random.h \
 			ell/signal.h \
 			ell/timeout.h \
+			ell/cipher.h \
+			ell/checksum.h \
 			ell/io.h \
 			ell/idle.h \
 			ell/main.h \
@@ -138,6 +140,8 @@ ell_sources = ell/private.h ell/missing.h \
 			ell/main.c \
 			ell/strv.c \
 			ell/string.c \
+			ell/cipher.c \
+			ell/checksum.c \
 			ell/dbus-private.h \
 			ell/dbus.c \
 			ell/dbus-message.c \
mesh/crypto.c +54 -464

606 lines not on this page · raw message

Signature · 1 line
2.14.5
#2 lore raw
In reply to Brian Gix

Hi,

Quoted 4 lines · Brian Gix

This will have one major side effect in that it will no longer support kernels older than v4.9 (I am personally using v5.0.17). I am told that (some?) Freescale platforms also will have problems regardless of kernel version.

Alright, so I agree that it would be up to the vendor (i.e. me ;) to provide a patch for older kernels.

I think the most sensible option would be to patch ELL to use userspace fallback, instead of patching bluez. So if you could just make sure that an appropriate unit test exists within ELL, I have no objections.

Signature · 3 lines
Michał Lowas-Rzechonek <[email protected]>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND
author
#3 lore raw

Hi Michał,

Quoted 9 lines

Hi,

Quoted 4 lines · Brian Gix

This will have one major side effect in that it will no longer support kernels older than v4.9 (I am personally using v5.0.17). I am told that (some?) Freescale platforms also will have problems regardless of kernel version.

Quoted 6 lines

Alright, so I agree that it would be up to the vendor (i.e. me ;) to provide a patch for older kernels.

I think the most sensible option would be to patch ELL to use userspace fallback, instead of patching bluez. So if you could just make sure that an appropriate unit test exists within ELL, I have no objections.

The unit test for AEAD in .../ell/unit/test-cipher.c already makes this report on encryption failures:

if (!success) {
printf("* Some kernel versions before v4.9 have a known AEAD\n"
"* bug. If the system running this test is using a\n" "* v4.8 or earlier kernel, a failure here is likely\n" "* due to that kernel bug.\n");
}

So I will likely be applying the patch as written by this weekend to convert all of mesh crypto to ELL.

Any patching (to ELL or BlueZ) will again become the responsibility of the vendor offering support to these older platforms. To emphasize this, I will probably also add a note to .../bluez/mesh/README to emphasize both the problem with these older platforms, usage of the ELL unit test to identify, and the required work-around.

Best Regards,
Brian

author
#4 lore raw
In reply to Brian Gix

Patch Applied

Quoted 19 lines · Brian Gix

I am copying a larger than normal list of "interested parties" of this patch to (finally) convert the Bluetooth Mesh daemon to using the ELL cipher and checksum APIs.

This will have one major side effect in that it will no longer support kernels older than v4.9 (I am personally using v5.0.17). I am told that (some?) Freescale platforms also will have problems regardless of kernel version.

This does not change any functionality in the mesh daemon otherwise.

Brian Gix (1):
mesh: Convert crypto to use ELL wrappers

 Makefile.am   |   4 +
 mesh/crypto.c | 518 ++++++----------------------------------------
------------
 2 files changed, 58 insertions(+), 464 deletions(-)