diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/dice/dice.h | 12 | ||||
-rw-r--r-- | include/dice/known_test_values.h | 68 |
2 files changed, 43 insertions, 37 deletions
diff --git a/include/dice/dice.h b/include/dice/dice.h index 2e83424..cf54942 100644 --- a/include/dice/dice.h +++ b/include/dice/dice.h @@ -116,6 +116,9 @@ DiceResult DiceDeriveCdiCertificateId(void* context, // Given a full set of input values and the current CDI values, computes the // next CDI values and a matching certificate. See the Open Profile for DICE // specification for a detailed explanation of this flow. +// In certain cases, the caller may not need to generate the CDI certificate. +// The caller should signal this by setting the certificate parameters to +// null/zero values appropriately. // // Parameters: // context: Context provided by the caller that is opaque to this library @@ -129,16 +132,19 @@ DiceResult DiceDeriveCdiCertificateId(void* context, // input_values: A set of input values describing the target program or // system. // next_cdi_certificate_buffer_size: The size in bytes of the buffer pointed -// to by the |next_cdi_certificate| argument. +// to by the |next_cdi_certificate| argument. This should be set to zero +// if next CDI certificate should not be computed. // next_cdi_certificate: On success, will be populated with the generated // certificate, up to |next_cdi_certificate_buffer_size| in size. If the // certificate cannot fit in the buffer, |next_cdi_certificate_size| is // populated with the required size and kDiceResultBufferTooSmall is -// returned. +// returned. This should be set to NULL if next CDI certificate should +// not be computed. // next_cdi_certificate_actual_size: On success, will be populated with the // size, in bytes, of the certificate data written to // |next_cdi_certificate|. If kDiceResultBufferTooSmall is returned, will -// be populated with the required buffer size. +// be populated with the required buffer size. This should be set to NULL +// if next CDI certificate should not be computed. // next_cdi_attest: On success, will be populated with the next CDI value for // attestation. // next_cdi_seal: On success, will be populated with the next CDI value for diff --git a/include/dice/known_test_values.h b/include/dice/known_test_values.h index 49ddfb9..90c565a 100644 --- a/include/dice/known_test_values.h +++ b/include/dice/known_test_values.h @@ -86,10 +86,10 @@ constexpr uint8_t kExpectedCdiSeal_ZeroInput[32] = { // 209:d=2 hl=2 l= 1 prim: ENUMERATED :00 // // Signature Algorithm: ED25519 -// cd:8e:a8:d0:f5:12:b5:28:64:11:47:11:db:12:cf:b2:27:64: -// 22:8d:a3:76:27:98:32:6e:6c:5a:44:10:ef:b3:ae:39:96:04: -// 53:57:72:a6:11:2b:58:78:59:06:0b:a6:a8:23:0a:aa:20:73: -// 91:0e:fb:1a:39:c1:d1:86:41:0b +// ba:e1:ef:9f:c5:b6:88:be:4a:67:22:b4:47:44:50:25:b6:37: +// 68:8b:1a:29:27:9e:46:c6:d0:68:d8:6d:19:ed:50:55:ca:24: +// 41:71:a5:b5:37:0d:60:2b:85:08:f9:38:6c:95:c6:77:33:11: +// a2:28:a5:49:5b:87:05:e4:e8:0d constexpr uint8_t kExpectedX509Ed25519Cert_ZeroInput[635] = { 0x30, 0x82, 0x02, 0x77, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x67, 0xc2, 0x2a, 0x88, 0x59, 0x06, 0x2b, 0x98, 0x68, @@ -118,7 +118,7 @@ constexpr uint8_t kExpectedX509Ed25519Cert_ZeroInput[635] = { 0xe8, 0xe7, 0x2b, 0x0b, 0xcd, 0x9f, 0x59, 0x34, 0x9c, 0x89, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x02, 0x04, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, - 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0x01, 0x30, 0x81, 0xe3, 0x06, 0x0a, + 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x81, 0xe3, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xd6, 0x79, 0x02, 0x01, 0x18, 0x04, 0x81, 0xd4, 0x30, 0x81, 0xd1, 0xa0, 0x42, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -138,12 +138,12 @@ constexpr uint8_t kExpectedX509Ed25519Cert_ZeroInput[635] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x03, 0x0a, 0x01, 0x00, 0x30, 0x05, 0x06, - 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0xcd, 0x8e, 0xa8, 0xd0, 0xf5, - 0x12, 0xb5, 0x28, 0x64, 0x11, 0x47, 0x11, 0xdb, 0x12, 0xcf, 0xb2, 0x27, - 0x64, 0x22, 0x8d, 0xa3, 0x76, 0x27, 0x98, 0x32, 0x6e, 0x6c, 0x5a, 0x44, - 0x10, 0xef, 0xb3, 0xae, 0x39, 0x96, 0x04, 0x53, 0x57, 0x72, 0xa6, 0x11, - 0x2b, 0x58, 0x78, 0x59, 0x06, 0x0b, 0xa6, 0xa8, 0x23, 0x0a, 0xaa, 0x20, - 0x73, 0x91, 0x0e, 0xfb, 0x1a, 0x39, 0xc1, 0xd1, 0x86, 0x41, 0x0b}; + 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0xba, 0xe1, 0xef, 0x9f, 0xc5, + 0xb6, 0x88, 0xbe, 0x4a, 0x67, 0x22, 0xb4, 0x47, 0x44, 0x50, 0x25, 0xb6, + 0x37, 0x68, 0x8b, 0x1a, 0x29, 0x27, 0x9e, 0x46, 0xc6, 0xd0, 0x68, 0xd8, + 0x6d, 0x19, 0xed, 0x50, 0x55, 0xca, 0x24, 0x41, 0x71, 0xa5, 0xb5, 0x37, + 0x0d, 0x60, 0x2b, 0x85, 0x08, 0xf9, 0x38, 0x6c, 0x95, 0xc6, 0x77, 0x33, + 0x11, 0xa2, 0x28, 0xa5, 0x49, 0x5b, 0x87, 0x05, 0xe4, 0xe8, 0x0d}; // $ openssl x509 -inform DER -noout -text -certopt ext_parse // Certificate: @@ -371,10 +371,10 @@ constexpr uint8_t kExpectedCdiSeal_HashOnlyInput[32] = { // 209:d=2 hl=2 l= 1 prim: ENUMERATED :00 // // Signature Algorithm: ED25519 -// 48:f5:68:52:d1:f3:1e:06:73:99:a4:77:be:33:61:df:5f:ce: -// 3f:4f:fb:23:55:f4:94:d9:d1:d0:19:2a:01:b1:21:6b:d2:b8: -// c6:93:d8:c1:a8:c2:84:88:7a:3c:38:60:3b:20:26:8c:b5:56: -// 5f:09:a4:f4:49:9b:bb:c6:3c:09 +// 2d:26:2d:e5:ad:8f:4a:d2:78:e3:38:fe:bc:4f:60:67:d8:c3: +// 20:4b:f1:19:e1:e7:48:c5:9f:51:01:57:62:f1:0d:75:d2:6d: +// d0:1b:0b:a4:32:f6:55:5a:55:b0:86:c0:e9:f9:6a:35:7c:5e: +// 40:68:5f:05:ef:f6:52:a7:4c:05 constexpr uint8_t kExpectedX509Ed25519Cert_HashOnlyInput[635] = { 0x30, 0x82, 0x02, 0x77, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x0d, 0x04, 0x0e, 0x2f, 0x46, 0x00, 0x52, 0xa5, 0x31, @@ -403,7 +403,7 @@ constexpr uint8_t kExpectedX509Ed25519Cert_HashOnlyInput[635] = { 0x1b, 0x91, 0xdb, 0xf9, 0xb4, 0x40, 0x83, 0x32, 0xec, 0x29, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x02, 0x04, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, - 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0x01, 0x30, 0x81, 0xe3, 0x06, 0x0a, + 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x81, 0xe3, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xd6, 0x79, 0x02, 0x01, 0x18, 0x04, 0x81, 0xd4, 0x30, 0x81, 0xd1, 0xa0, 0x42, 0x04, 0x40, 0xb7, 0xd4, 0x0c, 0xcb, 0x22, 0x5b, 0xa5, 0x78, 0x8f, 0x98, 0xff, 0x9e, 0x86, 0x93, 0x75, 0xf6, @@ -423,12 +423,12 @@ constexpr uint8_t kExpectedX509Ed25519Cert_HashOnlyInput[635] = { 0xd4, 0xfe, 0x92, 0x5f, 0x36, 0x2d, 0xeb, 0x5d, 0xbb, 0x32, 0x8b, 0xe3, 0x94, 0x4f, 0xbe, 0x1b, 0x21, 0xf9, 0xcc, 0x23, 0x73, 0x41, 0xb6, 0xb9, 0xb6, 0x98, 0xd0, 0xbc, 0xa6, 0x03, 0x0a, 0x01, 0x00, 0x30, 0x05, 0x06, - 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0x48, 0xf5, 0x68, 0x52, 0xd1, - 0xf3, 0x1e, 0x06, 0x73, 0x99, 0xa4, 0x77, 0xbe, 0x33, 0x61, 0xdf, 0x5f, - 0xce, 0x3f, 0x4f, 0xfb, 0x23, 0x55, 0xf4, 0x94, 0xd9, 0xd1, 0xd0, 0x19, - 0x2a, 0x01, 0xb1, 0x21, 0x6b, 0xd2, 0xb8, 0xc6, 0x93, 0xd8, 0xc1, 0xa8, - 0xc2, 0x84, 0x88, 0x7a, 0x3c, 0x38, 0x60, 0x3b, 0x20, 0x26, 0x8c, 0xb5, - 0x56, 0x5f, 0x09, 0xa4, 0xf4, 0x49, 0x9b, 0xbb, 0xc6, 0x3c, 0x09}; + 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0x2d, 0x26, 0x2d, 0xe5, 0xad, + 0x8f, 0x4a, 0xd2, 0x78, 0xe3, 0x38, 0xfe, 0xbc, 0x4f, 0x60, 0x67, 0xd8, + 0xc3, 0x20, 0x4b, 0xf1, 0x19, 0xe1, 0xe7, 0x48, 0xc5, 0x9f, 0x51, 0x01, + 0x57, 0x62, 0xf1, 0x0d, 0x75, 0xd2, 0x6d, 0xd0, 0x1b, 0x0b, 0xa4, 0x32, + 0xf6, 0x55, 0x5a, 0x55, 0xb0, 0x86, 0xc0, 0xe9, 0xf9, 0x6a, 0x35, 0x7c, + 0x5e, 0x40, 0x68, 0x5f, 0x05, 0xef, 0xf6, 0x52, 0xa7, 0x4c, 0x05}; // $ openssl x509 -inform DER -noout -text -certopt ext_parse // Certificate: @@ -677,10 +677,10 @@ constexpr uint8_t kExpectedCdiSeal_DescriptorInput[32] = { // 427:d=2 hl=2 l= 1 prim: ENUMERATED :00 // // Signature Algorithm: ED25519 -// ce:e6:a6:f7:5a:09:2e:a9:f1:27:73:46:61:21:5a:f7:15:c4: -// a5:31:43:37:b5:2f:3d:c8:61:f1:d2:65:56:84:81:e2:c5:c4: -// a0:87:55:d0:55:15:ce:14:d5:8e:94:5a:f9:b7:0e:09:91:3b: -// 25:75:e2:ea:cb:7d:37:72:54:0f +// 70:3c:ba:64:6b:18:2b:3f:26:b3:67:52:3b:3d:08:f5:88:3d: +// fe:79:d4:b4:e5:70:71:1d:95:f6:9a:ac:ca:f7:23:8b:fd:e2: +// 22:5b:3b:39:82:99:02:e8:db:67:70:f2:99:9d:f7:3b:73:12: +// 6a:b0:a0:ac:49:4b:37:06:21:06 constexpr uint8_t kExpectedX509Ed25519Cert_DescriptorInput[855] = { 0x30, 0x82, 0x03, 0x53, 0x30, 0x82, 0x03, 0x05, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x52, 0x1f, 0x03, 0x5c, 0x21, 0xe3, 0x2f, 0x16, 0x74, @@ -709,7 +709,7 @@ constexpr uint8_t kExpectedX509Ed25519Cert_DescriptorInput[855] = { 0x1e, 0xae, 0x6b, 0xde, 0xd9, 0x3c, 0xe3, 0x21, 0xe0, 0xdf, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x02, 0x04, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, - 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0x01, 0x30, 0x82, 0x01, 0xbe, 0x06, + 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x82, 0x01, 0xbe, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xd6, 0x79, 0x02, 0x01, 0x18, 0x04, 0x82, 0x01, 0xae, 0x30, 0x82, 0x01, 0xaa, 0xa0, 0x42, 0x04, 0x40, 0xb7, 0xd4, 0x0c, 0xcb, 0x22, 0x5b, 0xa5, 0x78, 0x8f, 0x98, 0xff, 0x9e, 0x86, @@ -747,13 +747,13 @@ constexpr uint8_t kExpectedX509Ed25519Cert_DescriptorInput[855] = { 0xe7, 0x1c, 0x16, 0x62, 0xd5, 0x59, 0xd7, 0x49, 0x2b, 0x6a, 0xa2, 0x36, 0x67, 0x57, 0xd1, 0xf2, 0xf9, 0xaf, 0x13, 0xd7, 0xa3, 0xe4, 0xd3, 0x39, 0x5b, 0x02, 0x78, 0xb1, 0xe0, 0x09, 0x70, 0xa2, 0xa6, 0x03, 0x0a, 0x01, - 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0xce, - 0xe6, 0xa6, 0xf7, 0x5a, 0x09, 0x2e, 0xa9, 0xf1, 0x27, 0x73, 0x46, 0x61, - 0x21, 0x5a, 0xf7, 0x15, 0xc4, 0xa5, 0x31, 0x43, 0x37, 0xb5, 0x2f, 0x3d, - 0xc8, 0x61, 0xf1, 0xd2, 0x65, 0x56, 0x84, 0x81, 0xe2, 0xc5, 0xc4, 0xa0, - 0x87, 0x55, 0xd0, 0x55, 0x15, 0xce, 0x14, 0xd5, 0x8e, 0x94, 0x5a, 0xf9, - 0xb7, 0x0e, 0x09, 0x91, 0x3b, 0x25, 0x75, 0xe2, 0xea, 0xcb, 0x7d, 0x37, - 0x72, 0x54, 0x0f}; + 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0x70, + 0x3c, 0xba, 0x64, 0x6b, 0x18, 0x2b, 0x3f, 0x26, 0xb3, 0x67, 0x52, 0x3b, + 0x3d, 0x08, 0xf5, 0x88, 0x3d, 0xfe, 0x79, 0xd4, 0xb4, 0xe5, 0x70, 0x71, + 0x1d, 0x95, 0xf6, 0x9a, 0xac, 0xca, 0xf7, 0x23, 0x8b, 0xfd, 0xe2, 0x22, + 0x5b, 0x3b, 0x39, 0x82, 0x99, 0x02, 0xe8, 0xdb, 0x67, 0x70, 0xf2, 0x99, + 0x9d, 0xf7, 0x3b, 0x73, 0x12, 0x6a, 0xb0, 0xa0, 0xac, 0x49, 0x4b, 0x37, + 0x06, 0x21, 0x06}; // $ openssl x509 -inform DER -noout -text -certopt ext_parse // Certificate: |