Skip to content

Commit 6123cb7

Browse files
committed
Add confirm step for locking ECCx08 and generating new private key + CSR
1 parent a8e9943 commit 6123cb7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

examples/utility/Provisioning/Provisioning.ino

+15-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ void setup() {
2020
}
2121

2222
if (!ECCX08.locked()) {
23-
Serial.println("ECCX08 is unlocked, locking ...");
23+
String lockConfirm = promptAndReadLine("Your ECCX08 is unlocked, would you like to lock it (y/N): ");
24+
lockConfirm.toLowerCase();
25+
26+
if (lockConfirm != "y") {
27+
Serial.println("That's all folks");
28+
while (1);
29+
}
2430

2531
if (!ECCX08.writeConfiguration(DEFAULT_ECCX08_TLS_CONFIG)) {
2632
Serial.println("Writing ECCX08 configuration failed!");
@@ -36,6 +42,14 @@ void setup() {
3642
Serial.println();
3743
}
3844

45+
String csrConfirm = promptAndReadLine("Would you like to generate a new private key and CSR (y/N): ");
46+
csrConfirm.toLowerCase();
47+
48+
if (csrConfirm != "y") {
49+
Serial.println("That's all folks");
50+
while (1);
51+
}
52+
3953
if (!ECCX08Cert.beginCSR(keySlot, true)) {
4054
Serial.println("Error starting CSR generation!");
4155
while (1);

0 commit comments

Comments
 (0)