1212
1313#if defined(CONFIG_SUIT_IPUC ) && defined(CONFIG_SUIT_PLATFORM_VARIANT_SDFW )
1414#include <suit_ipuc_sdfw.h>
15+ #include <suit_storage_mpi.h>
1516#endif
1617
1718LOG_MODULE_REGISTER (plat_components , CONFIG_SUIT_LOG_LEVEL );
@@ -215,7 +216,8 @@ int suit_plat_component_id_get(suit_component_t handle, struct zcbor_string **co
215216 return SUIT_SUCCESS ;
216217}
217218
218- int suit_plat_override_image_size (suit_component_t handle , size_t size )
219+ int suit_plat_override_image_size (suit_component_t handle , size_t size ,
220+ struct zcbor_string * manifest_component_id )
219221{
220222 struct zcbor_string * component_id = NULL ;
221223
@@ -233,6 +235,21 @@ int suit_plat_override_image_size(suit_component_t handle, size_t size)
233235 return SUIT_ERR_DECODING ;
234236 }
235237
238+ #if defined(CONFIG_SUIT_IPUC ) && defined(CONFIG_SUIT_PLATFORM_VARIANT_SDFW )
239+ suit_manifest_class_id_t * class_id = NULL ;
240+ suit_manifest_role_t role = SUIT_MANIFEST_UNKNOWN ;
241+
242+ if (suit_plat_decode_manifest_class_id (manifest_component_id , & class_id ) !=
243+ SUIT_PLAT_SUCCESS ) {
244+ LOG_ERR ("Component ID is not a manifest class" );
245+ return SUIT_ERR_UNSUPPORTED_COMPONENT_ID ;
246+ }
247+
248+ if (suit_storage_mpi_role_get (class_id , & role ) != SUIT_PLAT_SUCCESS ) {
249+ return SUIT_ERR_UNSUPPORTED_COMPONENT_ID ;
250+ }
251+ #endif
252+
236253 /* Size override is done only for MEM type component */
237254 if (component_type == SUIT_COMPONENT_TYPE_MEM ) {
238255 intptr_t run_address ;
@@ -277,8 +294,6 @@ int suit_plat_override_image_size(suit_component_t handle, size_t size)
277294
278295#if defined(CONFIG_SUIT_IPUC ) && defined(CONFIG_SUIT_PLATFORM_VARIANT_SDFW )
279296 if (size == 0 ) {
280- suit_manifest_role_t role = SUIT_MANIFEST_UNKNOWN ;
281-
282297 suit_ipuc_sdfw_declare (handle , role );
283298 } else {
284299 suit_ipuc_sdfw_revoke (handle );
0 commit comments