From 0a0614fb0611a4792c1e29d16dd1852755f1e53d Mon Sep 17 00:00:00 2001 From: Cristian Cruz <71054319+crsz20@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:22:03 -0500 Subject: [PATCH] fix(PeriphDrivers): Resize the USN buffer in checksum verification for MAX32655, MAX32662, and MAX32670 (#1192) --- Libraries/PeriphDrivers/Source/SYS/sys_me12.c | 2 +- Libraries/PeriphDrivers/Source/SYS/sys_me15.c | 2 +- Libraries/PeriphDrivers/Source/SYS/sys_me17.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_me12.c b/Libraries/PeriphDrivers/Source/SYS/sys_me12.c index d7db012f1e..a94212d687 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_me12.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_me12.c @@ -103,7 +103,7 @@ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum) // Set NULL Key MXC_AES_SetExtKey((const void *)aes_key, MXC_AES_128BITS); - uint8_t usn_copy[MXC_SYS_USN_LEN] = { 0 }; + uint8_t usn_copy[MXC_SYS_USN_CHECKSUM_LEN] = { 0 }; memcpy(usn_copy, usn, MXC_SYS_USN_LEN); // Compute Checksum mxc_aes_req_t aes_req; diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_me15.c b/Libraries/PeriphDrivers/Source/SYS/sys_me15.c index dd4ad6874d..eb7da8daec 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_me15.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_me15.c @@ -110,7 +110,7 @@ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum) // Set NULL Key MXC_AES_SetExtKey((const void *)aes_key, MXC_AES_128BITS); - uint8_t usn_copy[MXC_SYS_USN_LEN] = { 0 }; + uint8_t usn_copy[MXC_SYS_USN_CHECKSUM_LEN] = { 0 }; memcpy(usn_copy, usn, MXC_SYS_USN_LEN); // Compute Checksum diff --git a/Libraries/PeriphDrivers/Source/SYS/sys_me17.c b/Libraries/PeriphDrivers/Source/SYS/sys_me17.c index ff2d5c9288..0b7ce1ac92 100644 --- a/Libraries/PeriphDrivers/Source/SYS/sys_me17.c +++ b/Libraries/PeriphDrivers/Source/SYS/sys_me17.c @@ -105,7 +105,7 @@ int MXC_SYS_GetUSN(uint8_t *usn, uint8_t *checksum) // Set NULL Key MXC_AES_SetExtKey((const void *)aes_key, MXC_AES_128BITS); - uint8_t usn_copy[MXC_SYS_USN_LEN] = { 0 }; + uint8_t usn_copy[MXC_SYS_USN_CHECKSUM_LEN] = { 0 }; memcpy(usn_copy, usn, MXC_SYS_USN_LEN); // Compute Checksum