Skip to content

Commit f785d15

Browse files
committed
Revert "Remove unneeded code"
This reverts commit e10fb94. Signed-off-by: cybnon <[email protected]>
1 parent e10fb94 commit f785d15

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/atecc608_handler.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ int atecc_handler_write_data(int slot, uint8_t* data, size_t data_len) {
224224
return status;
225225
}
226226

227+
// Check both config and data zone locks
228+
if (check_lock_zone(LOCK_ZONE_CONFIG) == ATCA_NOT_LOCKED ||
229+
check_lock_zone(LOCK_ZONE_DATA) == ATCA_NOT_LOCKED) {
230+
return ATCA_EXECUTION_ERROR;
231+
}
232+
227233
// Calculate the number of blocks and any remaining bytes
228234
size_t num_blocks = data_len / 32;
229235
size_t remaining_bytes = data_len % 32;
@@ -264,6 +270,12 @@ int atecc_handler_read_data(int slot, uint8_t* data, size_t data_len) {
264270
return status;
265271
}
266272

273+
// Check both config and data zone locks
274+
if (check_lock_zone(LOCK_ZONE_CONFIG) == ATCA_NOT_LOCKED ||
275+
check_lock_zone(LOCK_ZONE_DATA) == ATCA_NOT_LOCKED) {
276+
return ATCA_EXECUTION_ERROR;
277+
}
278+
267279
// Calculate the number of blocks and any remaining bytes
268280
size_t num_blocks = data_len / 32;
269281
size_t remaining_bytes = data_len % 32;

0 commit comments

Comments
 (0)