diff mbox series

[V2,04/10] parser: Read aes-key from sw-description into struct img_type

Message ID 20231204100620.27789-5-Michael.Glembotzki@iris-sensing.com
State Changes Requested
Headers show
Series [V2,01/10] util: BUG: set_aes_key does not fail on invalid aes key or ivt | expand

Commit Message

Michael Glembotzki Dec. 4, 2023, 10:05 a.m. UTC
Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com>
---
 include/swupdate_image.h | 1 +
 parser/parser.c          | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/include/swupdate_image.h b/include/swupdate_image.h
index 592a886..1ba1d22 100644
--- a/include/swupdate_image.h
+++ b/include/swupdate_image.h
@@ -56,6 +56,7 @@  struct img_type {
 	int preserve_attributes; /* whether to preserve attributes in archives */
 	bool is_encrypted;
 	char ivt_ascii[33];
+	char aeskey_ascii[65]; /* AES_256_KEY_LEN*2+1 */
 	int install_directly;
 	int is_script;
 	int is_partitioner;
diff --git a/parser/parser.c b/parser/parser.c
index 60f979a..0d5f03e 100644
--- a/parser/parser.c
+++ b/parser/parser.c
@@ -452,6 +452,7 @@  static int parse_common_attributes(parsertype p, void *elem, struct img_type *im
 	get_field(p, elem, "install-if-higher", &image->id.install_if_higher);
 	get_field(p, elem, "encrypted", &image->is_encrypted);
 	GET_FIELD_STRING(p, elem, "ivt", image->ivt_ascii);
+	GET_FIELD_STRING(p, elem, "aes-key", image->aeskey_ascii);
 
 	if (is_image_installed(&cfg->installed_sw_list, image)) {
 		image->skip = SKIP_SAME;