-
Notifications
You must be signed in to change notification settings - Fork 221
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
p11-kit: cryptoauthlib: module failed to initialize: An error occurred on the device #161
Comments
You need to follow the wiki steps for either setting up p11-kit or provide the provider library to p11-tool in your commands Remember that sudo changes the environment of execution as well. So that means if you set up p11-kit you will have to set it up properly to work in both. If you're using i2c you shouldn't have to be using sudo though. |
I already set up p11-kit in order to use the cryptoauthlib module, I forgot to mention it, sorry.
I executed p11tool without sudo before but the output doesn't change.
Am I missing something more? Can you please link me the wiki you're referring to? So I can be sure I'm following the right thing, thanks |
Okay sudo should be unnecessary. Try modifying the interface line your configuration like this.
|
Now it works. What does the ",1" stands for? Thanks! |
I2C bus number. |
Hi All, I am trying to do almost the same thing as @AlessioC31. I am using a Rpi 3 B+ and I'm trying to use a ATECC608a connected via i2c as a pkc11 slot. I have followed the wiki steps to set up When I execute the
When I try to execute the command in the wiki to Get the public key for a private key I get the error shown in the output below (again, regardless of what I type for the PIN).
Below is the contents of my
Below are the contents of my
Below is the output of
My guess is that the ATECC608A does not come pre-provisioned with the default keys and certificates as found in |
@bryan-hunt My apologies for not digging deeper into the other issues to find the problem. I see from issues #105 and #95 that I missed the initialisation step. (It seems like it might be a good idea to explicitly add this to the PKCS11 Linux Setup wiki page). I get the same error mentioned in #105 and #95, but it does seem to actually initialise the token and I am able to export the public key.
Note: I'm surprised that I get the error because @raerne said here that changing |
I don't have an unprovisioned device available to reproduce. If I recall correctly with "fixed the problem" i meant that the function |
Hi @raerne, thanks for the message. Unfortunately it seems like my ATECC608 is still not working with the pkcs11 tools. I started over with a brand new unprovisioned ATECC608 and did the following:
Based on your comments and what @bryan-hunt has said, this shouldn't be a problem. However, when I ask for the list of tokens I get the following:
Note the this line When I ask for a list of all objects on the token it indeed shows two objects:
And it seems like I can successfully export the public key:
However, when I try to use the pkcs11 engine with OpenSSL to create a certificate signing request, I get more error messages about the token being uninitialized:
For reference, here are the relevant configuration files:
|
Still not solved. I have an issue into Microchip tech support and they said
they are trying to recreate the issue.
…On Tue, Jul 14, 2020 at 01:33 ander-galis-ikerlan ***@***.***> wrote:
I'm having the exact same issue, I'm able to export the key with p11tool
but for OpenSSL the device is not initialized, where you able to solve it?
|
It looks that after the --initialize step the configuration memory is lock but not the data one. And we can't interact with it until it is closed. In order to do it what I did was to use cryptoauthtools, more specifically the config.py to close this memory. It clearly is a workaround but it worked for me and I was able to generate the CSR. You can check the state of your memory using info.py. Remember to install the cryptoauthlib library using pip and moving the libcryptoauth.so that you compiled into the correct folder so that python can detect it |
Hello Shearl / Bryan, I am trying the same with a Rpi4 board with the ATECC608A connected over I2C lines as well. $ p11tool --list-all pkcs11:model=p11-kit-trust;manufacturer=PKCS%2311%20Kit;serial=1;token=System%20Trust $ p11tool --provider /usr/lib/libcryptoauth.so --list-all Object 1: $ p11tool --provider /usr/lib/libcryptoauth.so --initialize "pkcs11:serial=E42440B94379" --label aws-iot $ p11tool --list-tokens Token 1: $ p11tool --export-pubkey --provider /usr/lib/libcryptoauth.so "pkcs11:token=0123EE;object=device;type=private" $ openssl req -engine pkcs11 -key "pkcs11:token=0123EE;object=device;type=private" -keyform engine -new -out new_device.csr -subj "/CN=NEW CSR EXAMPLE" Can you let me know know if you resolved this problem and if yes, how. regards, |
Is this resolved? |
There is nothing to resolve. It's just improper configuration. Start with the Trust Platform Development Suite and configure a TrustFlex part. Otherwise one needs to read the datasheet and understand the part before making changes to the part configuration. |
@bryan-hunt Extremely disappointed with the response. On contacting the Microchip sales team I hear that the ATECC608A Chip has hardware issues and is not recommended for new designs. |
Like all semiconductor devices there are errata that are discovered. Given the worldwide semiconductor manufacturing situation it is recommended to use the latest revision of the part. The ATECC608B trustflex parts are available: https://www.microchipdirect.com/product/ATECC608B-TFLXTLSS-PROTO so that doesn't change the overall recommendation to use the trust platform rather than blank devices. These are complex devices that require attention to detail when performing configuration. This is why the Trust Platform is the best way to get started with using these parts - the Trust Platform Development Suite comes with examples, and configuration tools. When it comes to pkcs11 these instructions have been run numerous times by many people. The pkcs11 interface is used by hundreds of thousands of devices. Everything I have seen on this thread indicates the instructions having not been followed or a hardware issue for which I can't diagnose through this medium. |
If that is the case why haven't you pointed out the "instructions that have not been followed". |
Microchip has a team of ESEs that can support customers in the field; additionally MCHP official support team, available under www.microchip.com/support, can support customers working on designs including this device. I would recommend getting in touch with a local ESE. |
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 |
Hi everyone,
I'm on a Rpi 3 B and I'm trying to use a ATECC508a (connected via i2c) as a pkc11 slot. I can't manage to get it to a working state because when I execute
sudo p11tool --list-all
I get:That's my
lib/atca_config.h
:lib/pkcs11/pkcs11_config.h
:(the only thing I modified here is
#define PKCS11_508_SUPPORT 1
because it was at 0 initially./var/lib/cryptoauthlib/0.conf
:And lastly that's the output of
sudo i2cdetect -y 1
:Can you please help me figuring out what I'm doing wrong?
Thanks.
The text was updated successfully, but these errors were encountered: