1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #17939 from fjmolinas/pr_suit_manifest_ram_seq_no

sys/suit: save seq_number when parsing manifest
This commit is contained in:
benpicco 2022-04-15 14:22:57 +02:00 committed by GitHub
commit c610b1fa2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -245,6 +245,7 @@ typedef struct {
uint8_t validation_buf[SUIT_COSE_BUF_SIZE];
char *urlbuf; /**< Buffer containing the manifest url */
size_t urlbuf_len; /**< Length of the manifest url */
uint32_t seq_number; /**< Set sequence number */
} suit_manifest_t;
/**

View File

@ -76,6 +76,7 @@ static int _seq_no_handler(suit_manifest_t *manifest, int key,
}
LOG_INFO("suit: validated sequence number\n)");
manifest->seq_number = seq_nr;
manifest->validated |= SUIT_VALIDATED_SEQ_NR;
return SUIT_OK;

View File

@ -120,11 +120,9 @@ static int _ram_finish(suit_storage_t *storage, const suit_manifest_t *manifest)
return SUIT_OK;
}
static int _ram_install(suit_storage_t *storage,
const suit_manifest_t *manifest)
static int _ram_install(suit_storage_t *storage, const suit_manifest_t *manifest)
{
(void)manifest;
(void)storage;
suit_storage_set_seq_no(storage, manifest->seq_number);
return SUIT_OK;
}

View File

@ -47,5 +47,5 @@ gen_manifest "${MANIFEST_DIR}/manifest3.bin".unsigned 2 "${MANIFEST_DIR}/file1.b
sign_manifest "${MANIFEST_DIR}/manifest3.bin".unsigned "${MANIFEST_DIR}/manifest3.bin"
# valid manifest, valid seqnr, signed, 2 components
gen_manifest "${MANIFEST_DIR}/manifest4.bin".unsigned 2 "${MANIFEST_DIR}/file1.bin:0:ram:0" "${MANIFEST_DIR}/file2.bin:0:ram:1"
gen_manifest "${MANIFEST_DIR}/manifest4.bin".unsigned 3 "${MANIFEST_DIR}/file1.bin:0:ram:0" "${MANIFEST_DIR}/file2.bin:0:ram:1"
sign_manifest "${MANIFEST_DIR}/manifest4.bin".unsigned "${MANIFEST_DIR}/manifest4.bin"