Closed lbradeen closed 1 year ago
Strangely, if you execute both commands sc-hsm-tool
again then it works.
I see what is happening. This is nothing wrong with the code. The thing is that sc-hsm-tool
sends a shutdown command after 5 seconds of inactivity after initialization, pulling you out of credentials. Plus, sc-hsm-tool --import-dkek-share
ignores the --pin
argument and it does not perform any login command before dkek import. Try to import the key before 5 seconds of inactivity and it will work. Entering the command will be enough to retain the login status and it will not take into account if you take more than 5 seconds to introduce dkek password. The trick is to call dkek import before 5 seconds.
This does not happen with SCS3 tool and I do not know how to fix it. A possible way is to chain login command with dkek import, but it is really ugly:
pkcs11-tool --login --pin 12341234 -I && sc-hsm-tool --import-dkek-share dkek.pbe
That workaround works, thanks.
Thanks for the project as well.
I'm using the development branch because I hit the hanging issue on Ubuntu 22.04.
I'm following the dkek instructions and cannot get past an error when importing it.