diff --git a/src/fs/otp.c b/src/fs/otp.c index 388b52f..6e28e9b 100644 --- a/src/fs/otp.c +++ b/src/fs/otp.c @@ -168,8 +168,10 @@ int otp_enable_secure_boot(uint8_t bootkey, bool secure_lock) { uint8_t flagsp2[] = { page2v, page2v, page2v, 0x00 }; PICOKEY_CHECK(otp_write_data_raw(OTP_DATA_PAGE2_LOCK1_ROW, flagsp2, sizeof(flagsp2))); } - +#elif defined(ESP_PLATFORM) + // TODO: Implement secure boot for ESP32-S3 #endif // PICO_RP2350 + goto err; err: if (ret != PICOKEY_OK) { return ret; diff --git a/src/fs/otp.h b/src/fs/otp.h index 2d55e0d..1936328 100644 --- a/src/fs/otp.h +++ b/src/fs/otp.h @@ -32,8 +32,6 @@ extern uint8_t* otp_buffer_raw(uint16_t row); extern bool is_empty_otp_buffer(uint16_t row, uint16_t len); extern int otp_write_data(uint16_t row, uint8_t *data, uint16_t len); extern int otp_write_data_raw(uint16_t row, uint8_t *data, uint16_t len); -extern int otp_enable_secure_boot(uint8_t bootkey, bool secure_lock); -extern void init_otp_files(); #elif defined(ESP_PLATFORM) @@ -44,6 +42,9 @@ extern void init_otp_files(); #endif +extern int otp_enable_secure_boot(uint8_t bootkey, bool secure_lock); +extern void init_otp_files(); + extern const uint8_t *otp_key_1; extern const uint8_t *otp_key_2; diff --git a/src/rescue.c b/src/rescue.c index e9e048c..c90b264 100644 --- a/src/rescue.c +++ b/src/rescue.c @@ -78,6 +78,7 @@ int cmd_write() { return SW_OK(); } +#if defined(PICO_RP2350) || defined(ESP_PLATFORM) int cmd_secure() { if (apdu.nc != 0) { return SW_WRONG_LENGTH(); @@ -92,13 +93,16 @@ int cmd_secure() { } return SW_OK(); } +#endif #define INS_WRITE 0x1C #define INS_SECURE 0x1D static const cmd_t cmds[] = { { INS_WRITE, cmd_write }, +#if defined(PICO_RP2350) || defined(ESP_PLATFORM) { INS_SECURE, cmd_secure }, +#endif { 0x00, 0x0 } };