Skip to content

Add confirm step for locking ECCx08 and generating new private key + CSR #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion examples/utility/Provisioning/Provisioning.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ void setup() {
}

if (!ECCX08.locked()) {
Serial.println("ECCX08 is unlocked, locking ...");
String lockConfirm = promptAndReadLine("Your ECCX08 is unlocked, would you like to lock it (y/N): ");
lockConfirm.toLowerCase();

if (lockConfirm != "y") {
Serial.println("That's all folks");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

while (1);
}

if (!ECCX08.writeConfiguration(DEFAULT_ECCX08_TLS_CONFIG)) {
Serial.println("Writing ECCX08 configuration failed!");
Expand All @@ -36,6 +42,14 @@ void setup() {
Serial.println();
}

String csrConfirm = promptAndReadLine("Would you like to generate a new private key and CSR (y/N): ");
csrConfirm.toLowerCase();

if (csrConfirm != "y") {
Serial.println("That's all folks");
while (1);
}

if (!ECCX08Cert.beginCSR(keySlot, true)) {
Serial.println("Error starting CSR generation!");
while (1);
Expand Down