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.
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.