From 27a340450a191ed4495a9b634884184ad140c3b9 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 4 May 2022 08:48:15 +0200 Subject: [PATCH 1/2] Remove ArduinoBearSSL as a CI build dependency. The code formerly integrated in ArduinoBearSSL has long since been integrated with ArduinoIoTCloud library. --- .github/workflows/compile-examples.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 25e4c90d7..dc33f1379 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -88,7 +88,6 @@ jobs: - name: RTCZero - name: WiFiNINA - name: Arduino_JSON - - name: ArduinoBearSSL - source-url: https://github.com/adafruit/Adafruit_SleepyDog.git sketch-paths: | - examples/utility/Provisioning From 0b7789489983a105c0de4a59b85d0750423677e4 Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 20 Jul 2022 10:41:45 +0200 Subject: [PATCH 2/2] Fix SelfProvisioning example build using SHA256 from ArduinoIoTCloud library --- examples/utility/SelfProvisioning/ECCX08Cert.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/utility/SelfProvisioning/ECCX08Cert.cpp b/examples/utility/SelfProvisioning/ECCX08Cert.cpp index a2e199e62..db037d4e0 100644 --- a/examples/utility/SelfProvisioning/ECCX08Cert.cpp +++ b/examples/utility/SelfProvisioning/ECCX08Cert.cpp @@ -19,12 +19,10 @@ * INCLUDE ******************************************************************************/ -#include - -#include "bearssl/bearssl_hash.h" +#include #include - #include "ECCX08Cert.h" +#include "tls/utility/SHA256.h" /****************************************************************************** * DEFINE @@ -190,13 +188,13 @@ String ECCX08CertClass::endCSR() { *out++ = 0xa0; *out++ = 0x00; - br_sha256_context sha256Context; + SHA256 sha256; byte csrInfoSha256[64]; byte signature[64]; - br_sha256_init(&sha256Context); - br_sha256_update(&sha256Context, csrInfo, csrInfoHeaderLen + csrInfoLen); - br_sha256_out(&sha256Context, csrInfoSha256); + sha256.begin(); + sha256.update(csrInfo, csrInfoHeaderLen + csrInfoLen); + sha256.finalize(csrInfoSha256); if (!ECCX08.ecSign(_keySlot, csrInfoSha256, signature)) { return "";