Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 97d7a22

Browse files
committedNov 18, 2024
Bpid add SHA256
1 parent b0e255d commit 97d7a22

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/bpid/bpid.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include "bpid.h"
12+
#include "../sha256/SHA256.h"
1213

1314
namespace arduino { namespace bpid {
1415

@@ -45,9 +46,11 @@ namespace arduino { namespace bpid {
4546
String get() {
4647
uint8_t data[BOARD_PROVISIONING_ID_SIZE];
4748
if (!get(data, sizeof(data))) {
48-
return String("");
49+
return String("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
4950
}
50-
return hexEncode(data, sizeof(data));
51+
uint8_t out[SHA256::HASH_SIZE];
52+
arduino::sha256::oneshot(data, sizeof(data), out, sizeof(data));
53+
return hexEncode(out, sizeof(out));
5154
}
5255

5356
}} // arduino::bpid

0 commit comments

Comments
 (0)
Please sign in to comment.