Subject: [Suit] Integrated Dependency example

From: Ken Takayama <[email-masked]>
Date: Fri, 25 Mar 2022 01:24:17 +0900

Hi Brendan and SUIT team,

I created a manifest example which uses integrated-dependency, and the
libcsuit can process it.
Please check the binary example
<https://github.com/yuichitk/libcsuit/blob/master/testfiles/suit_manifest_expID.md>
and the libcsuit behavior below.
Thank you in advance!

# Additional SUIT Manifest explanation
There are Personalization Data manifest and Trusted Component manifest.
The former one depends the latter one, and they are put together with
integrated-dependency function.
(NOTE: The Trusted Component in TEEP documents is equivalent to the
Firmware in the SUIT documents, and Personalization Data includes
configuration data.)

# libcsuit behavior
While libcsuit processes the SUIT Manifest binary, it triggers some
callback functions specified by the `suit_manifest_process`
application part.
The execution stdout is like below, and I added some explanations in /* */.
```
$ ./suit_manifest_process ./testfiles/suit_manifest_expID.cbor
/*
When the parser arrived at integrated-dependency part
["#depending"](https://github.com/yuichitk/libcsuit/blob/master/testfiles/suit_manifest_expID.md?plain=1#L24)
it triggers the store callback to ask the application program to store
the Trusted Component manifest.
 */
store callback : {
  dst-dependnecy-digest :
    algorithm-id : -16
    digest-bytes : 0x14 0xa9 0x8b 0xe9 0x57 ..
  dst-dependency-prefix : []
  ptr : 0x7ffe2e9a8617 (303)
  suit_rep_policy_t : RecPass0 RecFail1 SysPass0 SysFail0
}

/*
Now the parser is at integrated-dependency part
["#tc"](https://github.com/yuichitk/libcsuit/blob/master/testfiles/suit_manifest_expID.md?plain=1#L39)
and triggers the store callback again.
 */
store callback : {
  dst-component-identifier : [0x54 0x45 0x45 0x50 0x2d .., 0x53 0x65
0x63 0x75 0x72 .., 0x8d 0x82 0x57 0x3a 0x92 .., 0x74 0x61 , ]
  ptr : 0x7ffe2e9a8695 (20)
  suit_rep_policy_t : RecPass1 RecFail1 SysPass1 SysFail1
}

/*
Finally it reaches the directive to fetch the personalization data.
[directive-fetch
config.json](https://github.com/yuichitk/libcsuit/blob/master/testfiles/suit_manifest_expID.md?plain=1#L124)
 */
fetch callback : {
  uri : "https://example.org/config.json" (31)
  dst-component-identifier : [0x54 0x45 0x45 0x50 0x2d .., 0x53 0x65
0x63 0x75 0x72 .., 0x63 0x6f 0x6e 0x66 0x69 .., ]
  ptr : 0x7ffe2e9a8848 (64)
  suit_rep_policy_t : RecPass0 RecFail1 SysPass0 SysFail0
}
```

# Testing
Code is here
<https://github.com/yuichitk/libcsuit>
and you can build and test the it with `$ make -f Makefile.process
test` but it requires some installation steps.
<https://github.com/yuichitk/libcsuit#using-makefiles>

Sincerely,
Ken