summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul HENRYS <[email protected]>2024-11-25 18:47:15 +0100
committerTom Rini <[email protected]>2024-12-19 09:10:34 -0600
commit79d7b11102e31f3b92afff1c94dd9fe1a8b9a9e4 (patch)
tree98b54533b077c73263c49227af6dbe38e0500faf /include
parent337bfdce5aa52637b482b182db959b9bb058f4b7 (diff)
aes: Allow to store randomly generated IV in the FIT
When the initialisation vector is randomly generated, its value shall be stored in the FIT together with the encrypted data. The changes allow to store the IV in the FIT also in the case where the key is not stored in the DTB but retrieved somewhere else at runtime. Signed-off-by: Paul HENRYS <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/image.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/image.h b/include/image.h
index 9be5acd8158..cfe3c971a36 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1788,6 +1788,21 @@ struct cipher_algo {
const unsigned char *data, int data_len,
unsigned char **cipher, int *cipher_len);
+ /**
+ * add_cipher_data() - Add cipher data to the FIT and device tree
+ *
+ * This is used to add the ciphered data to the FIT and other cipher
+ * related information (key and initialization vector) to a device tree.
+ *
+ * @info: Pointer to image cipher information.
+ * @keydest: Pointer to a device tree where the key and IV can be
+ * stored. keydest can be NULL when the key is retrieved at
+ * runtime by another mean.
+ * @fit: Pointer to the FIT image.
+ * @node_noffset: Offset where the cipher information are stored in the
+ * FIT.
+ * return: 0 on success, a negative error code otherwise.
+ */
int (*add_cipher_data)(struct image_cipher_info *info,
void *keydest, void *fit, int node_noffset);