Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
davidk408 opened this issue Apr 30, 2024 · 2 comments · May be fixed by #376
Closed

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

davidk408 opened this issue Apr 30, 2024 · 2 comments · May be fixed by #376
Labels

Comments

@davidk408
Copy link

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

@jd-imi
Copy link

jd-imi commented May 27, 2024

I came to the same conclusion, so I made a PR.

Copy link

This issue has been marked as stale - please confirm the issue still exists with the latest version of the library and update the issue if it remains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants