Skip to content

Commit deb4c6e

Browse files
committed
Fix SelfProvisioning example build using SHA256 from ArduinoIoTCloud library
1 parent 27a3404 commit deb4c6e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

examples/utility/SelfProvisioning/ECCX08Cert.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
* INCLUDE
2020
******************************************************************************/
2121

22-
#include <ArduinoBearSSL.h>
23-
24-
#include "bearssl/bearssl_hash.h"
2522
#include <ArduinoECCX08.h>
26-
23+
#include "SHA256.h"
2724
#include "ECCX08Cert.h"
2825

2926
/******************************************************************************
@@ -190,13 +187,13 @@ String ECCX08CertClass::endCSR() {
190187
*out++ = 0xa0;
191188
*out++ = 0x00;
192189

193-
br_sha256_context sha256Context;
190+
SHA256 sha256;
194191
byte csrInfoSha256[64];
195192
byte signature[64];
196193

197-
br_sha256_init(&sha256Context);
198-
br_sha256_update(&sha256Context, csrInfo, csrInfoHeaderLen + csrInfoLen);
199-
br_sha256_out(&sha256Context, csrInfoSha256);
194+
sha256.begin();
195+
sha256.update(csrInfo, csrInfoHeaderLen + csrInfoLen);
196+
sha256.finalize(csrInfoSha256);
200197

201198
if (!ECCX08.ecSign(_keySlot, csrInfoSha256, signature)) {
202199
return "";

0 commit comments

Comments
 (0)