Skip to content

Commit

Permalink
Merge pull request wolfSSL#392 from danielinux/fix-image-type-field
Browse files Browse the repository at this point in the history
wolfBoot_get_blob_type: fix return type
  • Loading branch information
dgarske authored Nov 17, 2023
2 parents c910b7f + 23894d3 commit 83aa1d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/wolfboot/wolfboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void wolfBoot_update_trigger(void);
void wolfBoot_success(void);
uint32_t wolfBoot_image_size(uint8_t *image);
uint32_t wolfBoot_get_blob_version(uint8_t *blob);
uint32_t wolfBoot_get_blob_type(uint8_t *blob);
uint16_t wolfBoot_get_blob_type(uint8_t *blob);
uint32_t wolfBoot_get_blob_diffbase_version(uint8_t *blob);

/* Get partition ID from manifest header */
Expand Down
4 changes: 2 additions & 2 deletions src/libwolfboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,9 +1075,9 @@ uint32_t wolfBoot_get_blob_version(uint8_t *blob)
*
* @return The type of the blob, or 0 if the blob is invalid.
*/
uint32_t wolfBoot_get_blob_type(uint8_t *blob)
uint16_t wolfBoot_get_blob_type(uint8_t *blob)
{
uint32_t *volatile type_field = NULL;
uint16_t *volatile type_field = NULL;
uint32_t *magic = NULL;
uint8_t *img_bin = blob;
#if defined(EXT_ENCRYPTED) && defined(MMU)
Expand Down
2 changes: 1 addition & 1 deletion tools/unit-tests/unit-image.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static uint16_t _find_header(uint8_t *haystack, uint16_t type, uint8_t **ptr)
return 0;
}

uint32_t wolfBoot_get_blob_type(uint8_t *addr)
uint16_t wolfBoot_get_blob_type(uint8_t *addr)
{
return HDR_IMG_TYPE_APP;
}
Expand Down

0 comments on commit 83aa1d8

Please sign in to comment.