Skip to content

Commit db17010

Browse files
committed
Return the key's bits upon import
1 parent 8c56614 commit db17010

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

atecc608a_se.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,10 @@ static psa_status_t atecc608a_import_public_key(
221221
ASSERT_SUCCESS(atcab_write_pubkey(key_id, pubkey_for_driver((uint8_t *) data)));
222222

223223
if (bits != NULL) {
224-
/* The 64-byte key is written as 72 bytes. See atcab_write_pubkey() for
225-
* why 72 bytes. */
226-
*bits = PSA_BYTES_TO_BITS(72);
224+
/* The 64-byte key is stored in the SE as 72 bytes, but we return 64 as
225+
* the actual key size. */
226+
*bits = PSA_BYTES_TO_BITS(64);
227227
}
228-
229228
exit:
230229
atecc608a_deinit();
231230
return status;

0 commit comments

Comments
 (0)