Enforced strongSwan coding rules (tab, if, {)

This commit is contained in:
Sansar Choinyambuu
2011-09-08 12:08:16 +02:00
committed by Andreas Steffen
parent 0f36d4815e
commit 05a1b347b2
33 changed files with 481 additions and 449 deletions
@@ -209,7 +209,7 @@ imv_state_t *imv_attestation_state_create(TNC_ConnectionID connection_id)
); );
platform_info = lib->settings->get_str(lib->settings, platform_info = lib->settings->get_str(lib->settings,
"libimcv.plugins.imv-attestation.platform_info", NULL); "libimcv.plugins.imv-attestation.platform_info", NULL);
if (platform_info) if (platform_info)
{ {
this->pts->set_platform_info(this->pts, platform_info); this->pts->set_platform_info(this->pts, platform_info);
+66 -66
View File
@@ -26,137 +26,137 @@
char fakeEKCert[0x41a] = { char fakeEKCert[0x41a] = {
/* 00000000 */ 0x30, 0x82, 0x04, 0x16, 0x30, 0x82, 0x02, 0xfe, /* 00000000 */ 0x30, 0x82, 0x04, 0x16, 0x30, 0x82, 0x02, 0xfe,
0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x40, /* |0...0..........@| */ 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x40, /* |0...0..........@| */
/* 00000010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, /* |...............0| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, /* |...............0| */
/* 00000020 */ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, /* 00000020 */ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3e, /* |...*.H........0>| */ 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3e, /* |...*.H........0>| */
/* 00000030 */ 0x31, 0x3c, 0x30, 0x3a, 0x06, 0x03, 0x55, 0x04, /* 00000030 */ 0x31, 0x3c, 0x30, 0x3a, 0x06, 0x03, 0x55, 0x04,
0x03, 0x13, 0x33, 0x49, 0x6e, 0x73, 0x65, 0x63, /* |1<0:..U...3Insec| */ 0x03, 0x13, 0x33, 0x49, 0x6e, 0x73, 0x65, 0x63, /* |1<0:..U...3Insec| */
/* 00000040 */ 0x75, 0x72, 0x65, 0x20, 0x44, 0x65, 0x6d, 0x6f, /* 00000040 */ 0x75, 0x72, 0x65, 0x20, 0x44, 0x65, 0x6d, 0x6f,
0x2f, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x6e, /* |ure Demo/Test En| */ 0x2f, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x6e, /* |ure Demo/Test En| */
/* 00000050 */ 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, /* 00000050 */ 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e,
0x74, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x52, 0x6f, /* |dorsement Key Ro| */ 0x74, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x52, 0x6f, /* |dorsement Key Ro| */
/* 00000060 */ 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, /* 00000060 */ 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69,
0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x30, 0x1e, /* |ot Certificate0.| */ 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x30, 0x1e, /* |ot Certificate0.| */
/* 00000070 */ 0x17, 0x0d, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, /* 00000070 */ 0x17, 0x0d, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, /* |..010101000000Z.| */ 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, /* |..010101000000Z.| */
/* 00000080 */ 0x0d, 0x34, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, /* 00000080 */ 0x0d, 0x34, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32,
0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x00, /* |.491231235959Z0.| */ 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x00, /* |.491231235959Z0.| */
/* 00000090 */ 0x30, 0x82, 0x01, 0x37, 0x30, 0x22, 0x06, 0x09, /* 00000090 */ 0x30, 0x82, 0x01, 0x37, 0x30, 0x22, 0x06, 0x09,
0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, /* |0..70"..*.H.....| */ 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, /* |0..70"..*.H.....| */
/* 000000a0 */ 0x07, 0x30, 0x15, 0xa2, 0x13, 0x30, 0x11, 0x06, /* 000000a0 */ 0x07, 0x30, 0x15, 0xa2, 0x13, 0x30, 0x11, 0x06,
0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, /* |.0...0...*.H....| */ 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, /* |.0...0...*.H....| */
/* 000000b0 */ 0x01, 0x09, 0x04, 0x04, 0x54, 0x43, 0x50, 0x41, /* 000000b0 */ 0x01, 0x09, 0x04, 0x04, 0x54, 0x43, 0x50, 0x41,
0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, /* |....TCPA.....0..| */ 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, /* |....TCPA.....0..| */
/* 000000c0 */ 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0x80, 0x00, /* 000000c0 */ 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000000d0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000000d0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000000e0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000000e0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000000f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000000f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000100 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000100 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000110 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000110 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000120 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000120 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000130 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000130 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000140 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000140 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000150 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000150 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000170 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000170 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000180 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000180 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000190 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000190 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000001a0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000001a0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000001b0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000001b0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000001c0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, /* 000001c0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x37, 0x30, /* |..............70| */ 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x37, 0x30, /* |..............70| */
/* 000001d0 */ 0x82, 0x01, 0x33, 0x30, 0x37, 0x06, 0x03, 0x55, /* 000001d0 */ 0x82, 0x01, 0x33, 0x30, 0x37, 0x06, 0x03, 0x55,
0x1d, 0x09, 0x04, 0x30, 0x30, 0x2e, 0x30, 0x16, /* |..307..U...00.0.| */ 0x1d, 0x09, 0x04, 0x30, 0x30, 0x2e, 0x30, 0x16, /* |..307..U...00.0.| */
/* 000001e0 */ 0x06, 0x05, 0x67, 0x81, 0x05, 0x02, 0x10, 0x31, /* 000001e0 */ 0x06, 0x05, 0x67, 0x81, 0x05, 0x02, 0x10, 0x31,
0x0d, 0x30, 0x0b, 0x0c, 0x03, 0x31, 0x2e, 0x31, /* |..g....1.0...1.1| */ 0x0d, 0x30, 0x0b, 0x0c, 0x03, 0x31, 0x2e, 0x31, /* |..g....1.0...1.1| */
/* 000001f0 */ 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x14, /* 000001f0 */ 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x14,
0x06, 0x05, 0x67, 0x81, 0x05, 0x02, 0x12, 0x31, /* |......0...g....1| */ 0x06, 0x05, 0x67, 0x81, 0x05, 0x02, 0x12, 0x31, /* |......0...g....1| */
/* 00000200 */ 0x0b, 0x30, 0x09, 0x80, 0x01, 0x00, 0x81, 0x01, /* 00000200 */ 0x0b, 0x30, 0x09, 0x80, 0x01, 0x00, 0x81, 0x01,
0x00, 0x82, 0x01, 0x02, 0x30, 0x50, 0x06, 0x03, /* |.0..........0P..| */ 0x00, 0x82, 0x01, 0x02, 0x30, 0x50, 0x06, 0x03, /* |.0..........0P..| */
/* 00000210 */ 0x55, 0x1d, 0x11, 0x01, 0x01, 0xff, 0x04, 0x46, /* 00000210 */ 0x55, 0x1d, 0x11, 0x01, 0x01, 0xff, 0x04, 0x46,
0x30, 0x44, 0xa4, 0x42, 0x30, 0x40, 0x31, 0x16, /* |U......F0D.B0@1.| */ 0x30, 0x44, 0xa4, 0x42, 0x30, 0x40, 0x31, 0x16, /* |U......F0D.B0@1.| */
/* 00000220 */ 0x30, 0x14, 0x06, 0x05, 0x67, 0x81, 0x05, 0x02, /* 00000220 */ 0x30, 0x14, 0x06, 0x05, 0x67, 0x81, 0x05, 0x02,
0x01, 0x0c, 0x0b, 0x69, 0x64, 0x3a, 0x30, 0x30, /* |0...g......id:00| */ 0x01, 0x0c, 0x0b, 0x69, 0x64, 0x3a, 0x30, 0x30, /* |0...g......id:00| */
/* 00000230 */ 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12, /* 00000230 */ 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x12,
0x30, 0x10, 0x06, 0x05, 0x67, 0x81, 0x05, 0x02, /* |0000001.0...g...| */ 0x30, 0x10, 0x06, 0x05, 0x67, 0x81, 0x05, 0x02, /* |0000001.0...g...| */
/* 00000240 */ 0x02, 0x0c, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, /* 00000240 */ 0x02, 0x0c, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f,
0x77, 0x6e, 0x31, 0x12, 0x30, 0x10, 0x06, 0x05, /* |...Unknown1.0...| */ 0x77, 0x6e, 0x31, 0x12, 0x30, 0x10, 0x06, 0x05, /* |...Unknown1.0...| */
/* 00000250 */ 0x67, 0x81, 0x05, 0x02, 0x03, 0x0c, 0x07, 0x69, /* 00000250 */ 0x67, 0x81, 0x05, 0x02, 0x03, 0x0c, 0x07, 0x69,
0x64, 0x3a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x0c, /* |g......id:00000.| */ 0x64, 0x3a, 0x30, 0x30, 0x30, 0x30, 0x30, 0x0c, /* |g......id:00000.| */
/* 00000260 */ 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, /* 00000260 */ 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff,
0x04, 0x02, 0x30, 0x00, 0x30, 0x75, 0x06, 0x03, /* |..U.......0.0u..| */ 0x04, 0x02, 0x30, 0x00, 0x30, 0x75, 0x06, 0x03, /* |..U.......0.0u..| */
/* 00000270 */ 0x55, 0x1d, 0x20, 0x01, 0x01, 0xff, 0x04, 0x6b, /* 00000270 */ 0x55, 0x1d, 0x20, 0x01, 0x01, 0xff, 0x04, 0x6b,
0x30, 0x69, 0x30, 0x67, 0x06, 0x04, 0x55, 0x1d, /* |U. ....k0i0g..U.| */ 0x30, 0x69, 0x30, 0x67, 0x06, 0x04, 0x55, 0x1d, /* |U. ....k0i0g..U.| */
/* 00000280 */ 0x20, 0x00, 0x30, 0x5f, 0x30, 0x25, 0x06, 0x08, /* 00000280 */ 0x20, 0x00, 0x30, 0x5f, 0x30, 0x25, 0x06, 0x08,
0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, /* | .0_0%..+.......| */ 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, /* | .0_0%..+.......| */
/* 00000290 */ 0x16, 0x19, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, /* 00000290 */ 0x16, 0x19, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
0x2f, 0x77, 0x77, 0x77, 0x2e, 0x70, 0x72, 0x69, /* |..http://www.pri| */ 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x70, 0x72, 0x69, /* |..http://www.pri| */
/* 000002a0 */ 0x76, 0x61, 0x63, 0x79, 0x63, 0x61, 0x2e, 0x63, /* 000002a0 */ 0x76, 0x61, 0x63, 0x79, 0x63, 0x61, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x30, 0x36, 0x06, 0x08, 0x2b, /* |vacyca.com/06..+| */ 0x6f, 0x6d, 0x2f, 0x30, 0x36, 0x06, 0x08, 0x2b, /* |vacyca.com/06..+| */
/* 000002b0 */ 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x02, 0x30, /* 000002b0 */ 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x02, 0x30,
0x2a, 0x0c, 0x28, 0x54, 0x43, 0x50, 0x41, 0x20, /* |.......0*.(TCPA | */ 0x2a, 0x0c, 0x28, 0x54, 0x43, 0x50, 0x41, 0x20, /* |.......0*.(TCPA | */
/* 000002c0 */ 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, /* 000002c0 */ 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20,
0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, /* |Trusted Platform| */ 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, /* |Trusted Platform| */
/* 000002d0 */ 0x20, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, /* 000002d0 */ 0x20, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20,
0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, /* | Module Endorsem| */ 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, /* | Module Endorsem| */
/* 000002e0 */ 0x65, 0x6e, 0x74, 0x30, 0x21, 0x06, 0x03, 0x55, /* 000002e0 */ 0x65, 0x6e, 0x74, 0x30, 0x21, 0x06, 0x03, 0x55,
0x1d, 0x23, 0x04, 0x1a, 0x30, 0x18, 0x80, 0x16, /* |ent0!..U.#..0...| */ 0x1d, 0x23, 0x04, 0x1a, 0x30, 0x18, 0x80, 0x16, /* |ent0!..U.#..0...| */
/* 000002f0 */ 0x04, 0x14, 0x34, 0xa8, 0x8c, 0x24, 0x7a, 0x97, /* 000002f0 */ 0x04, 0x14, 0x34, 0xa8, 0x8c, 0x24, 0x7a, 0x97,
0xf8, 0xcc, 0xc7, 0x56, 0x6d, 0xfb, 0x44, 0xa8, /* |..4..$z....Vm.D.| */ 0xf8, 0xcc, 0xc7, 0x56, 0x6d, 0xfb, 0x44, 0xa8, /* |..4..$z....Vm.D.| */
/* 00000300 */ 0xd4, 0x41, 0xaa, 0x5f, 0x4f, 0x1d, 0x30, 0x0d, /* 00000300 */ 0xd4, 0x41, 0xaa, 0x5f, 0x4f, 0x1d, 0x30, 0x0d,
0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, /* |.A._O.0...*.H...| */ 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, /* |.A._O.0...*.H...| */
/* 00000310 */ 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, /* 00000310 */ 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01,
0x01, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x01, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000320 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000320 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000330 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000330 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000340 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000340 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000350 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000350 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000360 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000360 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000370 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000370 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000380 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000380 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000390 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000390 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000003a0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000003a0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000003b0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000003b0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000003c0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000003c0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000003d0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000003d0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000003e0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000003e0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 000003f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 000003f0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000400 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000400 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* |................| */
/* 00000410 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00000410 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01 /* |..........| */ 0x00, 0x01 /* |..........| */
}; };
#endif /** PTS_FAKE_EK_CERT_H_ @}*/ #endif /** PTS_FAKE_EK_CERT_H_ @}*/
+126 -100
View File
@@ -92,37 +92,37 @@ struct private_pts_t {
}; };
METHOD(pts_t, get_proto_caps, pts_proto_caps_flag_t, METHOD(pts_t, get_proto_caps, pts_proto_caps_flag_t,
private_pts_t *this) private_pts_t *this)
{ {
return this->proto_caps; return this->proto_caps;
} }
METHOD(pts_t, set_proto_caps, void, METHOD(pts_t, set_proto_caps, void,
private_pts_t *this, pts_proto_caps_flag_t flags) private_pts_t *this, pts_proto_caps_flag_t flags)
{ {
this->proto_caps = flags; this->proto_caps = flags;
DBG2(DBG_TNC, "supported PTS protocol capabilities: %s%s%s%s%s", DBG2(DBG_TNC, "supported PTS protocol capabilities: %s%s%s%s%s",
flags & PTS_PROTO_CAPS_C ? "C" : ".", flags & PTS_PROTO_CAPS_C ? "C" : ".",
flags & PTS_PROTO_CAPS_V ? "V" : ".", flags & PTS_PROTO_CAPS_V ? "V" : ".",
flags & PTS_PROTO_CAPS_D ? "D" : ".", flags & PTS_PROTO_CAPS_D ? "D" : ".",
flags & PTS_PROTO_CAPS_T ? "T" : ".", flags & PTS_PROTO_CAPS_T ? "T" : ".",
flags & PTS_PROTO_CAPS_X ? "X" : "."); flags & PTS_PROTO_CAPS_X ? "X" : ".");
} }
METHOD(pts_t, get_meas_algorithm, pts_meas_algorithms_t, METHOD(pts_t, get_meas_algorithm, pts_meas_algorithms_t,
private_pts_t *this) private_pts_t *this)
{ {
return this->algorithm; return this->algorithm;
} }
METHOD(pts_t, set_meas_algorithm, void, METHOD(pts_t, set_meas_algorithm, void,
private_pts_t *this, pts_meas_algorithms_t algorithm) private_pts_t *this, pts_meas_algorithms_t algorithm)
{ {
hash_algorithm_t hash_alg; hash_algorithm_t hash_alg;
hash_alg = pts_meas_to_hash_algorithm(algorithm); hash_alg = pts_meas_to_hash_algorithm(algorithm);
DBG2(DBG_TNC, "selected PTS measurement algorithm is %N", DBG2(DBG_TNC, "selected PTS measurement algorithm is %N",
hash_algorithm_names, hash_alg); hash_algorithm_names, hash_alg);
if (hash_alg != HASH_UNKNOWN) if (hash_alg != HASH_UNKNOWN)
{ {
this->algorithm = algorithm; this->algorithm = algorithm;
@@ -139,7 +139,7 @@ static void print_tpm_version_info(private_pts_t *this)
TSS_RESULT result; TSS_RESULT result;
result = Trspi_UnloadBlob_CAP_VERSION_INFO(&offset, result = Trspi_UnloadBlob_CAP_VERSION_INFO(&offset,
this->tpm_version_info.ptr, &versionInfo); this->tpm_version_info.ptr, &versionInfo);
if (result != TSS_SUCCESS) if (result != TSS_SUCCESS)
{ {
DBG1(DBG_TNC, "could not parse tpm version info: tss error 0x%x", DBG1(DBG_TNC, "could not parse tpm version info: tss error 0x%x",
@@ -148,29 +148,29 @@ static void print_tpm_version_info(private_pts_t *this)
else else
{ {
DBG2(DBG_TNC, "TPM 1.2 Version Info: Chip Version: %hhu.%hhu.%hhu.%hhu," DBG2(DBG_TNC, "TPM 1.2 Version Info: Chip Version: %hhu.%hhu.%hhu.%hhu,"
" Spec Level: %hu, Errata Rev: %hhu, Vendor ID: %.4s", " Spec Level: %hu, Errata Rev: %hhu, Vendor ID: %.4s",
versionInfo.version.major, versionInfo.version.minor, versionInfo.version.major, versionInfo.version.minor,
versionInfo.version.revMajor, versionInfo.version.revMinor, versionInfo.version.revMajor, versionInfo.version.revMinor,
versionInfo.specLevel, versionInfo.errataRev, versionInfo.specLevel, versionInfo.errataRev,
versionInfo.tpmVendorID); versionInfo.tpmVendorID);
} }
} }
METHOD(pts_t, get_platform_info, char*, METHOD(pts_t, get_platform_info, char*,
private_pts_t *this) private_pts_t *this)
{ {
return this->platform_info; return this->platform_info;
} }
METHOD(pts_t, set_platform_info, void, METHOD(pts_t, set_platform_info, void,
private_pts_t *this, char *info) private_pts_t *this, char *info)
{ {
free(this->platform_info); free(this->platform_info);
this->platform_info = strdup(info); this->platform_info = strdup(info);
} }
METHOD(pts_t, get_tpm_version_info, bool, METHOD(pts_t, get_tpm_version_info, bool,
private_pts_t *this, chunk_t *info) private_pts_t *this, chunk_t *info)
{ {
if (!this->has_tpm) if (!this->has_tpm)
{ {
@@ -182,7 +182,7 @@ METHOD(pts_t, get_tpm_version_info, bool,
} }
METHOD(pts_t, set_tpm_version_info, void, METHOD(pts_t, set_tpm_version_info, void,
private_pts_t *this, chunk_t info) private_pts_t *this, chunk_t info)
{ {
this->tpm_version_info = chunk_clone(info); this->tpm_version_info = chunk_clone(info);
print_tpm_version_info(this); print_tpm_version_info(this);
@@ -206,24 +206,25 @@ static TSS_RESULT makeEKCert(TSS_HCONTEXT hContext, TSS_HTPM hTPM, UINT32 *pCert
return result; return result;
} }
result = Tspi_GetAttribData (hPubek, TSS_TSPATTRIB_RSAKEY_INFO, result = Tspi_GetAttribData (hPubek, TSS_TSPATTRIB_RSAKEY_INFO,
TSS_TSPATTRIB_KEYINFO_RSA_MODULUS, &modulusLen, &modulus); TSS_TSPATTRIB_KEYINFO_RSA_MODULUS, &modulusLen, &modulus);
Tspi_Context_CloseObject (hContext, hPubek); Tspi_Context_CloseObject (hContext, hPubek);
if (result != TSS_SUCCESS) if (result != TSS_SUCCESS)
{ {
DBG1(DBG_IMC, "Error in: Tspi_Context_CloseObject"); DBG1(DBG_IMC, "Error in: Tspi_Context_CloseObject");
return result; return result;
} }
if (modulusLen != 256) { if (modulusLen != 256)
{
DBG1(DBG_IMC, "Tspi_GetAttribData modulusLen != 256"); DBG1(DBG_IMC, "Tspi_GetAttribData modulusLen != 256");
Tspi_Context_FreeMemory (hContext, modulus); Tspi_Context_FreeMemory (hContext, modulus);
return result; return result;
} }
/* TODO define fakeEKCert /* TODO define fakeEKCert
*pCertLen = sizeof(fakeEKCert); * pCertLen = sizeof(fakeEKCert);
*pCert = malloc (*pCertLen); *pCert = malloc (*pCertLen);
memcpy (*pCert, fakeEKCert, *pCertLen); memcpy (*pCert, fakeEKCert, *pCertLen);
memcpy (*pCert + 0xc6, modulus, modulusLen); memcpy (*pCert + 0xc6, modulus, modulusLen);
*/ */
Tspi_Context_FreeMemory (hContext, modulus); Tspi_Context_FreeMemory (hContext, modulus);
return TSS_SUCCESS; return TSS_SUCCESS;
@@ -247,7 +248,8 @@ static X509* readPCAcert (int level)
curl_easy_setopt (hCurl, CURLOPT_URL, url); curl_easy_setopt (hCurl, CURLOPT_URL, url);
curl_easy_setopt(hCurl, CURLOPT_WRITEDATA, (BYTE **)f_tmp); curl_easy_setopt(hCurl, CURLOPT_WRITEDATA, (BYTE **)f_tmp);
if ((result = curl_easy_perform(hCurl))) { if ((result = curl_easy_perform(hCurl)))
{
DBG1(DBG_IMC, "Unable to connect to Privacy CA, curl library result code %d", result); DBG1(DBG_IMC, "Unable to connect to Privacy CA, curl library result code %d", result);
fclose(f_tmp); fclose(f_tmp);
return NULL; return NULL;
@@ -287,7 +289,7 @@ static bool obtain_aik(private_pts_t *this)
BYTE *rgbTCPAIdentityReq; BYTE *rgbTCPAIdentityReq;
UINT32 ulTCPAIdentityReqLength; UINT32 ulTCPAIdentityReqLength;
UINT32 initFlags = TSS_KEY_TYPE_IDENTITY | TSS_KEY_SIZE_2048 | UINT32 initFlags = TSS_KEY_TYPE_IDENTITY | TSS_KEY_SIZE_2048 |
TSS_KEY_VOLATILE | TSS_KEY_NOT_MIGRATABLE; TSS_KEY_VOLATILE | TSS_KEY_NOT_MIGRATABLE;
BYTE asymBuf[EKSIZE]; BYTE asymBuf[EKSIZE];
BYTE *symBuf; BYTE *symBuf;
BYTE *credBuf; BYTE *credBuf;
@@ -309,110 +311,127 @@ static bool obtain_aik(private_pts_t *this)
DBG3(DBG_IMC, "Retrieving PCA certificate..."); DBG3(DBG_IMC, "Retrieving PCA certificate...");
/* TPM has EK Certificate */ /* TPM has EK Certificate */
if(REALEK) if (REALEK)
{ {
level = 1; level = 1;
} }
x509 = readPCAcert (level); x509 = readPCAcert (level);
if (x509 == NULL) { if (x509 == NULL)
{
DBG1(DBG_IMC, "Error reading PCA key"); DBG1(DBG_IMC, "Error reading PCA key");
goto err; goto err;
} }
pcaKey = X509_get_pubkey(x509); pcaKey = X509_get_pubkey(x509);
rsa = EVP_PKEY_get1_RSA(pcaKey); rsa = EVP_PKEY_get1_RSA(pcaKey);
if (rsa == NULL) { if (rsa == NULL)
{
DBG1(DBG_IMC, "Error reading RSA key from PCA"); DBG1(DBG_IMC, "Error reading RSA key from PCA");
goto err; goto err;
} }
X509_free (x509); X509_free (x509);
result = Tspi_Context_Create(&hContext); result = Tspi_Context_Create(&hContext);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_Create", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_Create", result);
goto err; goto err;
} }
result = Tspi_Context_Connect(hContext, NULL); result = Tspi_Context_Connect(hContext, NULL);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_Connect", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_Connect", result);
goto err; goto err;
} }
result = Tspi_Context_GetTpmObject (hContext, &hTPM); result = Tspi_Context_GetTpmObject (hContext, &hTPM);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_GetTpmObject", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_GetTpmObject", result);
goto err; goto err;
} }
result = Tspi_Context_LoadKeyByUUID(hContext, result = Tspi_Context_LoadKeyByUUID(hContext,
TSS_PS_TYPE_SYSTEM, SRK_UUID, &hSRK); TSS_PS_TYPE_SYSTEM, SRK_UUID, &hSRK);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_LoadKeyByUUID for SRK", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_LoadKeyByUUID for SRK", result);
goto err; goto err;
} }
result = Tspi_GetPolicyObject(hSRK, TSS_POLICY_USAGE, &hSrkPolicy); result = Tspi_GetPolicyObject(hSRK, TSS_POLICY_USAGE, &hSrkPolicy);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_GetPolicyObject for SRK", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_GetPolicyObject for SRK", result);
goto err; goto err;
} }
result = Tspi_Policy_SetSecret(hSrkPolicy, TSS_SECRET_MODE_SHA1, 20, secret); result = Tspi_Policy_SetSecret(hSrkPolicy, TSS_SECRET_MODE_SHA1, 20, secret);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_Policy_SetSecret for SRK", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_Policy_SetSecret for SRK", result);
goto err; goto err;
} }
result = Tspi_GetPolicyObject(hTPM, TSS_POLICY_USAGE, &hTPMPolicy); result = Tspi_GetPolicyObject(hTPM, TSS_POLICY_USAGE, &hTPMPolicy);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_GetPolicyObject for TPM", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_GetPolicyObject for TPM", result);
goto err; goto err;
} }
result = Tspi_Policy_SetSecret(hTPMPolicy, TSS_SECRET_MODE_SHA1, 20, secret); result = Tspi_Policy_SetSecret(hTPMPolicy, TSS_SECRET_MODE_SHA1, 20, secret);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_Policy_SetSecret for TPM", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_Policy_SetSecret for TPM", result);
goto err; goto err;
} }
result = Tspi_Context_CreateObject(hContext, result = Tspi_Context_CreateObject(hContext,
TSS_OBJECT_TYPE_RSAKEY, TSS_OBJECT_TYPE_RSAKEY,
initFlags, &hIdentKey); initFlags, &hIdentKey);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_CreateObject for key", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_CreateObject for key", result);
goto err; goto err;
} }
result = Tspi_Context_CreateObject(hContext, result = Tspi_Context_CreateObject(hContext,
TSS_OBJECT_TYPE_RSAKEY, TSS_OBJECT_TYPE_RSAKEY,
TSS_KEY_TYPE_LEGACY|TSS_KEY_SIZE_2048, TSS_KEY_TYPE_LEGACY|TSS_KEY_SIZE_2048,
&hPCAKey); &hPCAKey);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_CreateObject for PCA\n", result); {
DBG1(DBG_IMC, "Error 0x%x on Tspi_Context_CreateObject for PCA", result);
goto err; goto err;
} }
if ((size_n = BN_bn2bin(rsa->n, n)) <= 0) { if ((size_n = BN_bn2bin(rsa->n, n)) <= 0)
printf("BN_bn2bin failed\n"); {
goto err;; DBG1(DBG_IMC, "BN_bn2bin failed");
} goto err;;
}
result = Tspi_SetAttribData (hPCAKey, TSS_TSPATTRIB_RSAKEY_INFO, result = Tspi_SetAttribData (hPCAKey, TSS_TSPATTRIB_RSAKEY_INFO,
TSS_TSPATTRIB_KEYINFO_RSA_MODULUS, size_n, n); TSS_TSPATTRIB_KEYINFO_RSA_MODULUS, size_n, n);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_SetAttribData for PCA modulus", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_SetAttribData for PCA modulus", result);
goto err; goto err;
} }
result = Tspi_SetAttribUint32(hPCAKey, TSS_TSPATTRIB_KEY_INFO, result = Tspi_SetAttribUint32(hPCAKey, TSS_TSPATTRIB_KEY_INFO,
TSS_TSPATTRIB_KEYINFO_ENCSCHEME, TSS_TSPATTRIB_KEYINFO_ENCSCHEME,
TSS_ES_RSAESPKCSV15); TSS_ES_RSAESPKCSV15);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_SetAttribUint32 for PCA encscheme", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_SetAttribUint32 for PCA encscheme", result);
goto err; goto err;
} }
if(!REALEK) if (!REALEK)
{ {
result = makeEKCert(hContext, hTPM, &ekCertLen, &ekCert); result = makeEKCert(hContext, hTPM, &ekCertLen, &ekCert);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
DBG1(DBG_IMC, "Error 0x%x on makeEKCert\n", result); {
DBG1(DBG_IMC, "Error 0x%x on makeEKCert", result);
goto err; goto err;
} }
result = Tspi_SetAttribData(hTPM, TSS_TSPATTRIB_TPM_CREDENTIAL, result = Tspi_SetAttribData(hTPM, TSS_TSPATTRIB_TPM_CREDENTIAL,
TSS_TPMATTRIB_EKCERT, ekCertLen, ekCert); TSS_TPMATTRIB_EKCERT, ekCertLen, ekCert);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on SetAttribData for EKCert", result); DBG1(DBG_IMC, "Error 0x%x on SetAttribData for EKCert", result);
goto err; goto err;
} }
@@ -420,10 +439,11 @@ static bool obtain_aik(private_pts_t *this)
DBG3(DBG_IMC, "Generating attestation identity key..."); DBG3(DBG_IMC, "Generating attestation identity key...");
result = Tspi_TPM_CollateIdentityRequest(hTPM, hSRK, hPCAKey, 0, result = Tspi_TPM_CollateIdentityRequest(hTPM, hSRK, hPCAKey, 0,
NULL, hIdentKey, TSS_ALG_AES, NULL, hIdentKey, TSS_ALG_AES,
&ulTCPAIdentityReqLength, &ulTCPAIdentityReqLength,
&rgbTCPAIdentityReq); &rgbTCPAIdentityReq);
if (result != TSS_SUCCESS){ if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_TPM_CollateIdentityRequest", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_TPM_CollateIdentityRequest", result);
goto err; goto err;
} }
@@ -442,7 +462,8 @@ static bool obtain_aik(private_pts_t *this)
slist = curl_slist_append (slist, "Content-Type: application/octet-stream"); slist = curl_slist_append (slist, "Content-Type: application/octet-stream");
slist = curl_slist_append (slist, "Content-Transfer-Encoding: binary"); slist = curl_slist_append (slist, "Content-Transfer-Encoding: binary");
curl_easy_setopt (hCurl, CURLOPT_HTTPHEADER, slist); curl_easy_setopt (hCurl, CURLOPT_HTTPHEADER, slist);
if ((result = curl_easy_perform(hCurl))) { if ((result = curl_easy_perform(hCurl)))
{
DBG1(DBG_IMC, "Unable to connect to Privacy CA, curl library result code %d", result); DBG1(DBG_IMC, "Unable to connect to Privacy CA, curl library result code %d", result);
exit (result); exit (result);
} }
@@ -454,7 +475,7 @@ static bool obtain_aik(private_pts_t *this)
symBufSize = ftell(f_tmp); symBufSize = ftell(f_tmp);
symBuf = malloc(symBufSize); symBuf = malloc(symBufSize);
rewind(f_tmp); rewind(f_tmp);
if(!fread (symBuf, 1, symBufSize, f_tmp)) if (!fread (symBuf, 1, symBufSize, f_tmp))
{ {
DBG1(DBG_IMC, "Failed to read buffer"); DBG1(DBG_IMC, "Failed to read buffer");
goto err; goto err;
@@ -474,15 +495,17 @@ static bool obtain_aik(private_pts_t *this)
symBuf += asymBufSize; symBuf += asymBufSize;
result = Tspi_Key_LoadKey (hIdentKey, hSRK); result = Tspi_Key_LoadKey (hIdentKey, hSRK);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_Key_LoadKey for AIK", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_Key_LoadKey for AIK", result);
goto err; goto err;
} }
result = Tspi_TPM_ActivateIdentity (hTPM, hIdentKey, asymBufSize, asymBuf, result = Tspi_TPM_ActivateIdentity (hTPM, hIdentKey, asymBufSize, asymBuf,
symBufSize, symBuf, symBufSize, symBuf,
&credBufSize, &credBuf); &credBufSize, &credBuf);
if (result != TSS_SUCCESS) { if (result != TSS_SUCCESS)
{
DBG1(DBG_IMC, "Error 0x%x on Tspi_TPM_ActivateIdentity", result); DBG1(DBG_IMC, "Error 0x%x on Tspi_TPM_ActivateIdentity", result);
goto err; goto err;
} }
@@ -490,15 +513,17 @@ static bool obtain_aik(private_pts_t *this)
/* Output credential in PEM format */ /* Output credential in PEM format */
tbuf = credBuf; tbuf = credBuf;
x509 = d2i_X509(NULL, (const BYTE **)&tbuf, credBufSize); x509 = d2i_X509(NULL, (const BYTE **)&tbuf, credBufSize);
if (x509 == NULL) { if (x509 == NULL)
{
DBG1(DBG_IMC, "Unable to parse returned credential"); DBG1(DBG_IMC, "Unable to parse returned credential");
goto err; goto err;
} }
if (tbuf-credBuf != credBufSize) { if (tbuf-credBuf != credBufSize)
{
DBG1(DBG_IMC, "Note, not all data from privacy ca was parsed correctly"); DBG1(DBG_IMC, "Note, not all data from privacy ca was parsed correctly");
} }
if(x509) if (x509)
{ {
BUF_MEM *mem_buf; BUF_MEM *mem_buf;
BIO* bp; BIO* bp;
@@ -513,7 +538,8 @@ static bool obtain_aik(private_pts_t *this)
memcpy(tmp, mem_buf, len); memcpy(tmp, mem_buf, len);
tmp[len] = '\0'; tmp[len] = '\0';
DBG3(DBG_IMC,"X509 Certificate (PEM format):\n%s\n", tmp); DBG3(DBG_IMC,"X509 Certificate (PEM format):");
DBG3(DBG_IMC,"%s", tmp);
this->aik = chunk_create(tmp, len + 1); this->aik = chunk_create(tmp, len + 1);
this->aik = chunk_clone(this->aik); this->aik = chunk_clone(this->aik);
@@ -529,14 +555,14 @@ static bool obtain_aik(private_pts_t *this)
DBG3(DBG_IMC, "Succeeded at obtaining AIK Certificate from Privacy CA!"); DBG3(DBG_IMC, "Succeeded at obtaining AIK Certificate from Privacy CA!");
return TRUE; return TRUE;
err: err:
return FALSE; return FALSE;
} }
METHOD(pts_t, get_aik, bool, METHOD(pts_t, get_aik, bool,
private_pts_t *this, chunk_t *aik, bool *is_naked_key) private_pts_t *this, chunk_t *aik, bool *is_naked_key)
{ {
if(obtain_aik(this) != TRUE ) if (obtain_aik(this) != TRUE )
{ {
return FALSE; return FALSE;
} }
@@ -548,7 +574,7 @@ METHOD(pts_t, get_aik, bool,
} }
METHOD(pts_t, set_aik, void, METHOD(pts_t, set_aik, void,
private_pts_t *this, chunk_t aik, bool is_naked_key) private_pts_t *this, chunk_t aik, bool is_naked_key)
{ {
this->aik = chunk_clone(aik); this->aik = chunk_clone(aik);
this->is_naked_key = is_naked_key; this->is_naked_key = is_naked_key;
@@ -605,7 +631,7 @@ static char* get_filename(char *pathname)
} }
METHOD(pts_t, do_measurements, pts_file_meas_t*, METHOD(pts_t, do_measurements, pts_file_meas_t*,
private_pts_t *this, u_int16_t request_id, char *pathname, bool is_directory) private_pts_t *this, u_int16_t request_id, char *pathname, bool is_directory)
{ {
hasher_t *hasher; hasher_t *hasher;
hash_algorithm_t hash_alg; hash_algorithm_t hash_alg;
@@ -681,7 +707,7 @@ METHOD(pts_t, do_measurements, pts_file_meas_t*,
} }
METHOD(pts_t, destroy, void, METHOD(pts_t, destroy, void,
private_pts_t *this) private_pts_t *this)
{ {
free(this->platform_info); free(this->platform_info);
free(this->tpm_version_info.ptr); free(this->tpm_version_info.ptr);
@@ -722,7 +748,7 @@ static bool has_tpm(private_pts_t *this)
this->tpm_version_info = chunk_clone(this->tpm_version_info); this->tpm_version_info = chunk_clone(this->tpm_version_info);
return TRUE; return TRUE;
err: err:
DBG1(DBG_TNC, "TPM not available: tss error 0x%x", result); DBG1(DBG_TNC, "TPM not available: tss error 0x%x", result);
return FALSE; return FALSE;
} }
@@ -735,22 +761,22 @@ pts_t *pts_create(bool is_imc)
private_pts_t *this; private_pts_t *this;
INIT(this, INIT(this,
.public = { .public = {
.get_proto_caps = _get_proto_caps, .get_proto_caps = _get_proto_caps,
.set_proto_caps = _set_proto_caps, .set_proto_caps = _set_proto_caps,
.get_meas_algorithm = _get_meas_algorithm, .get_meas_algorithm = _get_meas_algorithm,
.set_meas_algorithm = _set_meas_algorithm, .set_meas_algorithm = _set_meas_algorithm,
.get_platform_info = _get_platform_info, .get_platform_info = _get_platform_info,
.set_platform_info = _set_platform_info, .set_platform_info = _set_platform_info,
.get_tpm_version_info = _get_tpm_version_info, .get_tpm_version_info = _get_tpm_version_info,
.set_tpm_version_info = _set_tpm_version_info, .set_tpm_version_info = _set_tpm_version_info,
.get_aik = _get_aik, .get_aik = _get_aik,
.set_aik = _set_aik, .set_aik = _set_aik,
.do_measurements = _do_measurements, .do_measurements = _do_measurements,
.destroy = _destroy, .destroy = _destroy,
}, },
.proto_caps = PTS_PROTO_CAPS_V, .proto_caps = PTS_PROTO_CAPS_V,
.algorithm = PTS_MEAS_ALGO_SHA256, .algorithm = PTS_MEAS_ALGO_SHA256,
); );
if (is_imc) if (is_imc)
+1 -1
View File
@@ -118,7 +118,7 @@ struct pts_t {
* @return PTS File Measurements of NULL if FAILED * @return PTS File Measurements of NULL if FAILED
*/ */
pts_file_meas_t* (*do_measurements)(pts_t *this, u_int16_t request_id, pts_file_meas_t* (*do_measurements)(pts_t *this, u_int16_t request_id,
char *pathname, bool is_directory); char *pathname, bool is_directory);
/** /**
* Destroys a pts_t object. * Destroys a pts_t object.
+1 -1
View File
@@ -32,7 +32,7 @@ typedef struct pts_database_t pts_database_t;
*/ */
struct pts_database_t { struct pts_database_t {
/** /**
* Get files to be measured by PTS * Get files to be measured by PTS
* *
* @product software product (os, vpn client, etc.) * @product software product (os, vpn client, etc.)
+14 -14
View File
@@ -33,23 +33,23 @@ typedef enum pts_error_code_t pts_error_code_t;
* see section 3.14.2 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.14.2 of PTS Protocol: Binding to TNC IF-M Specification
*/ */
enum pts_error_code_t { enum pts_error_code_t {
TCG_PTS_RESERVED_ERROR = 0, TCG_PTS_RESERVED_ERROR = 0,
TCG_PTS_HASH_ALG_NOT_SUPPORTED = 1, TCG_PTS_HASH_ALG_NOT_SUPPORTED = 1,
TCG_PTS_INVALID_PATH = 2, TCG_PTS_INVALID_PATH = 2,
TCG_PTS_FILE_NOT_FOUND = 3, TCG_PTS_FILE_NOT_FOUND = 3,
TCG_PTS_REG_NOT_SUPPORTED = 4, TCG_PTS_REG_NOT_SUPPORTED = 4,
TCG_PTS_REG_KEY_NOT_FOUND = 5, TCG_PTS_REG_KEY_NOT_FOUND = 5,
TCG_PTS_DH_GRPS_NOT_SUPPORTED = 6, TCG_PTS_DH_GRPS_NOT_SUPPORTED = 6,
TCG_PTS_BAD_NONCE_LENGTH = 7, TCG_PTS_BAD_NONCE_LENGTH = 7,
TCG_PTS_INVALID_NAME_FAM = 8, TCG_PTS_INVALID_NAME_FAM = 8,
TCG_PTS_TPM_VERS_NOT_SUPPORTED = 9, TCG_PTS_TPM_VERS_NOT_SUPPORTED = 9,
TCG_PTS_INVALID_DELIMITER = 10, TCG_PTS_INVALID_DELIMITER = 10,
TCG_PTS_OPERATION_NOT_SUPPORTED = 11, TCG_PTS_OPERATION_NOT_SUPPORTED = 11,
TCG_PTS_RM_ERROR = 12, TCG_PTS_RM_ERROR = 12,
TCG_PTS_UNABLE_LOCAL_VAL = 13, TCG_PTS_UNABLE_LOCAL_VAL = 13,
TCG_PTS_UNABLE_CUR_EVID = 14, TCG_PTS_UNABLE_CUR_EVID = 14,
TCG_PTS_UNABLE_DET_TTC = 15, TCG_PTS_UNABLE_DET_TTC = 15,
TCG_PTS_UNABLE_DET_PCR = 16, TCG_PTS_UNABLE_DET_PCR = 16,
}; };
/** /**
+1 -1
View File
@@ -47,7 +47,7 @@ typedef struct entry_t entry_t;
* PTS File Measurement entry * PTS File Measurement entry
*/ */
struct entry_t { struct entry_t {
char *filename; char *filename;
chunk_t measurement; chunk_t measurement;
}; };
+13 -13
View File
@@ -32,21 +32,21 @@ enum pts_funct_comp_type_t {
/** Unknown */ /** Unknown */
PTS_FUNC_COMP_TYPE_UNKNOWN = 0x0, PTS_FUNC_COMP_TYPE_UNKNOWN = 0x0,
/** Trusted Platform */ /** Trusted Platform */
PTS_FUNC_COMP_TYPE_TRUSTED = 0x1, PTS_FUNC_COMP_TYPE_TRUSTED = 0x1,
/** Operating System */ /** Operating System */
PTS_FUNC_COMP_TYPE_OS = 0x2, PTS_FUNC_COMP_TYPE_OS = 0x2,
/** Graphical User Interface */ /** Graphical User Interface */
PTS_FUNC_COMP_TYPE_GUI = 0x3, PTS_FUNC_COMP_TYPE_GUI = 0x3,
/** Application */ /** Application */
PTS_FUNC_COMP_TYPE_APP = 0x4, PTS_FUNC_COMP_TYPE_APP = 0x4,
/** Networking */ /** Networking */
PTS_FUNC_COMP_TYPE_NET = 0x5, PTS_FUNC_COMP_TYPE_NET = 0x5,
/** Library */ /** Library */
PTS_FUNC_COMP_TYPE_LIB = 0x6, PTS_FUNC_COMP_TYPE_LIB = 0x6,
/** TNC Defined Component */ /** TNC Defined Component */
PTS_FUNC_COMP_TYPE_TNC = 0x7, PTS_FUNC_COMP_TYPE_TNC = 0x7,
/** All matching Components */ /** All matching Components */
PTS_FUNC_COMP_TYPE_ALL = 0xF, PTS_FUNC_COMP_TYPE_ALL = 0xF,
}; };
/** /**
@@ -56,25 +56,25 @@ enum pts_funct_comp_name_t {
/** Ignore */ /** Ignore */
PTS_FUNC_COMP_NAME_IGNORE = 0x0000, PTS_FUNC_COMP_NAME_IGNORE = 0x0000,
/** CRTM */ /** CRTM */
PTS_FUNC_COMP_NAME_CRTM = 0x0001, PTS_FUNC_COMP_NAME_CRTM = 0x0001,
/** BIOS */ /** BIOS */
PTS_FUNC_COMP_NAME_BIOS = 0x0002, PTS_FUNC_COMP_NAME_BIOS = 0x0002,
/** Platform Extensions */ /** Platform Extensions */
PTS_FUNC_COMP_NAME_PLATFORM_EXT = 0x0003, PTS_FUNC_COMP_NAME_PLATFORM_EXT = 0x0003,
/** Motherboard firmware */ /** Motherboard firmware */
PTS_FUNC_COMP_NAME_BOARD = 0x0004, PTS_FUNC_COMP_NAME_BOARD = 0x0004,
/** Initial Program Loader */ /** Initial Program Loader */
PTS_FUNC_COMP_NAME_INIT_LOADER = 0x0005, PTS_FUNC_COMP_NAME_INIT_LOADER = 0x0005,
/** Option ROMs */ /** Option ROMs */
PTS_FUNC_COMP_NAME_OPT_ROMS = 0x0006, PTS_FUNC_COMP_NAME_OPT_ROMS = 0x0006,
}; };
/** /**
* Qualifier for Functional Component * Qualifier for Functional Component
*/ */
struct pts_qualifier_t { struct pts_qualifier_t {
bool kernel; bool kernel;
bool sub_component; bool sub_component;
pts_funct_comp_type_t type; pts_funct_comp_type_t type;
}; };
+2 -2
View File
@@ -23,8 +23,8 @@
bool pts_meas_probe_algorithms(pts_meas_algorithms_t *algorithms) bool pts_meas_probe_algorithms(pts_meas_algorithms_t *algorithms)
{ {
enumerator_t *enumerator; enumerator_t *enumerator;
hash_algorithm_t hash_alg; hash_algorithm_t hash_alg;
const char *plugin_name; const char *plugin_name;
char format1[] = " %s PTS measurement algorithm %N[%s] available"; char format1[] = " %s PTS measurement algorithm %N[%s] available";
char format2[] = " %s PTS measurement algorithm %N not available"; char format2[] = " %s PTS measurement algorithm %N not available";
+4 -4
View File
@@ -30,16 +30,16 @@ typedef enum pts_meas_algorithms_t pts_meas_algorithms_t;
* PTS Measurement Algorithms * PTS Measurement Algorithms
*/ */
enum pts_meas_algorithms_t { enum pts_meas_algorithms_t {
PTS_MEAS_ALGO_SHA1 = (1<<15), PTS_MEAS_ALGO_SHA1 = (1<<15),
PTS_MEAS_ALGO_SHA256 = (1<<14), PTS_MEAS_ALGO_SHA256 = (1<<14),
PTS_MEAS_ALGO_SHA384 = (1<<13), PTS_MEAS_ALGO_SHA384 = (1<<13),
}; };
/** /**
* Diffie-Hellman Hash Algorithm Values * Diffie-Hellman Hash Algorithm Values
* see section 3.8.5 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.8.5 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 * 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |1|2|3|R|R|R|R|R|R|R|R|R|R|R|R|R| * |1|2|3|R|R|R|R|R|R|R|R|R|R|R|R|R|
+3 -3
View File
@@ -32,11 +32,11 @@ enum pts_proto_caps_flag_t {
/** XML based Evidence Support flag */ /** XML based Evidence Support flag */
PTS_PROTO_CAPS_X = (1<<0), PTS_PROTO_CAPS_X = (1<<0),
/** Trusted Platform Evidence flag */ /** Trusted Platform Evidence flag */
PTS_PROTO_CAPS_T = (1<<1), PTS_PROTO_CAPS_T = (1<<1),
/** DH Nonce Negotiation Support flag */ /** DH Nonce Negotiation Support flag */
PTS_PROTO_CAPS_D = (1<<2), PTS_PROTO_CAPS_D = (1<<2),
/** Verification Support flag */ /** Verification Support flag */
PTS_PROTO_CAPS_V = (1<<3), PTS_PROTO_CAPS_V = (1<<3),
/** Current (In-Memory) Evidence Support flag */ /** Current (In-Memory) Evidence Support flag */
PTS_PROTO_CAPS_C = (1<<4), PTS_PROTO_CAPS_C = (1<<4),
}; };
+11 -5
View File
@@ -26,12 +26,12 @@ typedef struct private_tcg_pts_attr_aik_t private_tcg_pts_attr_aik_t;
* Attestation Identity Key * Attestation Identity Key
* see section 3.13 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.13 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Flags | Attestation Identity Key (Variable Length) ~ * | Flags | Attestation Identity Key (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Attestation Identity Key (Variable Length) ~ * | Attestation Identity Key (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/ */
@@ -116,7 +116,10 @@ METHOD(pa_tnc_attr_t, build, void,
writer = bio_writer_create(PTS_AIK_SIZE); writer = bio_writer_create(PTS_AIK_SIZE);
if(this->naked_pub_aik) flags += 128; if (this->naked_pub_aik)
{
flags += 128;
}
writer->write_uint8 (writer, flags); writer->write_uint8 (writer, flags);
writer->write_data(writer, this->aik); writer->write_data(writer, this->aik);
@@ -139,7 +142,10 @@ METHOD(pa_tnc_attr_t, process, status_t,
reader = bio_reader_create(this->value); reader = bio_reader_create(this->value);
reader->read_uint8(reader, &flags); reader->read_uint8(reader, &flags);
if((flags >> 7 ) & 1) this->naked_pub_aik = true; if ((flags >> 7 ) & 1)
{
this->naked_pub_aik = true;
}
reader->read_data (reader, this->value.len - 1, &this->aik); reader->read_data (reader, this->value.len - 1, &this->aik);
this->aik = chunk_clone(this->aik); this->aik = chunk_clone(this->aik);
+11 -11
View File
@@ -29,28 +29,28 @@ typedef struct private_tcg_pts_attr_file_meas_t private_tcg_pts_attr_file_meas_t
* File Measurement * File Measurement
* see section 3.19.2 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.19.2 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Number of Files included | * | Number of Files included |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Number of Files included | * | Number of Files included |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Request ID | Measurement Length | * | Request ID | Measurement Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement #1 (Variable Length) | * | Measurement #1 (Variable Length) |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Filename Length | Filename (Variable Length) ~ * | Filename Length | Filename (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Filename (Variable Length) ~ * ~ Filename (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement #2 (Variable Length) | * | Measurement #2 (Variable Length) |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Filename Length | Filename (Variable Length) ~ * | Filename Length | Filename (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Filename (Variable Length) ~ * ~ Filename (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ........................... * ...........................
*/ */
#define PTS_FILE_MEAS_SIZE 12 #define PTS_FILE_MEAS_SIZE 12
@@ -26,11 +26,11 @@ typedef struct private_tcg_pts_attr_gen_attest_evid_t private_tcg_pts_attr_gen_a
* Generate Attestation Evidence * Generate Attestation Evidence
* see section 3.14.2 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.14.2 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* *
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved | * | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* *
*/ */
+2 -2
View File
@@ -26,10 +26,10 @@ typedef struct private_tcg_pts_attr_get_aik_t private_tcg_pts_attr_get_aik_t;
* Get Attestation Identity Key * Get Attestation Identity Key
* see section 3.12 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.12 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved | * | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/ */
@@ -26,11 +26,11 @@ typedef struct private_tcg_pts_attr_get_tpm_version_info_t private_tcg_pts_attr_
* Get TPM Version Information * Get TPM Version Information
* see section 3.10 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.10 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* *
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved | * | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* *
*/ */
+2 -2
View File
@@ -26,10 +26,10 @@ typedef struct private_tcg_pts_attr_meas_algo_t private_tcg_pts_attr_meas_algo_t
* PTS Measurement Algorithm * PTS Measurement Algorithm
* see section 3.9.1 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.9.1 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved | Hash Algorithm Set | * | Reserved | Hash Algorithm Set |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* *
*/ */
+2 -2
View File
@@ -26,10 +26,10 @@ typedef struct private_tcg_pts_attr_proto_caps_t private_tcg_pts_attr_proto_caps
* PTS Protocol Capabilities * PTS Protocol Capabilities
* see section 3.7 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.7 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved |C|V|D|T|X| * | Reserved |C|V|D|T|X|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* *
*/ */
+4 -4
View File
@@ -26,14 +26,14 @@ typedef struct private_tcg_pts_attr_req_file_meas_t private_tcg_pts_attr_req_fil
* Request File Measurement * Request File Measurement
* see section 3.19.1 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.19.1 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Flags | Reserved | Request ID | * | Flags | Reserved | Request ID |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Delimiter | * | Delimiter |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Fully Qualified File Pathname (Variable Length) ~ * ~ Fully Qualified File Pathname (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/ */
@@ -26,13 +26,13 @@ typedef struct private_tcg_pts_attr_req_funct_comp_evid_t private_tcg_pts_attr_r
* Request Functional Component Evidence * Request Functional Component Evidence
* see section 3.14.1 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.14.1 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* *
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Flags | Sub-component Depth | * | Flags | Sub-component Depth |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Component Functional Name | * | Component Functional Name |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* *
*/ */
@@ -40,13 +40,13 @@ typedef struct private_tcg_pts_attr_req_funct_comp_evid_t private_tcg_pts_attr_r
/** /**
* Component Functional Name Structure (see section 5.1 of PTS Protocol: Binding to TNC IF-M Specification) * Component Functional Name Structure (see section 5.1 of PTS Protocol: Binding to TNC IF-M Specification)
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* *
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Component Functional Name Vendor ID |Fam| Qualifier | * | Component Functional Name Vendor ID |Fam| Qualifier |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Component Functional Name | * | Component Functional Name |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* *
*/ */
@@ -56,7 +56,7 @@ typedef struct private_tcg_pts_attr_req_funct_comp_evid_t private_tcg_pts_attr_r
* see section 5.2 of PTS Protocol: Binding to TNC IF-M Specification * see section 5.2 of PTS Protocol: Binding to TNC IF-M Specification
* *
* *
* 0 1 2 3 4 5 * 0 1 2 3 4 5
* +-+-+-+-+-+-+ * +-+-+-+-+-+-+
* |K|S| Type | * |K|S| Type |
* +-+-+-+-+-+-+ * +-+-+-+-+-+-+
@@ -187,7 +187,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint24 (writer, this->depth); writer->write_uint24 (writer, this->depth);
writer->write_uint24 (writer, this->comp_vendor_id); writer->write_uint24 (writer, this->comp_vendor_id);
if(this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM) if (this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM)
{ {
DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00"); DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00");
} }
@@ -256,7 +256,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
/* TODO: Generate an IF-M error attribute indicating */ /* TODO: Generate an IF-M error attribute indicating */
/* TCG_PTS_INVALID_NAME_FAM */ /* TCG_PTS_INVALID_NAME_FAM */
//if(&this->comp_vendor_id==PEN_TCG && this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM) //if (&this->comp_vendor_id==PEN_TCG && this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM)
//{ //{
// DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00"); // DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00");
//} //}
@@ -345,9 +345,9 @@ METHOD(tcg_pts_attr_req_funct_comp_evid_t, set_comp_funct_name, void,
*/ */
pa_tnc_attr_t *tcg_pts_attr_req_funct_comp_evid_create( pa_tnc_attr_t *tcg_pts_attr_req_funct_comp_evid_create(
pts_attr_req_funct_comp_evid_flag_t flags, pts_attr_req_funct_comp_evid_flag_t flags,
u_int32_t depth, u_int32_t vendor_id, u_int32_t depth, u_int32_t vendor_id,
pts_qualifier_t qualifier, pts_qualifier_t qualifier,
pts_funct_comp_name_t name) pts_funct_comp_name_t name)
{ {
private_tcg_pts_attr_req_funct_comp_evid_t *this; private_tcg_pts_attr_req_funct_comp_evid_t *this;
@@ -35,11 +35,11 @@ enum pts_attr_req_funct_comp_evid_flag_t {
/** Transitive Trust Chain flag */ /** Transitive Trust Chain flag */
PTS_REQ_FUNC_COMP_FLAG_TTC = (1<<7), PTS_REQ_FUNC_COMP_FLAG_TTC = (1<<7),
/** Verify Component flag */ /** Verify Component flag */
PTS_REQ_FUNC_COMP_FLAG_VER = (1<<6), PTS_REQ_FUNC_COMP_FLAG_VER = (1<<6),
/** Current Evidence flag */ /** Current Evidence flag */
PTS_REQ_FUNC_COMP_FLAG_CURR = (1<<5), PTS_REQ_FUNC_COMP_FLAG_CURR = (1<<5),
/** PCR Information flag */ /** PCR Information flag */
PTS_REQ_FUNC_COMP_FLAG_PCR = (1<<4), PTS_REQ_FUNC_COMP_FLAG_PCR = (1<<4),
}; };
/** /**
+23 -23
View File
@@ -26,40 +26,40 @@ typedef struct private_tcg_pts_attr_simple_comp_evid_t private_tcg_pts_attr_simp
* Simple Component Evidence * Simple Component Evidence
* see section 3.15.1 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.15.1 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Flags | Sub-Component Depth | * | Flags | Sub-Component Depth |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Specific Functional Component | * | Specific Functional Component |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Specific Functional Component | * | Specific Functional Component |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measure. Type | Extended into PCR | * | Measure. Type | Extended into PCR |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Hash Algorithm | PCR Transform | Reserved | * | Hash Algorithm | PCR Transform | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time | * | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time | * | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time | * | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time | * | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time | * | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Optional Policy URI Length | Opt. Verification Policy URI ~ * | Optional Policy URI Length | Opt. Verification Policy URI ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Optional Verification Policy URI ~ * ~ Optional Verification Policy URI ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Optional PCR Length | Optional PCR Before Value ~ * | Optional PCR Length | Optional PCR Before Value ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Optional PCR Before Value (Variable Length) ~ * ~ Optional PCR Before Value (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Optional PCR After Value (Variable Length) ~ * ~ Optional PCR After Value (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Component Measurement (Variable Length) ~ * ~ Component Measurement (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/ */
@@ -67,12 +67,12 @@ typedef struct private_tcg_pts_attr_simple_comp_evid_t private_tcg_pts_attr_simp
* Specific Functional Component -> Component Functional Name Structure * Specific Functional Component -> Component Functional Name Structure
* see section 5.1 of PTS Protocol: Binding to TNC IF-M Specification * see section 5.1 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Component Functional Name Vendor ID |Fam| Qualifier | * | Component Functional Name Vendor ID |Fam| Qualifier |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Component Functional Name | * | Component Functional Name |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* *
*/ */
@@ -283,7 +283,7 @@ METHOD(pa_tnc_attr_t, build, void,
if (!qualifier || qualifier == 63) if (!qualifier || qualifier == 63)
{ {
DBG1(DBG_TNC, "Unknown or Wildcard should not be used for" DBG1(DBG_TNC, "Unknown or Wildcard should not be used for"
" Functional Name Qualifier"); " Functional Name Qualifier");
} }
writer->write_uint8 (writer, qualifier); writer->write_uint8 (writer, qualifier);
@@ -340,7 +340,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
/* Determine the flags to set*/ /* Determine the flags to set*/
if ((flags >> 7) & 1) if ((flags >> 7) & 1)
{ {
this->flags |= PTS_SIMPLE_COMP_EVID_FLAG_PCR; this->flags |= PTS_SIMPLE_COMP_EVID_FLAG_PCR;
} }
if (!((flags >> 6) & 1) && !((flags >> 5) & 1)) if (!((flags >> 6) & 1) && !((flags >> 5) & 1))
{ {
@@ -374,7 +374,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
/* TODO: Generate an IF-M error attribute indicating */ /* TODO: Generate an IF-M error attribute indicating */
/* TCG_PTS_INVALID_NAME_FAM */ /* TCG_PTS_INVALID_NAME_FAM */
//if(&this->comp_vendor_id==PEN_TCG && this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM) //if (&this->comp_vendor_id==PEN_TCG && this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM)
//{ //{
// DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00"); // DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00");
//} //}
@@ -394,7 +394,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
if (!(fam_and_qualifier & 0x3F) || (fam_and_qualifier & 0x3F) == 0x3F) if (!(fam_and_qualifier & 0x3F) || (fam_and_qualifier & 0x3F) == 0x3F)
{ {
DBG1(DBG_TNC, "Unknown or Wildcard should not be used for" DBG1(DBG_TNC, "Unknown or Wildcard should not be used for"
" Functional Name Qualifier"); " Functional Name Qualifier");
} }
reader->read_uint32(reader, &this->name); reader->read_uint32(reader, &this->name);
+19 -19
View File
@@ -37,13 +37,13 @@ enum pts_attr_simple_comp_evid_flag_t {
/** PCR information fields inlcuded */ /** PCR information fields inlcuded */
PTS_SIMPLE_COMP_EVID_FLAG_PCR = 0, PTS_SIMPLE_COMP_EVID_FLAG_PCR = 0,
/** No Validation was attempted */ /** No Validation was attempted */
PTS_SIMPLE_COMP_EVID_FLAG_NO_VALID = 1, PTS_SIMPLE_COMP_EVID_FLAG_NO_VALID = 1,
/** Attempted validation, unable to verify */ /** Attempted validation, unable to verify */
PTS_SIMPLE_COMP_EVID_FLAG_NO_VER = 2, PTS_SIMPLE_COMP_EVID_FLAG_NO_VER = 2,
/** Attempted validation, verification failed */ /** Attempted validation, verification failed */
PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL = 3, PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL = 3,
/** Attempted validation, verification passed */ /** Attempted validation, verification passed */
PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS = 4, PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS = 4,
}; };
/** /**
@@ -53,11 +53,11 @@ enum pts_pcr_transform_t {
/** No Transformation */ /** No Transformation */
PTS_PCR_TRANSFORM_NO = 0, PTS_PCR_TRANSFORM_NO = 0,
/** Hash Value matched PCR size */ /** Hash Value matched PCR size */
PTS_PCR_TRANSFORM_MATCH = 1, PTS_PCR_TRANSFORM_MATCH = 1,
/** Hash value shorter than PCR size */ /** Hash value shorter than PCR size */
PTS_PCR_TRANSFORM_SHORT = 2, PTS_PCR_TRANSFORM_SHORT = 2,
/** Hash value longer than PCR size */ /** Hash value longer than PCR size */
PTS_PCR_TRANSFORM_LONG = 3, PTS_PCR_TRANSFORM_LONG = 3,
}; };
/** /**
@@ -292,18 +292,18 @@ struct tcg_pts_attr_simple_comp_evid_t {
* @param measurement Component Measurement * @param measurement Component Measurement
*/ */
pa_tnc_attr_t* tcg_pts_attr_simple_comp_evid_create(pts_attr_simple_comp_evid_flag_t flags, pa_tnc_attr_t* tcg_pts_attr_simple_comp_evid_create(pts_attr_simple_comp_evid_flag_t flags,
u_int32_t depth, u_int32_t depth,
u_int32_t vendor_id, u_int32_t vendor_id,
pts_qualifier_t qualifier, pts_qualifier_t qualifier,
pts_funct_comp_name_t name, pts_funct_comp_name_t name,
u_int32_t extended_pcr, u_int32_t extended_pcr,
pts_meas_algorithms_t hash_algorithm, pts_meas_algorithms_t hash_algorithm,
pts_pcr_transform_t transformation, pts_pcr_transform_t transformation,
chunk_t measurement_time, chunk_t measurement_time,
chunk_t policy_uri, chunk_t policy_uri,
chunk_t pcr_before, chunk_t pcr_before,
chunk_t pcr_after, chunk_t pcr_after,
chunk_t measurement); chunk_t measurement);
/** /**
* Creates an tcg_pts_attr_simple_comp_evid_t object from received data * Creates an tcg_pts_attr_simple_comp_evid_t object from received data
@@ -26,20 +26,20 @@ typedef struct private_tcg_pts_attr_simple_evid_final_t private_tcg_pts_attr_sim
* Simple Evidence Final * Simple Evidence Final
* see section 3.15.2 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.15.2 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Flags | Reserved | Optional Composite Hash Alg | * | Flags | Reserved | Optional Composite Hash Alg |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Optional TPM PCR Composite Length | * | Optional TPM PCR Composite Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Optional TPM PCR Composite (Variable Length) ~ * ~ Optional TPM PCR Composite (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Optional TPM Quote Signature Length | * | Optional TPM Quote Signature Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Optional TPM Quote Signature (Variable Length) ~ * ~ Optional TPM Quote Signature (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Optional Evidence Signature (Variable Length) ~ * ~ Optional Evidence Signature (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/ */
@@ -345,11 +345,11 @@ METHOD(tcg_pts_attr_simple_evid_final_t, set_evid_sign, void,
* Described in header. * Described in header.
*/ */
pa_tnc_attr_t *tcg_pts_attr_simple_evid_final_create( pa_tnc_attr_t *tcg_pts_attr_simple_evid_final_create(
pts_simple_evid_final_flag_t flags, pts_simple_evid_final_flag_t flags,
pts_meas_algorithms_t comp_hash_algorithm, pts_meas_algorithms_t comp_hash_algorithm,
chunk_t pcr_comp, chunk_t pcr_comp,
chunk_t tpm_quote_sign, chunk_t tpm_quote_sign,
chunk_t evid_sign) chunk_t evid_sign)
{ {
private_tcg_pts_attr_simple_evid_final_t *this; private_tcg_pts_attr_simple_evid_final_t *this;
@@ -36,15 +36,15 @@ enum pts_simple_evid_final_flag_t {
PTS_SIMPLE_EVID_FINAL_FLAG_NO = 0, PTS_SIMPLE_EVID_FINAL_FLAG_NO = 0,
/** Optional TPM PCR Composite and Optional TPM Quote Signature fields included */ /** Optional TPM PCR Composite and Optional TPM Quote Signature fields included */
/** using TPM_QUOTE_INFO */ /** using TPM_QUOTE_INFO */
PTS_SIMPLE_EVID_FINAL_FLAG_TPM_QUOTE_INFO = 1, PTS_SIMPLE_EVID_FINAL_FLAG_TPM_QUOTE_INFO = 1,
/** Optional TPM PCR Composite and Optional TPM Quote Signature fields included */ /** Optional TPM PCR Composite and Optional TPM Quote Signature fields included */
/** using TPM_QUOTE_INFO2, TPM_CAP_VERSION_INFO was not appended */ /** using TPM_QUOTE_INFO2, TPM_CAP_VERSION_INFO was not appended */
PTS_SIMPLE_EVID_FINAL_FLAG_TPM_QUOTE_INFO2 = 2, PTS_SIMPLE_EVID_FINAL_FLAG_TPM_QUOTE_INFO2 = 2,
/** Optional TPM PCR Composite and Optional TPM Quote Signature fields included */ /** Optional TPM PCR Composite and Optional TPM Quote Signature fields included */
/** using TPM_QUOTE_INFO2, TPM_CAP_VERSION_INFO was appended */ /** using TPM_QUOTE_INFO2, TPM_CAP_VERSION_INFO was appended */
PTS_SIMPLE_EVID_FINAL_FLAG_TPM_QUOTE_INFO2_CAP_VER = 3, PTS_SIMPLE_EVID_FINAL_FLAG_TPM_QUOTE_INFO2_CAP_VER = 3,
/** Optional Evidence Signature included */ /** Optional Evidence Signature included */
PTS_SIMPLE_EVID_FINAL_FLAG_EVID = 4, PTS_SIMPLE_EVID_FINAL_FLAG_EVID = 4,
}; };
/** /**
@@ -26,11 +26,11 @@ typedef struct private_tcg_pts_attr_tpm_version_info_t private_tcg_pts_attr_tpm_
* TPM Version Information * TPM Version Information
* see section 3.11 of PTS Protocol: Binding to TNC IF-M Specification * see section 3.11 of PTS Protocol: Binding to TNC IF-M Specification
* *
* 1 2 3 * 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* *
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | TPM Version Information (Variable Lenght) | * | TPM Version Information (Variable Lenght) |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* *
* see TPM Structure Specification Part 2, section 21.6: TPM_CAP_VERSION_INFO * see TPM Structure Specification Part 2, section 21.6: TPM_CAP_VERSION_INFO