| 430 | } |
| 431 | |
| 432 | static cbm_test_result_oid_t te_oid(const te_ctx_t *c, const char *hex) { |
| 433 | cbm_test_result_oid_t oid = {0}; |
| 434 | if (!c->id || !hex || !hex[0]) { |
| 435 | return oid; |
| 436 | } |
| 437 | size_t bytes = c->id->oid_hex_length == 64 ? 32 : 20; |
| 438 | if (te_hex_bytes(hex, oid.bytes, bytes)) { |
| 439 | oid.format = bytes == 32 ? CBM_TEST_RESULT_OBJECT_SHA256 : CBM_TEST_RESULT_OBJECT_SHA1; |
| 440 | } else { |
| 441 | memset(oid.bytes, 0, sizeof(oid.bytes)); |
| 442 | } |
| 443 | return oid; |
| 444 | } |
| 445 | |
| 446 | static cbm_test_result_digest_t te_digest_hex(const char *hex) { |
| 447 | cbm_test_result_digest_t d = {0}; |
no test coverage detected