analogdevicesinc / msdk

Software Development Kit for Analog Device's MAX-series microcontrollers
Apache License 2.0
60 stars 75 forks source link

fix(PeriphDrivers): MXC_SYS_GetUSN Checksum error #1050

Closed EricB-ADI closed 1 week ago

EricB-ADI commented 1 week ago

Pull Request Template

Description

For some MCUs, the MXC_SYS_GetUSN function used the AES peripheral to calculate the checksum.

1016 Addresses an issue with the possibility of an unbounded memory access. The MXC_SYS_GetUSN function now only copies and clears the 13 bytes of the USN. However, the checksum is calculated using the USN checksum length not the USN length, so the CRC was calculated using the correct 13 bytes of the USN plus 3 uninitialized bytes causing checksum errors. This patch fixes this issue.

EricB-ADI commented 1 week ago

/clang-format-run