TPM2B-marshal.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. /* SPDX-License-Identifier: BSD-2-Clause */
  2. /***********************************************************************
  3. * Copyright (c) 2017-2018, Intel Corporation
  4. *
  5. * All rights reserved.
  6. ***********************************************************************/
  7. #ifdef HAVE_CONFIG_H
  8. #include <config.h>
  9. #endif
  10. #include <stdlib.h>
  11. #include <stdio.h>
  12. #include <string.h>
  13. #include <setjmp.h>
  14. #include <cmocka.h>
  15. #include "tss2_mu.h"
  16. #include "util/tss2_endian.h"
  17. /*
  18. * Success case
  19. */
  20. static void
  21. tpm2b_marshal_success(void **state) {
  22. TPM2B_DIGEST dgst = {4, {0}};
  23. TPM2B_ECC_POINT point = {0};
  24. uint8_t buffer[sizeof(dgst) + sizeof(point)] = {0};
  25. size_t buffer_size = sizeof(buffer);
  26. uint16_t *size_ptr = (uint16_t *) buffer;
  27. uint32_t *ptr = (uint32_t *) (buffer + 2);
  28. uint32_t value = 0xdeadbeef;
  29. uint64_t value2 = 0xdeadbeefdeadbeefULL;
  30. uint64_t *ptr2;
  31. TSS2_RC rc;
  32. memcpy(dgst.buffer, &value, sizeof(value));
  33. memcpy(point.point.x.buffer, &value, sizeof(value));
  34. point.point.x.size = sizeof(value);
  35. memcpy(point.point.y.buffer, &value2, sizeof(value2));
  36. point.point.y.size = sizeof(value2);
  37. rc = Tss2_MU_TPM2B_DIGEST_Marshal(&dgst, buffer, buffer_size, NULL);
  38. assert_int_equal (rc, TSS2_RC_SUCCESS);
  39. assert_int_equal (*size_ptr, HOST_TO_BE_16(4));
  40. assert_int_equal (*ptr, value);
  41. size_ptr = (uint16_t *) buffer;
  42. ptr = (uint32_t *) (buffer + 4);
  43. rc = Tss2_MU_TPM2B_ECC_POINT_Marshal(&point, buffer, buffer_size, NULL);
  44. assert_int_equal (rc, TSS2_RC_SUCCESS);
  45. /*
  46. * size_ptr points to the size of the whole TPMS_ECC_POINT:
  47. * sizeof(unit16) + sizeof(value) + sizeof(unit16) + sizeof(value2)
  48. */
  49. assert_int_equal (*size_ptr, HOST_TO_BE_16(2 + 4 + 2 + 8));
  50. /* check point.x: */
  51. assert_int_equal (*(size_ptr + 1), HOST_TO_BE_16(4));
  52. assert_int_equal (*ptr, value);
  53. size_ptr = (uint16_t *) (buffer + 2 + 2 + 4);
  54. ptr2 = (uint64_t *) (buffer + 2 + 2 + 2 + 4);
  55. /* check point.y: */
  56. assert_int_equal (*size_ptr, HOST_TO_BE_16(8));
  57. assert_int_equal (*ptr2, value2);
  58. }
  59. /*
  60. * Success case with a valid offset
  61. */
  62. static void
  63. tpm2b_marshal_success_offset(void **state) {
  64. TPM2B_DIGEST dgst = {4, {0}};
  65. TPM2B_ECC_POINT point = {0};
  66. size_t offset = 10;
  67. uint8_t buffer[sizeof(dgst) + sizeof(point) + 10] = {0};
  68. size_t buffer_size = sizeof(buffer);
  69. uint16_t *size_ptr = (uint16_t *) (buffer + 10);
  70. uint32_t *ptr = (uint32_t *) (buffer + 2 + 10);
  71. uint32_t value = 0xdeadbeef;
  72. uint64_t value2 = 0xdeadbeefdeadbeefULL;
  73. uint64_t *ptr2;
  74. TSS2_RC rc;
  75. memcpy(dgst.buffer, &value, sizeof(value));
  76. memcpy(point.point.x.buffer, &value, sizeof(value));
  77. point.point.x.size = sizeof(value);
  78. memcpy(point.point.y.buffer, &value2, sizeof(value2));
  79. point.point.y.size = sizeof(value2);
  80. rc = Tss2_MU_TPM2B_DIGEST_Marshal(&dgst, buffer, buffer_size, &offset);
  81. assert_int_equal (rc, TSS2_RC_SUCCESS);
  82. assert_int_equal (*size_ptr, HOST_TO_BE_16(4));
  83. assert_int_equal (*ptr, value);
  84. /* check the offset */
  85. assert_int_equal (offset, 10 + 2 + 4);
  86. size_ptr = (uint16_t *) (buffer + offset);
  87. ptr = (uint32_t *) (buffer + offset + 4);
  88. rc = Tss2_MU_TPM2B_ECC_POINT_Marshal(&point, buffer, buffer_size, &offset);
  89. assert_int_equal (rc, TSS2_RC_SUCCESS);
  90. /*
  91. * size_ptr points to the size of the whole TPMS_ECC_POINT:
  92. * sizeof(unit16) + sizeof(value) + sizeof(unit16) + sizeof(value2)
  93. */
  94. assert_int_equal (*size_ptr, HOST_TO_BE_16(2 + 4 + 2 + 8));
  95. /* check point.x: */
  96. assert_int_equal (*(size_ptr + 1), HOST_TO_BE_16(4));
  97. assert_int_equal (*ptr, value);
  98. size_ptr = (uint16_t *) (buffer + 10 + 2 + 4 + 2 + 2 + 4);
  99. ptr2 = (uint64_t *) (buffer + 10 + 2 + 4 + 2 + 2 + 4 + 2);
  100. /* check point.y: */
  101. assert_int_equal (*size_ptr, HOST_TO_BE_16(8));
  102. assert_int_equal (*ptr2, value2);
  103. /* check the offset */
  104. assert_int_equal (offset, 10 + 2 + 4 + 2 + 2 + 4 + 2 + 8);
  105. }
  106. /*
  107. * Success case with a null buffer
  108. */
  109. static void
  110. tpm2b_marshal_buffer_null_with_offset(void **state)
  111. {
  112. TPM2B_DIGEST dgst = {4, {0}};
  113. TPM2B_ECC_POINT point = {0};
  114. size_t offset = 10;
  115. size_t buffer_size = sizeof(dgst) + sizeof(point) + 10;
  116. uint32_t value = 0xdeadbeef;
  117. uint64_t value2 = 0xdeadbeefdeadbeefULL;
  118. TSS2_RC rc;
  119. memcpy(dgst.buffer, &value, sizeof(value));
  120. memcpy(point.point.x.buffer, &value, sizeof(value));
  121. point.point.x.size = sizeof(value);
  122. memcpy(point.point.y.buffer, &value2, sizeof(value2));
  123. point.point.y.size = sizeof(value2);
  124. rc = Tss2_MU_TPM2B_DIGEST_Marshal(&dgst, NULL, buffer_size, &offset);
  125. assert_int_equal (rc, TSS2_RC_SUCCESS);
  126. assert_int_equal (offset, 10 + 2 + 4);
  127. offset = 10;
  128. rc = Tss2_MU_TPM2B_ECC_POINT_Marshal(&point, NULL, buffer_size, &offset);
  129. assert_int_equal (rc, TSS2_RC_SUCCESS);
  130. assert_int_equal (offset, 10 + 2 + 2 + sizeof(value) + 2 + sizeof(value2));
  131. offset = 0;
  132. rc = Tss2_MU_TPM2B_DIGEST_Marshal(&dgst, NULL, buffer_size, &offset);
  133. assert_int_equal (rc, TSS2_RC_SUCCESS);
  134. /*
  135. * TSS MU spec states:
  136. * If the 'buffer' parameter is NULL the implementation shall not write
  137. * any marshaled data but the 'offset' parameter shall be updated as
  138. * though it had.
  139. * The offset of call with NULL and not NULL buffer will be compared.
  140. */
  141. uint8_t buffer[offset];
  142. size_t offset1 = 0;
  143. rc = Tss2_MU_TPM2B_DIGEST_Marshal(&dgst, NULL, buffer_size, &offset1);
  144. assert_int_equal (rc, TSS2_RC_SUCCESS);
  145. size_t offset2 = 0;
  146. rc = Tss2_MU_TPM2B_DIGEST_Marshal(&dgst, buffer, buffer_size, &offset2);
  147. assert_int_equal (rc, TSS2_RC_SUCCESS);
  148. assert_int_equal(offset1, offset2);
  149. }
  150. /*
  151. * Invalid case with a null buffer and a null offset
  152. */
  153. static void
  154. tpm2b_marshal_buffer_null_offset_null(void **state)
  155. {
  156. TPM2B_DIGEST dgst = {4, {0}};
  157. TPM2B_ECC_POINT point = {0};
  158. size_t buffer_size = 1024;
  159. TSS2_RC rc;
  160. rc = Tss2_MU_TPM2B_DIGEST_Marshal(&dgst, NULL, buffer_size, NULL);
  161. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  162. rc = Tss2_MU_TPM2B_ECC_POINT_Marshal(&point, NULL, buffer_size, NULL);
  163. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  164. }
  165. /*
  166. * Invalid case with not big enough buffer
  167. */
  168. static void
  169. tpm2b_marshal_buffer_size_lt_data_nad_lt_offset(void **state) {
  170. TPM2B_DIGEST dgst = {4, {0}};
  171. TPM2B_ECC_POINT point = {0};
  172. size_t offset = 10;
  173. uint8_t buffer[sizeof(dgst) + sizeof(point)] = {0};
  174. size_t buffer_size = sizeof(buffer);
  175. uint32_t value = 0xdeadbeef;
  176. uint64_t value2 = 0xdeadbeefdeadbeefULL;
  177. TSS2_RC rc;
  178. memcpy(dgst.buffer, &value, sizeof(value));
  179. memcpy(point.point.x.buffer, &value, sizeof(value));
  180. point.point.x.size = sizeof(value);
  181. memcpy(point.point.y.buffer, &value2, sizeof(value2));
  182. point.point.y.size = sizeof(value2);
  183. rc = Tss2_MU_TPM2B_DIGEST_Marshal(&dgst, buffer, buffer_size, &offset);
  184. assert_int_equal (rc, TSS2_RC_SUCCESS);
  185. rc = Tss2_MU_TPM2B_ECC_POINT_Marshal(&point, buffer, buffer_size, &offset);
  186. assert_int_equal (rc, TSS2_RC_SUCCESS);
  187. }
  188. /*
  189. * Unmarshal success case
  190. */
  191. static void
  192. tpm2b_unmarshal_success(void **state)
  193. {
  194. TPM2B_DIGEST dgst = {0};
  195. TPM2B_ECC_POINT point = {0};
  196. size_t offset = 0;
  197. uint8_t buffer[] = { 0x00, 0x04, 0xef, 0xbe, 0xad, 0xde, /* digest of 4 bytes */
  198. 0x00, 0x0c, /* size of TPM2B_ECC_POINT */
  199. 0x00, 0x04, 0xef, 0xbe, 0xad, 0xde, /* ECC_POINT.x - 4 bytes */
  200. 0x00, 0x04, 0x44, 0x33, 0x22, 0x11 }; /* ECC_POINT.y - 4 bytes */
  201. size_t buffer_size = sizeof(buffer);
  202. uint32_t value = 0xdeadbeef;
  203. uint32_t value2 = 0x11223344;
  204. uint32_t val;
  205. TSS2_RC rc;
  206. rc = Tss2_MU_TPM2B_DIGEST_Unmarshal(buffer, buffer_size, &offset, &dgst);
  207. assert_int_equal (rc, TSS2_RC_SUCCESS);
  208. assert_int_equal (dgst.size, 4);
  209. memcpy(&val, dgst.buffer, sizeof(val));
  210. assert_int_equal (le32toh(val), value);
  211. assert_int_equal (offset, 6);
  212. rc = Tss2_MU_TPM2B_ECC_POINT_Unmarshal(buffer, buffer_size, &offset, &point);
  213. assert_int_equal (rc, TSS2_RC_SUCCESS);
  214. assert_int_equal (point.point.x.size, 4);
  215. memcpy(&val, point.point.x.buffer, sizeof(val));
  216. assert_int_equal (le32toh(val), value);
  217. assert_int_equal (point.point.y.size, 4);
  218. memcpy(&val, point.point.y.buffer, sizeof(val));
  219. assert_int_equal (le32toh(val), value2);
  220. assert_int_equal (offset, 20);
  221. }
  222. /*
  223. * Unmarshal success case with offset
  224. */
  225. static void
  226. tpm2b_unmarshal_success_offset(void **state)
  227. {
  228. TPM2B_DIGEST dgst = {0};
  229. TPM2B_ECC_POINT point = {0};
  230. size_t offset = 6;
  231. uint8_t buffer[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, /* random 6 bytes offset */
  232. 0x00, 0x04, 0xef, 0xbe, 0xad, 0xde, /* digest of 4 bytes */
  233. 0x00, 0x10, /* size of TPM2B_ECC_POINT - 16 bytes */
  234. 0x00, 0x08, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, /* ECC_POINT.x - 8 bytes */
  235. 0x00, 0x04, 0x44, 0x33, 0x22, 0x11 }; /* ECC_POINT.y - 4 bytes */
  236. size_t buffer_size = sizeof(buffer);
  237. uint32_t value = 0xdeadbeef;
  238. uint64_t value2 = 0xdeadbeefdeadbeefULL;
  239. uint32_t value3 = 0x11223344;
  240. uint32_t val;
  241. uint64_t val2;
  242. TSS2_RC rc;
  243. rc = Tss2_MU_TPM2B_DIGEST_Unmarshal(buffer, buffer_size, &offset, &dgst);
  244. assert_int_equal (rc, TSS2_RC_SUCCESS);
  245. assert_int_equal (dgst.size, 4);
  246. memcpy(&val, dgst.buffer, sizeof(val));
  247. assert_int_equal (le32toh(val), value);
  248. assert_int_equal (offset, 12);
  249. rc = Tss2_MU_TPM2B_ECC_POINT_Unmarshal(buffer, buffer_size, &offset, &point);
  250. assert_int_equal (rc, TSS2_RC_SUCCESS);
  251. assert_int_equal (point.point.x.size, 8);
  252. memcpy(&val2, point.point.x.buffer, sizeof(val2));
  253. assert_int_equal (le64toh(val2), value2);
  254. assert_int_equal (point.point.y.size, 4);
  255. memcpy(&val, point.point.y.buffer, sizeof(val));
  256. assert_int_equal (le32toh(val), value3);
  257. assert_int_equal (offset, 30);
  258. }
  259. /*
  260. * Test case ensures a NULL buffer parameter produces a BAD_REFERENCE RC.
  261. */
  262. void
  263. tpm2b_unmarshal_buffer_null (void **state)
  264. {
  265. TPM2B_DIGEST dgst = {0};
  266. TPM2B_ECC_POINT point = {0};
  267. TSS2_RC rc;
  268. size_t offset = 0;
  269. rc = Tss2_MU_TPM2B_DIGEST_Unmarshal (NULL, 1, NULL, NULL);
  270. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  271. rc = Tss2_MU_TPM2B_ECC_POINT_Unmarshal (NULL, 1, NULL, NULL);
  272. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  273. rc = Tss2_MU_TPM2B_DIGEST_Unmarshal (NULL, 1, &offset, NULL);
  274. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  275. rc = Tss2_MU_TPM2B_ECC_POINT_Unmarshal (NULL, 1, &offset, NULL);
  276. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  277. rc = Tss2_MU_TPM2B_DIGEST_Unmarshal (NULL, 1, NULL, &dgst);
  278. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  279. rc = Tss2_MU_TPM2B_ECC_POINT_Unmarshal (NULL, 1, NULL, &point);
  280. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  281. }
  282. /*
  283. * Test case ensures a NULL dest and offset parameters produce an
  284. * INSUFFICIENT_BUFFER RC.
  285. */
  286. void
  287. tpm2b_unmarshal_dest_null (void **state)
  288. {
  289. uint8_t buffer [1] = { 0 };
  290. TSS2_RC rc;
  291. rc = Tss2_MU_TPM2B_DIGEST_Unmarshal (buffer, sizeof (buffer), NULL, NULL);
  292. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  293. rc = Tss2_MU_TPM2B_ECC_POINT_Unmarshal (buffer, 1, NULL, NULL);
  294. assert_int_equal (rc, TSS2_MU_RC_BAD_REFERENCE);
  295. }
  296. /*
  297. * Test case ensures the offset is updated when dest is NULL
  298. * and offset is valid
  299. */
  300. void
  301. tpm2b_unmarshal_dest_null_offset_valid (void **state)
  302. {
  303. size_t offset = 0;
  304. uint8_t buffer[] = { 0x00, 0x04, 0xef, 0xbe, 0xad, 0xde, /* digest of 4 bytes */
  305. 0x00, 0x10, /* size of TPM2B_ECC_POINT - 16 bytes */
  306. 0x00, 0x08, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, /* ECC_POINT.x - 8 bytes */
  307. 0x00, 0x04, 0x44, 0x33, 0x22, 0x11 }; /* ECC_POINT.y - 4 bytes */
  308. TSS2_RC rc;
  309. rc = Tss2_MU_TPM2B_DIGEST_Unmarshal (buffer, sizeof (buffer), &offset, NULL);
  310. assert_int_equal (rc, TSS2_RC_SUCCESS);
  311. assert_int_equal (offset, 6);
  312. rc = Tss2_MU_TPM2B_ECC_POINT_Unmarshal (buffer, sizeof (buffer), &offset, NULL);
  313. assert_int_equal (rc, TSS2_RC_SUCCESS);
  314. assert_int_equal (offset, 24);
  315. }
  316. /*
  317. * Invalid case with not big enough buffer
  318. */
  319. static void
  320. tpm2b_unmarshal_buffer_size_lt_data_nad_lt_offset(void **state)
  321. {
  322. TPM2B_DIGEST dgst = {4, {0x00, 0x01, 0x02, 0x03}};
  323. TPM2B_ECC_POINT point = {0};
  324. uint8_t buffer[sizeof(dgst) + sizeof(point)] = { 0 };
  325. size_t offset = sizeof(dgst) - 5;
  326. TSS2_RC rc;
  327. rc = Tss2_MU_TPM2B_DIGEST_Unmarshal (buffer, 6, &offset, &dgst);
  328. assert_int_equal (rc, TSS2_MU_RC_INSUFFICIENT_BUFFER);
  329. assert_int_equal (offset, sizeof(dgst) - 5);
  330. rc = Tss2_MU_TPM2B_ECC_POINT_Unmarshal (buffer, 1, &offset, &point);
  331. assert_int_equal (rc, TSS2_MU_RC_INSUFFICIENT_BUFFER);
  332. assert_int_equal (offset, sizeof(dgst) - 5);
  333. }
  334. /*
  335. * Success case
  336. */
  337. static void
  338. tpm2b_public_rsa_marshal_success(void **state) {
  339. TPM2B_PUBLIC pub2b = {0};
  340. TPMT_PUBLIC *pub = &pub2b.publicArea;
  341. uint8_t buffer[sizeof(pub2b)] = { 0 };
  342. size_t buffer_size = sizeof(buffer);
  343. TPM2B_PUBLIC *ptr1;
  344. TSS2_RC rc;
  345. pub->type = TPM2_ALG_RSA;
  346. pub->nameAlg = TPM2_ALG_SHA1;
  347. pub->parameters.symDetail.sym.algorithm = TPM2_ALG_NULL;
  348. pub->parameters.rsaDetail.scheme.scheme = TPM2_ALG_NULL;
  349. pub->parameters.rsaDetail.symmetric.algorithm = TPM2_ALG_AES;
  350. pub->parameters.rsaDetail.symmetric.keyBits.aes = 128;
  351. pub->parameters.rsaDetail.symmetric.mode.aes = TPM2_ALG_CBC;
  352. rc = Tss2_MU_TPM2B_PUBLIC_Marshal(&pub2b, buffer, buffer_size, NULL);
  353. assert_int_equal (rc, TSS2_RC_SUCCESS);
  354. ptr1 = (TPM2B_PUBLIC *)buffer;
  355. assert_int_equal (ptr1->size, HOST_TO_BE_16(0x1a));
  356. }
  357. /*
  358. * Success case
  359. */
  360. static void
  361. tpm2b_public_rsa_unique_size_marshal_success(void **state) {
  362. TPM2B_PUBLIC pub2b = {0};
  363. TPMT_PUBLIC *pub = &pub2b.publicArea;
  364. uint8_t buffer[sizeof(pub2b)] = { 0 };
  365. size_t buffer_size = sizeof(buffer);
  366. TPM2B_PUBLIC *ptr1;
  367. TSS2_RC rc;
  368. pub->type = TPM2_ALG_RSA;
  369. pub->nameAlg = TPM2_ALG_SHA1;
  370. pub->parameters.symDetail.sym.algorithm = TPM2_ALG_NULL;
  371. pub->parameters.rsaDetail.scheme.scheme = TPM2_ALG_NULL;
  372. pub->parameters.rsaDetail.symmetric.algorithm = TPM2_ALG_AES;
  373. pub->parameters.rsaDetail.symmetric.keyBits.aes = 128;
  374. pub->parameters.rsaDetail.symmetric.mode.aes = TPM2_ALG_CBC;
  375. pub->unique.rsa.size = 0x100;
  376. rc = Tss2_MU_TPM2B_PUBLIC_Marshal(&pub2b, buffer, buffer_size, NULL);
  377. assert_int_equal (rc, TSS2_RC_SUCCESS);
  378. ptr1 = (TPM2B_PUBLIC *)buffer;
  379. assert_int_equal (ptr1->size, HOST_TO_BE_16(0x11a));
  380. }
  381. int main(void) {
  382. const struct CMUnitTest tests[] = {
  383. cmocka_unit_test(tpm2b_marshal_success),
  384. cmocka_unit_test(tpm2b_marshal_success_offset),
  385. cmocka_unit_test(tpm2b_marshal_buffer_null_with_offset),
  386. cmocka_unit_test(tpm2b_marshal_buffer_null_offset_null),
  387. cmocka_unit_test(tpm2b_marshal_buffer_size_lt_data_nad_lt_offset),
  388. cmocka_unit_test(tpm2b_unmarshal_success),
  389. cmocka_unit_test(tpm2b_unmarshal_success_offset),
  390. cmocka_unit_test(tpm2b_unmarshal_buffer_null),
  391. cmocka_unit_test(tpm2b_unmarshal_dest_null),
  392. cmocka_unit_test(tpm2b_unmarshal_dest_null_offset_valid),
  393. cmocka_unit_test(tpm2b_unmarshal_buffer_size_lt_data_nad_lt_offset),
  394. cmocka_unit_test(tpm2b_public_rsa_marshal_success),
  395. cmocka_unit_test(tpm2b_public_rsa_unique_size_marshal_success),
  396. };
  397. return cmocka_run_group_tests(tests, NULL, NULL);
  398. }