cryptoauthlib icon indicating copy to clipboard operation
cryptoauthlib copied to clipboard

calib_execute_send() passes wrong buffer to atsend() when ATCA_HAL_LEGACY_API is #defined

Open davidk408 opened this issue 9 months ago • 0 comments

This error only comes into play when ATCA_HAL_LEGACY_API is #defined.

In this code block of calib_execute_send() in lib/calib/calib_execution.c:

https://github.com/MicrochipTech/cryptoauthlib/blame/405d8311a203e61657597c81b23ae7a370f485d9/lib/calib/calib_execution.c#L332-L341

On line 340 it seems like temp_buf, not txdata, should be passed to atsend(). And because of that error, txlength is one too large because it got incremented before being passed.

Poor little temp_buf[] gets loaded up with data but then her trip is canceled at the last minute. :-(((

davidk408 avatar Apr 30 '24 21:04 davidk408