Commit 59d44fab authored by Marek Vasut's avatar Marek Vasut
Browse files

mxssb: Fixup section header generation



This patch fixes the generation of section header block for multiple
sections. Before this patch, only one section was always generated,
which was incorrect.
Signed-off-by: Marek Vasut's avatarMarek Vasut <marex@denx.de>
parent 36dc1432
......@@ -390,10 +390,14 @@ static int sb_create_image(struct sb_image_ctx *ictx, uint8_t **image)
* SB sections header.
*/
uint8_t sb_section_header_cbc_mac[sizeof(struct sb_key_dictionary_key)];
struct sb_section_ctx *sctx = ictx->sect;
sb_encrypt_sb_sections_header(ictx, sb_section_header_cbc_mac);
sb_emit_data(*image, &image_offset, &ictx->sect->payload,
sizeof(struct sb_sections_header));
while (sctx) {
sb_emit_data(*image, &image_offset, &sctx->payload,
sizeof(struct sb_sections_header));
sctx = sctx->sect;
};
/*
* Key dictionary.
......@@ -412,10 +416,9 @@ static int sb_create_image(struct sb_image_ctx *ictx, uint8_t **image)
* Section tags.
*/
uint8_t encrypted_tag[sizeof(struct sb_command)];
struct sb_section_ctx *sctx = ictx->sect;
struct sb_cmd_ctx *cctx;
struct sb_command *ccmd;
sctx = ictx->sect;
sb_aes_reinit(ictx, sb_header->iv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment