Skip to content

Commit

Permalink
Merge pull request #35 from kentakayama/ietf120-candidate-verification
Browse files Browse the repository at this point in the history
Update examples
  • Loading branch information
kentakayama authored Sep 16, 2024
2 parents aa20d6d + 7bdab67 commit 3a349c4
Show file tree
Hide file tree
Showing 67 changed files with 1,102 additions and 1,049 deletions.
2 changes: 1 addition & 1 deletion Makefile.parser
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $(TARGET): $(OBJS) | ./bin
./obj/%.o: %.c | ./obj/src ./obj/examples
$(CC) $(CFLAGS) $(INC) -o $@ -c $<

TEST_NUM := 0 1 2A 2B 3 4 5 U I D R S0 S1 S2 S3 S4 U0 U1
TEST_NUM := 0 1 2A 2B 3 4 5 U I D AF AW EW ED S0 S2 S3 S4 U0 U1
EXPS := $(foreach num,$(TEST_NUM),./testfiles/suit_manifest_exp$(num).cbor)
define test-one
$(TARGET) $1 2 || exit 1
Expand Down
2 changes: 1 addition & 1 deletion Makefile.process
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ define test-one

endef

TEST_NUM := 0 1 2A 2B 3 4 5 U I D R S0 S1 S2 S3 S4 U0 U1
TEST_NUM := 0 1 2A 2B 3 4 5 U I D AF AW EW ED S0 S2 S3 S4 U0 U1
.PHONY: test
test: all
$(foreach num,$(TEST_NUM),$(call test-one,$(num)))
Expand Down
41 changes: 41 additions & 0 deletions examples/inc/delegated_authority_cose_key_private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2020-2023 SECOM CO., LTD. All Rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause
*
*/

#ifndef DELEGATED_AUTHORITY_ES256_COSE_KEY_PRIVATE_H
#define DELEGATED_AUTHORITY_ES256_COSE_KEY_PRIVATE_H
#include "qcbor/UsefulBuf.h"

const unsigned char delegated_authority_es256_cose_key_private_buf[] = {
0xA5, //# map(5)
0x01, //# unsigned(1) / 1 = kty /
0x02, //# unsigned(2) / 2 = EC2 /
0x20, //# negative(0) / -1 = crv /
0x01, //# unsigned(1) / 1 = P-256 /
0x21, //# negative(1) / -2 = x /
0x58, 0x20, //# bytes(32)
0x0E, 0x90, 0x8A, 0xA8, 0xF0, 0x66, 0xDB, 0x1F,
0x08, 0x4E, 0x0C, 0x36, 0x52, 0xC6, 0x39, 0x52,
0xBD, 0x99, 0xF2, 0xA5, 0xBD, 0xB2, 0x2F, 0x9E,
0x01, 0x36, 0x7A, 0xAD, 0x03, 0xAB, 0xA6, 0x8B,
0x22, //# negative(2) / -3 = y /
0x58, 0x20, //# bytes(32)
0x77, 0xDA, 0x1B, 0xD8, 0xAC, 0x4F, 0x0C, 0xB4,
0x90, 0xBA, 0x21, 0x06, 0x48, 0xBF, 0x79, 0xAB,
0x16, 0x4D, 0x49, 0xAD, 0x35, 0x51, 0xD7, 0x1D,
0x31, 0x4B, 0x27, 0x49, 0xEE, 0x42, 0xD2, 0x9A,
0x23, //# negative(3) / -4 = d /
0x58, 0x20, //# bytes(32)
0x84, 0x1A, 0xEB, 0xB7, 0xB9, 0xEA, 0x6F, 0x02,
0x60, 0xBE, 0x73, 0x55, 0xA2, 0x45, 0x88, 0xB9,
0x77, 0xD2, 0x3D, 0x2A, 0xC5, 0xBF, 0x2B, 0x6B,
0x2D, 0x83, 0x79, 0x43, 0x2A, 0x1F, 0xEA, 0x98,
};
const UsefulBufC delegated_authority_es256_cose_key_private = {
.ptr = delegated_authority_es256_cose_key_private_buf,
.len = sizeof(delegated_authority_es256_cose_key_private_buf)
};
#endif /* DELEGATED_AUTHORITY_ES256_COSE_KEY_PRIVATE_H */
35 changes: 35 additions & 0 deletions examples/inc/delegated_authority_cose_key_public.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2020-2023 SECOM CO., LTD. All Rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause
*
*/

#ifndef DELEGATED_AUTHORITY_ES256_COSE_KEY_PUBLIC_H
#define DELEGATED_AUTHORITY_ES256_COSE_KEY_PUBLIC_H
#include "qcbor/UsefulBuf.h"

const unsigned char delegated_authority_es256_cose_key_public_buf[] = {
0xA4, //# map(4)
0x01, //# unsigned(1) / 1 = kty /
0x02, //# unsigned(2) / 2 = EC2 /
0x20, //# negative(0) / -1 = crv /
0x01, //# unsigned(1) / 1 = P-256 /
0x21, //# negative(1) / -2 = x /
0x58, 0x20, //# bytes(32)
0x0E, 0x90, 0x8A, 0xA8, 0xF0, 0x66, 0xDB, 0x1F,
0x08, 0x4E, 0x0C, 0x36, 0x52, 0xC6, 0x39, 0x52,
0xBD, 0x99, 0xF2, 0xA5, 0xBD, 0xB2, 0x2F, 0x9E,
0x01, 0x36, 0x7A, 0xAD, 0x03, 0xAB, 0xA6, 0x8B,
0x22, //# negative(2) / -3 = y /
0x58, 0x20, //# bytes(32)
0x77, 0xDA, 0x1B, 0xD8, 0xAC, 0x4F, 0x0C, 0xB4,
0x90, 0xBA, 0x21, 0x06, 0x48, 0xBF, 0x79, 0xAB,
0x16, 0x4D, 0x49, 0xAD, 0x35, 0x51, 0xD7, 0x1D,
0x31, 0x4B, 0x27, 0x49, 0xEE, 0x42, 0xD2, 0x9A,
};
const UsefulBufC delegated_authority_es256_cose_key_public = {
.ptr = delegated_authority_es256_cose_key_public_buf,
.len = sizeof(delegated_authority_es256_cose_key_public_buf)
};
#endif /* DELEGATED_AUTHORITY_ES256_COSE_KEY_PUBLIC_H */
2 changes: 2 additions & 0 deletions examples/inc/device_es256_cose_key_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#ifndef DEVICE_ES256_COSE_KEY_PRIVATE_H
#define DEVICE_ES256_COSE_KEY_PRIVATE_H
#include "qcbor/UsefulBuf.h"

const unsigned char device_es256_cose_key_private_buf[] = {
0xA5, //# map(5)
0x01, //# unsigned(1) / 1 = kty /
Expand Down
2 changes: 2 additions & 0 deletions examples/inc/device_es256_cose_key_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#ifndef DEVICE_ES256_COSE_KEY_PUBLIC_H
#define DEVICE_ES256_COSE_KEY_PUBLIC_H
#include "qcbor/UsefulBuf.h"

const unsigned char device_es256_cose_key_public_buf[] = {
0xA4, //# map(4)
0x01, //# unsigned(1) / 1 = kty /
Expand Down
2 changes: 2 additions & 0 deletions examples/inc/tam_es256_cose_key_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#ifndef TAM_ES256_COSE_KEY_PRIVATE_H
#define TAM_ES256_COSE_KEY_PRIVATE_H
#include "qcbor/UsefulBuf.h"

const unsigned char tam_es256_cose_key_private_buf[] = {
0xA5, //# map(5)
0x01, //# unsigned(1) / 1 = kty /
Expand Down
2 changes: 2 additions & 0 deletions examples/inc/tam_es256_cose_key_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#ifndef TAM_ES256_COSE_KEY_PUBLIC_H
#define TAM_ES256_COSE_KEY_PUBLIC_H
#include "qcbor/UsefulBuf.h"

const unsigned char tam_es256_cose_key_public_buf[] = {
0xA4, //# map(4)
0x01, //# unsigned(1) / 1 = kty /
Expand Down
2 changes: 2 additions & 0 deletions examples/inc/trust_anchor_a128_cose_key_secret.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#ifndef TRUST_ANCHOR_A128_COSE_KEY_SECRET_H
#define TRUST_ANCHOR_A128_COSE_KEY_SECRET_H
#include "qcbor/UsefulBuf.h"

const unsigned char trust_anchor_a128_cose_key_secret_buf[] = {
0xA2, //# map(2)
0x01, //# unsigned(1) / 1 = key /
Expand Down
2 changes: 2 additions & 0 deletions examples/inc/trust_anchor_hmac256_cose_key_secret.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#ifndef TRUST_ANCHOR_HMAC256_COSE_KEY_SECRET_H
#define TRUST_ANCHOR_HMAC256_COSE_KEY_SECRET_H
#include "qcbor/UsefulBuf.h"

const unsigned char trust_anchor_hmac256_cose_key_secret_buf[] = {
0xA2, //# map(2)
0x01, //# unsigned(1) / 1 = key /
Expand Down
2 changes: 2 additions & 0 deletions examples/inc/trust_anchor_prime256v1_cose_key_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#ifndef TRUST_ANCHOR_PRIME256V1_COSE_KEY_PRIVATE_H
#define TRUST_ANCHOR_PRIME256V1_COSE_KEY_PRIVATE_H
#include "qcbor/UsefulBuf.h"

const unsigned char trust_anchor_prime256v1_cose_key_private_buf[] = {
0xA5, //# map(5)
0x01, //# unsigned(1) / 1 = kty /
Expand Down
2 changes: 2 additions & 0 deletions examples/inc/trust_anchor_prime256v1_cose_key_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#ifndef TRUST_ANCHOR_PRIME256V1_COSE_KEY_PUBLIC_H
#define TRUST_ANCHOR_PRIME256V1_COSE_KEY_PUBLIC_H
#include "qcbor/UsefulBuf.h"

const unsigned char trust_anchor_prime256v1_cose_key_public_buf[] = {
0xA4, //# map(4)
0x01, //# unsigned(1) / 1 = kty /
Expand Down
18 changes: 14 additions & 4 deletions examples/suit_manifest_parser_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "csuit/suit_cose.h"
#include "suit_examples_common.h"
#include "trust_anchor_prime256v1_cose_key_private.h"
#include "delegated_authority_cose_key_private.h"
#include "trust_anchor_hmac256_cose_key_secret.h"

#define MAX_FILE_BUFFER_SIZE (8 * 1024 * 1024)
Expand Down Expand Up @@ -45,15 +46,24 @@ int main(int argc,
mechanisms[0].cose_tag = CBOR_TAG_COSE_SIGN1;
mechanisms[0].use = false;

mechanisms[1].key.cose_algorithm_id = T_COSE_ALGORITHM_HMAC256;
result = suit_set_suit_key_from_cose_key(trust_anchor_hmac256_cose_key_secret, &mechanisms[1].key);
mechanisms[1].key.cose_algorithm_id = T_COSE_ALGORITHM_ES256;
result = suit_set_suit_key_from_cose_key(delegated_authority_es256_cose_key_private, &mechanisms[1].key);
if (result != SUIT_SUCCESS) {
printf("main : Failed to create secret key. %s(%d)\n", suit_err_to_str(result), result);
printf("main : Failed to create public key. %s(%d)\n", suit_err_to_str(result), result);
return EXIT_FAILURE;
}
mechanisms[1].cose_tag = CBOR_TAG_COSE_MAC0;
mechanisms[1].cose_tag = CBOR_TAG_COSE_SIGN1;
mechanisms[1].use = false;

mechanisms[2].key.cose_algorithm_id = T_COSE_ALGORITHM_HMAC256;
result = suit_set_suit_key_from_cose_key(trust_anchor_hmac256_cose_key_secret, &mechanisms[2].key);
if (result != SUIT_SUCCESS) {
printf("main : Failed to create secret key. %s(%d)\n", suit_err_to_str(result), result);
return EXIT_FAILURE;
}
mechanisms[2].cose_tag = CBOR_TAG_COSE_MAC0;
mechanisms[2].use = false;

// Read manifest file.
printf("main : Read Manifest file.\n");
uint8_t *manifest_buf = malloc(SUIT_MAX_DATA_SIZE);
Expand Down
97 changes: 41 additions & 56 deletions examples/suit_manifest_process_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "csuit/suit_digest.h"
#include "suit_examples_common.h"
#include "trust_anchor_prime256v1_cose_key_public.h"
#include "delegated_authority_cose_key_public.h"
#include "trust_anchor_hmac256_cose_key_secret.h"
#include "trust_anchor_a128_cose_key_secret.h"
#include "device_es256_cose_key_private.h"
Expand Down Expand Up @@ -49,23 +50,23 @@ const uint8_t depend_uri[] = {
}; // "https://example.org/8d82573a-926d-4754-9353-32dc29997f74.suit";
const uint8_t depend_suit[] = {
0xA2, 0x02, 0x58, 0x73, 0x82, 0x58, 0x24, 0x82, 0x2F, 0x58,
0x20, 0xEF, 0x53, 0xC7, 0xF7, 0x19, 0xCB, 0x10, 0x04, 0x12,
0x33, 0x85, 0x0A, 0xE3, 0x21, 0x1D, 0x62, 0xCE, 0xC9, 0x52,
0x89, 0x24, 0xE6, 0x56, 0x60, 0x76, 0x88, 0xE7, 0x7B, 0xC1,
0x48, 0x86, 0xA0, 0x58, 0x4A, 0xD2, 0x84, 0x43, 0xA1, 0x01,
0x26, 0xA0, 0xF6, 0x58, 0x40, 0x7E, 0x36, 0x7F, 0x9E, 0x12,
0x48, 0x59, 0x47, 0x3F, 0xBD, 0xF3, 0xD6, 0x31, 0x2A, 0xA8,
0x94, 0x36, 0x17, 0xB4, 0x1A, 0xE4, 0x78, 0x2F, 0xCA, 0x0E,
0x77, 0xA4, 0x92, 0xC5, 0x1F, 0x8A, 0x72, 0x52, 0xEA, 0x42,
0xC2, 0x3D, 0x72, 0x2E, 0x78, 0x7A, 0xA2, 0x35, 0xB5, 0x17,
0x5D, 0xBE, 0x61, 0xDD, 0xF8, 0xF1, 0x6F, 0x95, 0x6E, 0x03,
0x17, 0xB9, 0x55, 0x0A, 0x04, 0xBF, 0x91, 0x65, 0xDD, 0x03,
0x20, 0xB3, 0x9B, 0x52, 0xB0, 0xB7, 0x47, 0xEA, 0x79, 0x58,
0x8C, 0x19, 0x0F, 0x56, 0x7B, 0xFC, 0x2C, 0x84, 0x37, 0xBA,
0x8A, 0x73, 0xF7, 0xEA, 0x98, 0x31, 0x82, 0xE7, 0x9F, 0x01,
0x48, 0xD5, 0x9B, 0x58, 0x4A, 0xD2, 0x84, 0x43, 0xA1, 0x01,
0x26, 0xA0, 0xF6, 0x58, 0x40, 0x80, 0xE5, 0x4A, 0xB4, 0x85,
0xB3, 0x20, 0xA6, 0x16, 0x54, 0x66, 0x63, 0x62, 0x92, 0x8B,
0x15, 0xEA, 0xAA, 0xBF, 0xE6, 0x95, 0x7B, 0x1B, 0xCB, 0x65,
0xF1, 0x6A, 0x36, 0x7E, 0x4B, 0x19, 0x88, 0x8B, 0xFF, 0xDB,
0xD6, 0xF7, 0xEA, 0x28, 0x92, 0xFA, 0x36, 0xFA, 0x18, 0xA2,
0xFC, 0xB5, 0xDB, 0xFE, 0xC9, 0x83, 0x2E, 0x09, 0xB9, 0x1E,
0xD9, 0xCD, 0x34, 0x8A, 0xB7, 0x7E, 0x25, 0xFA, 0x74, 0x03,
0x59, 0x01, 0x08, 0xA6, 0x01, 0x01, 0x02, 0x03, 0x03, 0x58,
0x84, 0xA2, 0x02, 0x81, 0x84, 0x4B, 0x54, 0x45, 0x45, 0x50,
0x2D, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x48, 0x53, 0x65,
0x63, 0x75, 0x72, 0x65, 0x46, 0x53, 0x50, 0x8D, 0x82, 0x57,
0x3A, 0x92, 0x6D, 0x47, 0x54, 0x93, 0x53, 0x32, 0xDC, 0x29,
0x99, 0x7F, 0x74, 0x42, 0x74, 0x61, 0x04, 0x58, 0x54, 0x86,
0x99, 0x7F, 0x74, 0x42, 0x74, 0x61, 0x04, 0x58, 0x54, 0x86,
0x14, 0xA4, 0x01, 0x50, 0xC0, 0xDD, 0xD5, 0xF1, 0x52, 0x43,
0x56, 0x60, 0x87, 0xDB, 0x4F, 0x5B, 0x0A, 0xA2, 0x6C, 0x2F,
0x02, 0x50, 0xDB, 0x42, 0xF7, 0x09, 0x3D, 0x8C, 0x55, 0xBA,
Expand All @@ -78,7 +79,7 @@ const uint8_t depend_suit[] = {
0x2D, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x48, 0x53, 0x65,
0x63, 0x75, 0x72, 0x65, 0x46, 0x53, 0x50, 0x8D, 0x82, 0x57,
0x3A, 0x92, 0x6D, 0x47, 0x54, 0x93, 0x53, 0x32, 0xDC, 0x29,
0x99, 0x7F, 0x74, 0x44, 0x73, 0x75, 0x69, 0x74, 0x11, 0x58,
0x99, 0x7F, 0x74, 0x44, 0x73, 0x75, 0x69, 0x74, 0x14, 0x58,
0x45, 0x86, 0x14, 0xA1, 0x15, 0x78, 0x3B, 0x68, 0x74, 0x74,
0x70, 0x73, 0x3A, 0x2F, 0x2F, 0x65, 0x78, 0x61, 0x6D, 0x70,
0x6C, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x2F, 0x38, 0x64, 0x38,
Expand Down Expand Up @@ -110,55 +111,38 @@ const uint8_t dependency_uri[] = {
0x75, 0x69, 0x74
}; // "http://example.com/dependent.suit
const uint8_t dependency_data[] = {
0xD8, 0x6B, 0xA3, 0x01, 0x58, 0x9E, 0x81, 0x81, 0x58, 0x9A,
0xD2, 0x84, 0x43, 0xA1, 0x01, 0x26, 0xA0, 0x58, 0x4F, 0xA1,
0x08, 0xA1, 0x01, 0xA4, 0x01, 0x02, 0x20, 0x01, 0x21, 0x58,
0x20, 0x0E, 0x90, 0x8A, 0xA8, 0xF0, 0x66, 0xDB, 0x1F, 0x08,
0x4E, 0x0C, 0x36, 0x52, 0xC6, 0x39, 0x52, 0xBD, 0x99, 0xF2,
0xA5, 0xBD, 0xB2, 0x2F, 0x9E, 0x01, 0x36, 0x7A, 0xAD, 0x03,
0xAB, 0xA6, 0x8B, 0x22, 0x58, 0x20, 0x77, 0xDA, 0x1B, 0xD8,
0xAC, 0x4F, 0x0C, 0xB4, 0x90, 0xBA, 0x21, 0x06, 0x48, 0xBF,
0x79, 0xAB, 0x16, 0x4D, 0x49, 0xAD, 0x35, 0x51, 0xD7, 0x1D,
0x31, 0x4B, 0x27, 0x49, 0xEE, 0x42, 0xD2, 0x9A, 0x58, 0x40,
0xFB, 0x2D, 0x5A, 0xCF, 0x66, 0xB9, 0xC8, 0x57, 0x3C, 0xE9,
0x2E, 0x13, 0xBF, 0xB8, 0xD1, 0x13, 0xF7, 0x98, 0x71, 0x5C,
0xC1, 0x0B, 0x5A, 0x00, 0x10, 0xB1, 0x19, 0x25, 0xC1, 0x55,
0xE7, 0x24, 0x5A, 0x64, 0xE1, 0x31, 0x07, 0x3B, 0x87, 0xAC,
0x50, 0xCA, 0xC7, 0x16, 0x50, 0xA2, 0x13, 0x15, 0xB8, 0x2D,
0x06, 0xCA, 0x22, 0x98, 0xCD, 0x1A, 0x95, 0x51, 0x9A, 0xAE,
0x4C, 0x4B, 0x53, 0x15, 0x02, 0x58, 0x74, 0x83, 0x58, 0x24,
0x82, 0x2F, 0x58, 0x20, 0x6E, 0xA1, 0x28, 0xD7, 0xBB, 0x19,
0xB8, 0x6F, 0x77, 0xC4, 0x22, 0x7F, 0x2A, 0x29, 0xF2, 0x20,
0x26, 0xA4, 0x19, 0x58, 0xAC, 0xC4, 0x5C, 0xC0, 0xA3, 0x5B,
0xA3, 0x88, 0xB1, 0x3E, 0x2F, 0x51, 0x58, 0x4A, 0xD2, 0x84,
0x43, 0xA1, 0x01, 0x26, 0xA0, 0xF6, 0x58, 0x40, 0x99, 0xF9,
0x49, 0x04, 0x37, 0x01, 0xD7, 0xBD, 0xBA, 0x38, 0x90, 0x4A,
0x0B, 0x49, 0xF0, 0x04, 0xDE, 0xD6, 0xB6, 0x4A, 0x49, 0x00,
0xDE, 0xCA, 0x5C, 0x66, 0xAE, 0x8A, 0x9E, 0xBA, 0x91, 0x35,
0x76, 0xDE, 0xF1, 0x36, 0xB7, 0x4E, 0xA8, 0x9C, 0x14, 0xFA,
0x64, 0x62, 0x4D, 0xBD, 0x33, 0xB4, 0xC0, 0xBB, 0x41, 0xC1,
0x53, 0xCA, 0x51, 0x54, 0x8C, 0x73, 0xFF, 0x71, 0xA2, 0xBA,
0xF2, 0x74, 0x40, 0x03, 0x58, 0x42, 0xA6, 0x01, 0x01, 0x02,
0x00, 0x03, 0x47, 0xA1, 0x02, 0x81, 0x81, 0x42, 0x30, 0x30,
0x05, 0x81, 0x4E, 0x64, 0x65, 0x70, 0x65, 0x6E, 0x64, 0x65,
0x6E, 0x74, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x09, 0x4D, 0x84,
0x14, 0xA1, 0x17, 0x46, 0x63, 0x61, 0x74, 0x20, 0x30, 0x30,
0x17, 0x0F, 0x11, 0x52, 0x84, 0x14, 0xA1, 0x12, 0x4B, 0x68,
0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x77, 0x6F, 0x72, 0x6C, 0x64,
0x12, 0x0F,
}; // suit_manifest_expS1.suit
0xD8, 0x6B, 0xA2, 0x02, 0x58, 0x73, 0x82, 0x58, 0x24, 0x82,
0x2F, 0x58, 0x20, 0x0F, 0x02, 0xCA, 0xF6, 0xD3, 0xE6, 0x19,
0x20, 0xD3, 0x6B, 0xF3, 0xCE, 0xA7, 0xF8, 0x62, 0xA1, 0x3B,
0xB8, 0xFB, 0x1F, 0x09, 0xC3, 0xF4, 0xC2, 0x9B, 0x12, 0x1F,
0xEA, 0xB7, 0x8E, 0xF3, 0xD8, 0x58, 0x4A, 0xD2, 0x84, 0x43,
0xA1, 0x01, 0x26, 0xA0, 0xF6, 0x58, 0x40, 0xD0, 0x70, 0x3E,
0xA1, 0x93, 0xE1, 0x23, 0x81, 0xA6, 0x6F, 0xFA, 0xDE, 0xF2,
0xF0, 0x94, 0x97, 0x11, 0xCF, 0xE0, 0x5E, 0xD2, 0x32, 0x28,
0x18, 0xD7, 0x3D, 0x19, 0xF2, 0xBB, 0xD9, 0x1B, 0xE5, 0xC5,
0x2F, 0x16, 0x04, 0xB4, 0x5C, 0x40, 0x5E, 0x96, 0xB0, 0x64,
0x2F, 0x3D, 0x49, 0xB2, 0xD7, 0xC6, 0xE3, 0xB2, 0xC0, 0xB4,
0x00, 0x30, 0xBD, 0xDF, 0xBD, 0x27, 0xAF, 0x93, 0x0B, 0x1F,
0x8B, 0x03, 0x58, 0x42, 0xA6, 0x01, 0x01, 0x02, 0x00, 0x03,
0x47, 0xA1, 0x02, 0x81, 0x81, 0x42, 0x30, 0x30, 0x05, 0x81,
0x4E, 0x64, 0x65, 0x70, 0x65, 0x6E, 0x64, 0x65, 0x6E, 0x74,
0x2E, 0x73, 0x75, 0x69, 0x74, 0x09, 0x4D, 0x84, 0x14, 0xA1,
0x17, 0x46, 0x63, 0x61, 0x74, 0x20, 0x30, 0x30, 0x17, 0x0F,
0x14, 0x52, 0x84, 0x14, 0xA1, 0x12, 0x4B, 0x68, 0x65, 0x6C,
0x6C, 0x6F, 0x20, 0x77, 0x6F, 0x72, 0x6C, 0x64, 0x12, 0x0F
}; // suit_manifest_expS0.suit
const uint8_t encrypted_firmware_uri[] = {
0x68, 0x74, 0x74, 0x70, 0x73, 0x3A, 0x2F, 0x2F, 0x65, 0x78,
0x61, 0x6D, 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x2F,
0x65, 0x6E, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x2D,
0x66, 0x69, 0x72, 0x6D, 0x77, 0x61, 0x72, 0x65
}; // "https://example.com/encrypted-firmware"
const uint8_t encrypted_firmware_data[] = {
0x98, 0x90, 0xD8, 0xDC, 0x74, 0x0A, 0x2E, 0x82, 0xC2, 0xBE,
0xA9, 0xBA, 0xB1, 0x3E, 0x0B, 0xFA, 0x0F, 0xB4, 0xEB, 0x2B,
0xA3, 0xC0, 0xBC, 0xA4, 0xB2, 0x3A, 0x0D, 0x66, 0x0C, 0x5B,
0x30, 0x38, 0xF8, 0x63, 0x49, 0x33, 0x92, 0x1B, 0x3C, 0x2D,
0x1A, 0x84, 0xEE, 0x6C, 0x27, 0x79,
0x75, 0x8C, 0x4B, 0x7B, 0xBA, 0xE2, 0xC4, 0xC1, 0xD4, 0x62,
0x42, 0x3E, 0x0F, 0x0D, 0xC3, 0x16, 0x4F, 0xFA, 0x7B, 0x85,
0xBB, 0x94, 0xD4, 0xBD, 0x6D, 0x7E, 0xD2, 0x6A, 0xB3, 0x2F,
0xEB, 0x06, 0x33, 0x85, 0xD4, 0xD3, 0x46, 0x59, 0x27, 0xEC,
0x82, 0xCB, 0x5E, 0x19, 0x8A, 0x59
};

struct name_data {
Expand Down Expand Up @@ -508,9 +492,10 @@ int main(int argc, char *argv[])
suit_err_t result = 0;

int num_key = 0;
#define NUM_PUBLIC_KEYS_FOR_ECDH 1
#define NUM_PUBLIC_KEYS_FOR_ECDH 2
UsefulBufC public_keys_for_ecdh[NUM_PUBLIC_KEYS_FOR_ECDH] = {
trust_anchor_prime256v1_cose_key_public,
delegated_authority_es256_cose_key_public,
};
#define NUM_SECRET_KEYS_FOR_MAC 1
UsefulBufC secret_keys_for_mac[NUM_SECRET_KEYS_FOR_MAC] = {
Expand Down
Loading

0 comments on commit 3a349c4

Please sign in to comment.