-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/shell: Update cryptoauthlib shell commands #20673
sys/shell: Update cryptoauthlib shell commands #20673
Conversation
I've tested it with a ATECC608C with success! Although my output looks a bit different, especially the part on which slots data/keys are stored:
Slot 7 seems ok but slot 240 doesn't.
I don't mind much that output since the device and key config are what is expected from the configuration which was originally flashed into the device by the manufacturer. |
Why did this PR got stuck? What do you need to move this forward @Einhornhool ? |
I did not get a notification that it has been reviewed and forgot about it. Will take a closer look tomorrow :) |
@kYc0o Thank you for testing this! |
Yeah of course is some configuration thing, but I was probably expecting that the tool can read standard configuration regardless of the device. Are all your devices with the same config or do they have different? I know for certain that the configuration is valid since it was validated by microchip, but I can check afterwards myself what can cause the mismatch |
Hmm, internally it just uses the The devices I tested were configured and unconfigured, but the configured ones all had the same configuration. |
Can do, but only next week :) |
Sure! This is what I get from the
|
btw I also changed the slot count to 16: diff --git a/sys/shell/cmds/cryptoauthlib.c b/sys/shell/cmds/cryptoauthlib.c
index 93728e44fe..0480a3d6fb 100644
--- a/sys/shell/cmds/cryptoauthlib.c
+++ b/sys/shell/cmds/cryptoauthlib.c
@@ -27,7 +27,7 @@
#include "shell.h"
#define ATCA_CONFIG_READ_ONLY_BYTES (15)
-#define ATCA_KEY_SLOT_COUNT (15)
+#define ATCA_KEY_SLOT_COUNT (16)
#define ATCA_X509_KEY_COUNT (4)
#define SERIAL_NO_START_01 (0) |
Finally took the time for testing this here with a locked ATECC608A, and I get a very similar output to @Einhornhool's initial post. The only difference seems to be the counter value which is all In particular, the three reported slot numbers are all zero and
|
I'd say the differences in the output are caused by different device configurations. I now updated the slot count and fixed the issues with the static tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM! 🚀
Contribution description
The cryptoauthlib shell command was broken due to API changes.
I updated the calls.
Additionally I made the output a bit prettier.
It is also possible to select a specific device, in case there's more than one.
Update 2024-05-17:
Now also compatible with ATECC608A config zone.
Testing procedure
Connect an ATECC508 (or 608), and run an application with the shell and the cryptoauthlib package.
The output should look like this (values differ depending on configuration, of course):
Usage
atca read (for ATECC608A)
atca read_bin