EC keys: consolidate API for handling keys in TEE #2287
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
inTee
option and theteeKeyHandle
format provided a way to create keys in the TEE and export them as opaque handles. While this API made it transparent when a key is really stored in the TEE, it was not convenient in practice, as it required the application to conduct specific checks for hardware support on Android in order to decide whether to store the key in TEE or not.This commit removes the
inTee
option. ECDSA and ECDH keys withextractable
set tofalse
are now generated in the TEE by the platform when the device supports it. When the device does not support it, the key is generated in software. In practice, this means that non-extractable EC* keys are always generated in TEE on iOS, and on Android only when the device supports it.The
"teeKeyHandle"
format has also been removed. TheexportKey
method called for EC* keys withextractable
set tofalse
and the format"raw"
now returns an opaque handle to the key in the TEE instead of throwing.