@@ -100,7 +100,9 @@ int suit_plat_check_fetch(suit_component_t dst_handle, struct zcbor_string *uri,
100100 struct stream_sink dst_sink = {0 };
101101 suit_plat_err_t plat_ret = SUIT_PLAT_SUCCESS ;
102102 int ret = SUIT_SUCCESS ;
103+ #if !defined(CONFIG_SUIT_STREAM_FILTER_DECRYPT )
103104 (void )manifest_component_id ;
105+ #endif
104106
105107 /*
106108 * Validate streaming operation.
@@ -118,7 +120,15 @@ int suit_plat_check_fetch(suit_component_t dst_handle, struct zcbor_string *uri,
118120 /* Append decryption filter if encryption info is provided. */
119121 if (enc_info != NULL ) {
120122#ifdef CONFIG_SUIT_STREAM_FILTER_DECRYPT
121- ret = suit_decrypt_filter_get (& dst_sink , enc_info , & dst_sink );
123+ suit_manifest_class_id_t * class_id = NULL ;
124+
125+ if (suit_plat_decode_manifest_class_id (manifest_component_id , & class_id ) !=
126+ SUIT_PLAT_SUCCESS ) {
127+ LOG_ERR ("Component ID is not a manifest class" );
128+ return SUIT_ERR_UNSUPPORTED_COMPONENT_ID ;
129+ }
130+
131+ ret = suit_decrypt_filter_get (& dst_sink , enc_info , class_id , & dst_sink );
122132 if (ret != SUIT_PLAT_SUCCESS ) {
123133 LOG_ERR ("Selecting decryption filter failed: %i" , ret );
124134 }
@@ -151,7 +161,9 @@ int suit_plat_fetch(suit_component_t dst_handle, struct zcbor_string *uri,
151161 suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED ;
152162 suit_plat_err_t plat_ret = SUIT_PLAT_SUCCESS ;
153163 int ret = SUIT_SUCCESS ;
164+ #if !defined(CONFIG_SUIT_STREAM_FILTER_DECRYPT )
154165 (void )manifest_component_id ;
166+ #endif
155167
156168 /*
157169 * Validate streaming operation.
@@ -170,7 +182,15 @@ int suit_plat_fetch(suit_component_t dst_handle, struct zcbor_string *uri,
170182 /* Append decryption filter if encryption info is provided. */
171183 if (enc_info != NULL ) {
172184#ifdef CONFIG_SUIT_STREAM_FILTER_DECRYPT
173- ret = suit_decrypt_filter_get (& dst_sink , enc_info , & dst_sink );
185+ suit_manifest_class_id_t * class_id = NULL ;
186+
187+ if (suit_plat_decode_manifest_class_id (manifest_component_id , & class_id ) !=
188+ SUIT_PLAT_SUCCESS ) {
189+ LOG_ERR ("Component ID is not a manifest class" );
190+ return SUIT_ERR_UNSUPPORTED_COMPONENT_ID ;
191+ }
192+
193+ ret = suit_decrypt_filter_get (& dst_sink , enc_info , class_id , & dst_sink );
174194 if (ret != SUIT_PLAT_SUCCESS ) {
175195 LOG_ERR ("Selecting decryption filter failed: %i" , ret );
176196 }
@@ -234,7 +254,9 @@ int suit_plat_check_fetch_integrated(suit_component_t dst_handle, struct zcbor_s
234254 suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED ;
235255 suit_plat_err_t plat_ret = SUIT_PLAT_SUCCESS ;
236256 int ret = SUIT_SUCCESS ;
257+ #if !defined(CONFIG_SUIT_STREAM_FILTER_DECRYPT )
237258 (void )manifest_component_id ;
259+ #endif
238260
239261 /*
240262 * Validate streaming operation.
@@ -270,7 +292,15 @@ int suit_plat_check_fetch_integrated(suit_component_t dst_handle, struct zcbor_s
270292 /* Append decryption filter if encryption info is provided. */
271293 if (enc_info != NULL ) {
272294#ifdef CONFIG_SUIT_STREAM_FILTER_DECRYPT
273- ret = suit_decrypt_filter_get (& dst_sink , enc_info , & dst_sink );
295+ suit_manifest_class_id_t * class_id = NULL ;
296+
297+ if (suit_plat_decode_manifest_class_id (manifest_component_id , & class_id ) !=
298+ SUIT_PLAT_SUCCESS ) {
299+ LOG_ERR ("Component ID is not a manifest class" );
300+ return SUIT_ERR_UNSUPPORTED_COMPONENT_ID ;
301+ }
302+
303+ ret = suit_decrypt_filter_get (& dst_sink , enc_info , class_id , & dst_sink );
274304 if (ret != SUIT_PLAT_SUCCESS ) {
275305 LOG_ERR ("Selecting decryption filter failed: %i" , ret );
276306 }
@@ -303,7 +333,10 @@ int suit_plat_fetch_integrated(suit_component_t dst_handle, struct zcbor_string
303333 suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED ;
304334 suit_plat_err_t plat_ret = SUIT_PLAT_SUCCESS ;
305335 int ret = SUIT_SUCCESS ;
336+ #if !defined(CONFIG_SUIT_STREAM_FILTER_DECRYPT )
306337 (void )manifest_component_id ;
338+ #endif
339+
307340
308341 /*
309342 * Validate streaming operation.
@@ -339,7 +372,15 @@ int suit_plat_fetch_integrated(suit_component_t dst_handle, struct zcbor_string
339372 /* Append decryption filter if encryption info is provided. */
340373 if (enc_info != NULL ) {
341374#ifdef CONFIG_SUIT_STREAM_FILTER_DECRYPT
342- ret = suit_decrypt_filter_get (& dst_sink , enc_info , & dst_sink );
375+ suit_manifest_class_id_t * class_id = NULL ;
376+
377+ if (suit_plat_decode_manifest_class_id (manifest_component_id , & class_id ) !=
378+ SUIT_PLAT_SUCCESS ) {
379+ LOG_ERR ("Component ID is not a manifest class" );
380+ return SUIT_ERR_UNSUPPORTED_COMPONENT_ID ;
381+ }
382+
383+ ret = suit_decrypt_filter_get (& dst_sink , enc_info , class_id , & dst_sink );
343384 if (ret != SUIT_PLAT_SUCCESS ) {
344385 LOG_ERR ("Selecting decryption filter failed: %i" , ret );
345386 }
0 commit comments