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

Can firmware stash a random ECC key in KV, then later use that key in an ECDH operation and export the shared secret to memory? #687

Open
bluegate010 opened this issue Jan 9, 2025 · 3 comments
Labels
2.0 feature request documentation Improvements or additions to documentation

Comments

@bluegate010
Copy link

No description provided.

@bluegate010 bluegate010 added 2.0 feature request documentation Improvements or additions to documentation labels Jan 9, 2025
@mojtaba-bisheh
Copy link
Contributor

we the current architecture, to store a new random key into KV, one needs to run the HMAC by using one of the existing keys in KV, and then run ECDH.
KV_slotB = HMAC(KV_slotA, random_input_msg)
KV_slotC = ECDH_keygen(KV_slotB, random_entropy)
KV_slotD = ECDH_sharedkey(KV_slotC, other_party_pubKey)

However, the ECDH shared key is restricted to the KV boundary.

@bluegate010
Copy link
Author

From chipsalliance/caliptra-sw#2017 it appears that even if the private key comes from KV, the shared secret can be exported to firmware. So the answer to the question posted in the issue title seems to be "yes".

@mojtaba-bisheh
Copy link
Contributor

I don't think so. When the private key is retrieved from KV, the shared key write_enable API is disabled, and the firmware has no way to read the shared key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 feature request documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants