Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/p_sign.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, | - | ||||||
4 | unsigned int *siglen, EVP_PKEY *pkey) | - | ||||||
5 | { | - | ||||||
6 | unsigned char m[64]; | - | ||||||
7 | unsigned int m_len = 0; | - | ||||||
8 | int i = 0; | - | ||||||
9 | size_t sltmp; | - | ||||||
10 | EVP_PKEY_CTX *pkctx = | - | ||||||
11 | ((void *)0) | - | ||||||
12 | ; | - | ||||||
13 | - | |||||||
14 | *siglen = 0; | - | ||||||
15 | if (EVP_MD_CTX_test_flags(ctx, 0x0200)
| 0-12 | ||||||
16 | if (!EVP_DigestFinal_ex(ctx, m, &m_len)
| 0 | ||||||
17 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||
18 | } never executed: else {end of block | 0 | ||||||
19 | int rv = 0; | - | ||||||
20 | EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new(); | - | ||||||
21 | if (tmp_ctx ==
| 0-12 | ||||||
22 | ((void *)0)
| 0-12 | ||||||
23 | ) { | - | ||||||
24 | ERR_put_error(6,(107),((1|64)),__FILE__,34); | - | ||||||
25 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||
26 | } | - | ||||||
27 | rv = EVP_MD_CTX_copy_ex(tmp_ctx, ctx); | - | ||||||
28 | if (rv
| 0-12 | ||||||
29 | rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len); executed 12 times by 1 test: rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len); Executed by:
| 12 | ||||||
30 | EVP_MD_CTX_free(tmp_ctx); | - | ||||||
31 | if (!rv
| 0-12 | ||||||
32 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||
33 | } executed 12 times by 1 test: end of block Executed by:
| 12 | ||||||
34 | - | |||||||
35 | sltmp = (size_t)EVP_PKEY_size(pkey); | - | ||||||
36 | i = 0; | - | ||||||
37 | pkctx = EVP_PKEY_CTX_new(pkey, | - | ||||||
38 | ((void *)0) | - | ||||||
39 | ); | - | ||||||
40 | if (pkctx ==
| 0-12 | ||||||
41 | ((void *)0)
| 0-12 | ||||||
42 | ) | - | ||||||
43 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||
44 | if (EVP_PKEY_sign_init(pkctx) <= 0
| 0-12 | ||||||
45 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||
46 | if (EVP_PKEY_CTX_ctrl(pkctx, -1, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 1, 0, (void *)(EVP_MD_CTX_md(ctx))) <= 0
| 0-12 | ||||||
47 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||
48 | if (EVP_PKEY_sign(pkctx, sigret, &sltmp, m, m_len) <= 0
| 0-12 | ||||||
49 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||
50 | *siglen = sltmp; | - | ||||||
51 | i = 1; | - | ||||||
52 | err: code before this statement executed 12 times by 1 test: err: Executed by:
| 12 | ||||||
53 | EVP_PKEY_CTX_free(pkctx); | - | ||||||
54 | return executed 12 times by 1 test: i;return i; Executed by:
executed 12 times by 1 test: return i; Executed by:
| 12 | ||||||
55 | } | - | ||||||
Switch to Source code | Preprocessed file |