-
Notifications
You must be signed in to change notification settings - Fork 18
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
OpenSSL provider implementation does not handle properly unitialized keys. #62
Comments
Hi @reds71 We used Raspberry Pi 4 for provider_dev code development and testing and didn't see the same issue you mentioned. Let me set up the same testing environment as yours and repeat the issue. I will come back to you very soon. Thanks. |
Hi @reds71 We created the latest RPI OS image(Raspberry Pi OS(32-bit) which was released on 2024-07-04): Linux raspberrypi 6.6.31+rpt-rpi-v7 #1 SMP Raspbian 1:6.6.31-1+rpt1 (2024-05-29) armv7l GNU/Linux on Raspberry Pi3. The OpenSSL version is exactly same as yours: OpenSSL 3.0.14 4 Jun 2024. Unfortunately, we could not repeat the issue you encountered. Please find the output shown as below as your reference. When both 0xe0f1 and 0xe0fc key slots are not initialized with key:
we could not repeat the issue for Linux raspberrypi 6.6.31+rpt-rpi-v7. After this, we run command: |
Hi Ying. Thanks for trying to reproduce. OK... Puzzling. RPi OS linux-optiga-trust-m commit But on the build subject, if the RPi upgrade does not solve the issue, I wondered if you built the provider in debug mode? From my experience, it can explain sometimes why memory issues can go under the radar: in those situations it shows up when the code is build in release mode (no -g) Thanks for your help. |
Hi @reds71 I also checked out from the same |
Hi @reds71 To reset the key OIDs to "uninitialized", you need to perform metadata update for the key slot. To make it easy to perform this task, you can clone our GUI tools: optiga-trust-m-explorer Follow the instruction to install it on your RPI3, then you can go to subpage Protected Update to perform Metadata Update for the Key OIDs you want to reset. Please remember if you want to flush the key, you need to select the option: Set Lcso=0x03(Init) ResetType=0x11(Wipe TargetData) before you click Step1:Provisioning for All OIDs. Please refer to the picture shown as below: |
Hi @reds71 We just fixed this issue by this commit Could you kindly check and let us know whether it is working at your side? Thank you very much. |
When using the OpenSSL CLI using public keys stored in the Trust M, when the key object has not been initialized, either the operation succeeds as if normal (RSA) or crashes with a segmentation fault (ECC). Note that all works fine when we create the key first with
0xe0f1:*:NEW:...
Knowing the
0xe0f1
and0xe0fc
OID were never initialized (I agree it may happen a limited period of time, but...), the following OpenSSL executed in a bash on a RPi3 with latest Raspcerry Pi OS and a Trust M Security Shield2GO :The first should not produce a signature but an error and the second one should not crash obviously. There must miss some defensive code somewhere.
Software version:
Chip info:
Host:
Host OS and Version:
Linux rpi3 6.6.47+rpt-rpi-v7 #1 SMP Raspbian 1:6.6.47-1+rpt1 (2024-09-02) armv7l GNU/Linux
Compiler:
cc (Raspbian 12.2.0-14+rpi1) 12.2.0
Thank you!
The text was updated successfully, but these errors were encountered: