From ccf21b4eabd7518e970da874843cbce4296910cc Mon Sep 17 00:00:00 2001 From: Hajo Noerenberg Date: Thu, 17 Aug 2023 15:20:02 +0200 Subject: [PATCH] [realtek-ambz] Enable Mbed-TLS for MD5 hashing, remove Polar SSL (#156) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Enable Mbed-TLS, remove Polar SSL * Reformat lt_defs.h --------- Co-authored-by: Kuba Szczodrzyński --- .../common/arduino/libraries/common/MD5/MD5.h | 3 --- .../libraries/common/MD5/MD5PolarSSLImpl.cpp | 24 ------------------- cores/realtek-ambz/arduino/src/lt_defs.h | 4 ++-- docs/dev/config.md | 1 - 4 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 cores/common/arduino/libraries/common/MD5/MD5PolarSSLImpl.cpp diff --git a/cores/common/arduino/libraries/common/MD5/MD5.h b/cores/common/arduino/libraries/common/MD5/MD5.h index 2971867a2..75805d693 100644 --- a/cores/common/arduino/libraries/common/MD5/MD5.h +++ b/cores/common/arduino/libraries/common/MD5/MD5.h @@ -5,9 +5,6 @@ #include // available built-in implementations -#if LT_ARD_MD5_POLARSSL -#include "MD5PolarSSLImpl.h" -#endif #if LT_ARD_MD5_MBEDTLS #include "MD5MbedTLSImpl.h" #endif diff --git a/cores/common/arduino/libraries/common/MD5/MD5PolarSSLImpl.cpp b/cores/common/arduino/libraries/common/MD5/MD5PolarSSLImpl.cpp deleted file mode 100644 index 18f9d2c2b..000000000 --- a/cores/common/arduino/libraries/common/MD5/MD5PolarSSLImpl.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (c) Kuba Szczodrzyński 2022-06-03. */ - -#if LT_ARD_MD5_POLARSSL - -extern "C" { - -#include - -void MD5Init(md5_context *context) { - md5_init(context); - md5_starts(context); -} - -void MD5Update(md5_context *context, const unsigned char *buf, unsigned len) { - md5_update(context, buf, len); -} - -void MD5Final(unsigned char digest[16], md5_context *context) { - md5_finish(context, digest); -} - -} // extern "C" - -#endif // LT_ARD_MD5_POLARSSL diff --git a/cores/realtek-ambz/arduino/src/lt_defs.h b/cores/realtek-ambz/arduino/src/lt_defs.h index 39692e027..a3ea2d6ff 100644 --- a/cores/realtek-ambz/arduino/src/lt_defs.h +++ b/cores/realtek-ambz/arduino/src/lt_defs.h @@ -2,5 +2,5 @@ #error "Don't include this file directly" -#define LT_ARD_HAS_SERIAL 1 -#define LT_ARD_MD5_POLARSSL 1 +#define LT_ARD_HAS_SERIAL 1 +#define LT_ARD_MD5_MBEDTLS 1 diff --git a/docs/dev/config.md b/docs/dev/config.md index 1a976f3dc..bc668db2b 100644 --- a/docs/dev/config.md +++ b/docs/dev/config.md @@ -152,7 +152,6 @@ Checking for option value should be done with `#if` (not with `#ifdef`!) - if it - `LT_ARD_HAS_WIFI` - WiFi library implemented - `LT_ARD_HAS_WIRE` - Wire (I²C) library implemented - `LT_ARD_HAS_SPI` - SPI library implemented - - `LT_ARD_MD5_POLARSSL` - use PolarSSL for MD5 library - `LT_ARD_MD5_MBEDTLS` - use mbedTLS for MD5 library - `LT_ARD_MD5_HOSTAPD` - use hostapd for MD5 library - misc options