Mbed-TLS / mbedtls

An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API. Releases are on a varying cadence, typically around 3 - 6 months between releases.
https://www.trustedfirmware.org/projects/mbed-tls/
Other
5.21k stars 2.55k forks source link

PSA key storage: systematically store the bit-size #3740

Open gilles-peskine-arm opened 3 years ago

gilles-peskine-arm commented 3 years ago

Currently the bit-size is stored for dynamic-driver secure element keys and calculated for the data for transparent keys. To simplify the design of storage for opaque drivers that store the key as a wrapped blob (https://github.com/ARMmbed/mbedtls/issues/3289), store the bit-size systematically with the other attributes.

The storage format currently has a 32-bit field for the key type, but key types are now 16-bit, as are key sizes. So I propose to split these 32-bits into type and size.

torstenes commented 3 years ago

I have started working on this ticket and can have a PR ready fairly soon.

Should a solution to this ticket include updates of the storage format documentation? It seems like a separate ticket was created for this https://github.com/ARMmbed/mbedtls/issues/3737

gilles-peskine-arm commented 3 years ago

3737 is to update historical documentation. If you change the format, please add a new section to https://github.com/ARMmbed/mbedtls/blob/development/docs/architecture/mbed-crypto-storage-specification.md that describes the new format.