Feature/patch caam huk#3149
Conversation
Add C inline function to execute assembly instruction WFE/SEV use in C code Signed-off-by: Cedric Neveux <[email protected]> Reviewed-by: Jens Wiklander <[email protected]> Acked-by: Jens Wiklander <[email protected]>
Add registers to handle CAAM clocks Signed-off-by: Cedric Neveux <[email protected]>
Add dt functions:
- dt_get_irq
get the interrupt number of a node
- dt_node_offset_by_compatible_status
find a node compatible with specified 'compatible' input
and check if the node status correspond to the expected
one
- dt_disable_status
disable the 'status' field of node's prop
- dt_set_secure_status
set 'secure-status' field of node's prop and disable
the 'status' field in the same time
Signed-off-by: Cedric Neveux <[email protected]>
To allow any driver or initialization function to change the DT, moved the DT pack operation at the end of the generic boot. Move from update_external_dt to release_external_dt Signed-off-by: Cedric Neveux <[email protected]> Acked-by: Jens Wiklander <[email protected]>
Add the NXP CAAM drivers:
- Random generator (instantiation and random generation)
- Hash
Add a generic cryptographic driver interface connecting
TEE Crypto generic APIs to HW driver interface
The Generic Crypto Driver interface in the
core/driver/crypto/crypto_api
is implemented to be able to use an other HW driver that
is not the CAAM driver.
Signed-off-by: Cedric Neveux <[email protected]>
Add the NXP CAAM drivers:
- Cipher (AES/DES/DES3)
Add a generic Cipher cryptographic driver interface connecting
TEE Crypto generic APIs to HW driver interface
Signed-off-by: Cedric Neveux <[email protected]>
Add the NXP CAAM drivers:
- Asymmetric ECC
Add a generic ECC cryptographic driver interface connecting
TEE Crypto generic APIs to HW driver interface
Signed-off-by: Cedric Neveux <[email protected]>
If supported, the cryptographic driver must be call during the system cryptographic initialization. This is needed to be able to respond to the crypto operation during the boot (e.g, HUK generation) Signed-off-by: Cedric Neveux <[email protected]>
|
Looking at this I doubt this is working as intended. Take
So only callers of |
@Emantor
|
651596d to
bcb5356
Compare
Add the CAAM driver (part of CAAM Blob) to support the
generation of a Hardware Unique Key based on the device
efuse.
This is a preliminary implementation to enable the HUK generation
Missing in this patch is the i.MX SNVS functions:
- Check if the device is closed or not
- Selection of the OTPMK key used to generate the HUK
Those functions will be implemented in a separated PR
in which the SNVS driver will be updated and functional
Add weak function implementation in the plat-imx platform
tee_otp_get_hw_unique_key
Signed-off-by: Cedric Neveux <[email protected]>
| * If there is an error during the Master key derivation, let the device | ||
| * booting with a 0's key | ||
| */ | ||
| if (ret != TEE_SUCCESS) { |
There was a problem hiding this comment.
Maybe only hide errors when some sort of testing/development flag is set? If feels odd to allow the device to boot when the security module is known to be in a bad state.
My understanding of the CAAM is that this will fail if High Assurance Boot (HAB) is not enabled on the device, which is likely during development. We allow a zero key through when using CFG_RPMB_TESTKEY since that is our primary use case for tee_otp_get_hw_unique_key(), although the system PTA now also offers a key derivation function via system_derive_ta_unique_key()...
Unfortunately I don't recall having come across a good config flag for that in OP-TEE which also covers the non-RPMB path (tee_fs_init_key_manager()).
| desc_add_word(desc, DESC_HEADER(0)); | ||
|
|
||
| /* Load the key modifier */ | ||
| desc_add_word(desc, LD_NOIMM(CLASS_2, REG_KEY, BLOB_KEY_MODIFIER_SIZE)); |
There was a problem hiding this comment.
Why is a key modifier used for the Master Key Verification Blob?
AFAICS this has no effect for the MKVB.
There was a problem hiding this comment.
Testing reveals that this has an effect, but the MKVB does also work without the key modifier. In theory this could be used to derive different keys, however OP-TEE already does this in software and its not really required for the MKVB.
Add the NXP CAAM drivers:
This PR includes the PR #2962, PR #3135 and PR #3136. The latest commit "core:driver implementation NXP CAAM Driver - ECC" is added to the PR #3136
This patch implementation is a preliminary implementation because of missing correct SNVS driver that will be in a separated patch.