File tree Expand file tree Collapse file tree
samples/boards/ast2700_evb/demo/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131#define CPTRA_ECDSA_SIG_LEN 96 /* ECDSA384 */
3232#define CPTRA_ECDSA_SHA_LEN 48 /* SHA384 */
3333#define CPTRA_MBOX_SZ 0x20000 /* 128KB */
34+ #define CPTRA_IMC_ENTRY_COUNT 127 /* Max IMC entry count */
3435
3536/* Mailbox commands */
3637enum cptra_mbox_cmd {
@@ -508,16 +509,18 @@ struct cptra_manifest_preamble {
508509 uint32_t metadata_owner_LMS_sig [405 ];
509510};
510511
512+ struct cptra_manifest_ime {
513+ uint32_t fw_id ;
514+ uint32_t flags ;
515+ uint8_t digest [48 ]; /* SHA384 */
516+ };
517+
511518struct cptra_set_auth_manifest_ia {
512519 uint32_t manifest_size ;
513520
514521 struct cptra_manifest_preamble preamble ;
515522 uint32_t metadata_entry_entry_count ;
516- struct {
517- uint32_t fw_id ;
518- uint32_t flags ;
519- uint8_t digest [48 ];
520- } metadata_entries [1 ];
523+ struct cptra_manifest_ime metadata_entries [CPTRA_IMC_ENTRY_COUNT ];
521524};
522525
523526struct cptra_set_auth_manifest_oa {
Original file line number Diff line number Diff line change @@ -1607,7 +1607,9 @@ __attribute__((unused)) static void cptra_test_set_auth_manifest(void)
16071607 memset (& output , 0 , sizeof (struct cptra_set_auth_manifest_oa ));
16081608
16091609 /* Set input data */
1610- input .manifest_size = sizeof (struct cptra_set_auth_manifest_ia ) - 4 ;
1610+ input .manifest_size = sizeof (struct cptra_manifest_preamble ) +
1611+ sizeof (uint32_t ) +
1612+ sizeof (struct cptra_manifest_ime );
16111613 input .preamble .manifest_marker = CPTRA_MBCMD_SET_AUTH_MANIFEST ;
16121614 input .preamble .preamble_size = sizeof (struct cptra_manifest_preamble );
16131615 input .preamble .manifest_version = 1 ;
@@ -1734,7 +1736,7 @@ __attribute__((unused)) static void cptra_test_set_auth_manifest(void)
17341736 LOG_DBG ("Hashing metadata entries" );
17351737 memset (hash , 0 , sizeof (hash ));
17361738 range = sizeof (input .metadata_entry_entry_count ) +
1737- sizeof (input .metadata_entries );
1739+ sizeof (input .metadata_entries [ 0 ] );
17381740#if defined(CONFIG_MBEDTLS )
17391741 ret = mbedtls_sha512 ((const uint8_t * )& input .metadata_entry_entry_count , range ,
17401742 hash , 1 );
You can’t perform that action at this time.
0 commit comments