| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/evp/m_md5_sha1.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | struct md5_sha1_ctx { | - | ||||||
| 7 | MD5_CTX md5; | - | ||||||
| 8 | SHA_CTX sha1; | - | ||||||
| 9 | }; | - | ||||||
| 10 | - | |||||||
| 11 | static int | - | ||||||
| 12 | md5_sha1_init(EVP_MD_CTX *ctx) | - | ||||||
| 13 | { | - | ||||||
| 14 | struct md5_sha1_ctx *mdctx = ctx->md_data; | - | ||||||
| 15 | - | |||||||
| 16 | if (!MD5_Init(&mdctx->md5)
| 0-85 | ||||||
| 17 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||
| 18 | if (!SHA1_Init(&mdctx->sha1)
| 0-85 | ||||||
| 19 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||
| 20 | - | |||||||
| 21 | return executed 85 times by 3 tests: 1;return 1;Executed by:
executed 85 times by 3 tests: return 1;Executed by:
| 85 | ||||||
| 22 | } | - | ||||||
| 23 | - | |||||||
| 24 | static int | - | ||||||
| 25 | md5_sha1_update(EVP_MD_CTX *ctx, const void *data, size_t count) | - | ||||||
| 26 | { | - | ||||||
| 27 | struct md5_sha1_ctx *mdctx = ctx->md_data; | - | ||||||
| 28 | - | |||||||
| 29 | if (!MD5_Update(&mdctx->md5, data, count)
| 0-563 | ||||||
| 30 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||
| 31 | if (!SHA1_Update(&mdctx->sha1, data, count)
| 0-563 | ||||||
| 32 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||
| 33 | - | |||||||
| 34 | return executed 563 times by 3 tests: 1;return 1;Executed by:
executed 563 times by 3 tests: return 1;Executed by:
| 563 | ||||||
| 35 | } | - | ||||||
| 36 | - | |||||||
| 37 | static int | - | ||||||
| 38 | md5_sha1_final(EVP_MD_CTX *ctx, unsigned char *out) | - | ||||||
| 39 | { | - | ||||||
| 40 | struct md5_sha1_ctx *mdctx = ctx->md_data; | - | ||||||
| 41 | - | |||||||
| 42 | if (!MD5_Final(out, &mdctx->md5)
| 0-209 | ||||||
| 43 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||
| 44 | if (!SHA1_Final(out + 16, &mdctx->sha1)
| 0-209 | ||||||
| 45 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||
| 46 | - | |||||||
| 47 | return executed 209 times by 3 tests: 1;return 1;Executed by:
executed 209 times by 3 tests: return 1;Executed by:
| 209 | ||||||
| 48 | } | - | ||||||
| 49 | - | |||||||
| 50 | static const EVP_MD md5_sha1_md = { | - | ||||||
| 51 | .type = 114, | - | ||||||
| 52 | .pkey_type = 114, | - | ||||||
| 53 | .md_size = 16 + 20, | - | ||||||
| 54 | .flags = 0, | - | ||||||
| 55 | .init = md5_sha1_init, | - | ||||||
| 56 | .update = md5_sha1_update, | - | ||||||
| 57 | .final = md5_sha1_final, | - | ||||||
| 58 | .block_size = 64, | - | ||||||
| 59 | .ctx_size = sizeof(EVP_MD *) + sizeof(struct md5_sha1_ctx), | - | ||||||
| 60 | - | |||||||
| 61 | .sign = (evp_sign_method *)RSA_sign, | - | ||||||
| 62 | .verify = (evp_verify_method *)RSA_verify, | - | ||||||
| 63 | .required_pkey_type = { | - | ||||||
| 64 | 6, 19, 0, 0, | - | ||||||
| 65 | }, | - | ||||||
| 66 | - | |||||||
| 67 | }; | - | ||||||
| 68 | - | |||||||
| 69 | const EVP_MD * | - | ||||||
| 70 | EVP_md5_sha1(void) | - | ||||||
| 71 | { | - | ||||||
| 72 | return executed 1105 times by 33 tests: &md5_sha1_md;return &md5_sha1_md;Executed by:
executed 1105 times by 33 tests: return &md5_sha1_md;Executed by:
| 1105 | ||||||
| 73 | } | - | ||||||
| Switch to Source code | Preprocessed file |