Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/p_open.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | - | |||||||||||||||||||
4 | - | |||||||||||||||||||
5 | - | |||||||||||||||||||
6 | - | |||||||||||||||||||
7 | - | |||||||||||||||||||
8 | - | |||||||||||||||||||
9 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | - | ||||||||||||||||||
10 | const unsigned char *ek, int ekl, const unsigned char *iv, | - | ||||||||||||||||||
11 | EVP_PKEY *priv) | - | ||||||||||||||||||
12 | { | - | ||||||||||||||||||
13 | unsigned char *key = | - | ||||||||||||||||||
14 | ((void *)0) | - | ||||||||||||||||||
15 | ; | - | ||||||||||||||||||
16 | int i, size = 0, ret = 0; | - | ||||||||||||||||||
17 | - | |||||||||||||||||||
18 | if (type
| 0-1 | ||||||||||||||||||
19 | EVP_CIPHER_CTX_reset(ctx); | - | ||||||||||||||||||
20 | if (!EVP_DecryptInit_ex(ctx, type,
| 0-1 | ||||||||||||||||||
21 | ((void *)0)
| 0-1 | ||||||||||||||||||
22 | ,
| 0-1 | ||||||||||||||||||
23 | ((void *)0)
| 0-1 | ||||||||||||||||||
24 | ,
| 0-1 | ||||||||||||||||||
25 | ((void *)0)
| 0-1 | ||||||||||||||||||
26 | )
| 0-1 | ||||||||||||||||||
27 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||
28 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||
29 | - | |||||||||||||||||||
30 | if (!priv
| 0-1 | ||||||||||||||||||
31 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||
32 | - | |||||||||||||||||||
33 | if (EVP_PKEY_id(priv) != 6
| 0-1 | ||||||||||||||||||
34 | ERR_put_error(6,(102),(106),__FILE__,38); | - | ||||||||||||||||||
35 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
36 | } | - | ||||||||||||||||||
37 | - | |||||||||||||||||||
38 | size = EVP_PKEY_size(priv); | - | ||||||||||||||||||
39 | key = CRYPTO_malloc(size + 2, __FILE__, 43); | - | ||||||||||||||||||
40 | if (key ==
| 0-1 | ||||||||||||||||||
41 | ((void *)0)
| 0-1 | ||||||||||||||||||
42 | ) { | - | ||||||||||||||||||
43 | - | |||||||||||||||||||
44 | ERR_put_error(6,(102),((1|64)),__FILE__,46); | - | ||||||||||||||||||
45 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
46 | } | - | ||||||||||||||||||
47 | - | |||||||||||||||||||
48 | i = EVP_PKEY_decrypt_old(key, ek, ekl, priv); | - | ||||||||||||||||||
49 | if ((
| 0-1 | ||||||||||||||||||
50 | - | |||||||||||||||||||
51 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
52 | } | - | ||||||||||||||||||
53 | if (!EVP_DecryptInit_ex(ctx,
| 0-1 | ||||||||||||||||||
54 | ((void *)0)
| 0-1 | ||||||||||||||||||
55 | ,
| 0-1 | ||||||||||||||||||
56 | ((void *)0)
| 0-1 | ||||||||||||||||||
57 | , key, iv)
| 0-1 | ||||||||||||||||||
58 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
59 | - | |||||||||||||||||||
60 | ret = 1; | - | ||||||||||||||||||
61 | err: code before this statement executed 1 time by 1 test: err: Executed by:
| 1 | ||||||||||||||||||
62 | CRYPTO_clear_free(key, size, __FILE__, 60); | - | ||||||||||||||||||
63 | return executed 1 time by 1 test: ret;return ret; Executed by:
executed 1 time by 1 test: return ret; Executed by:
| 1 | ||||||||||||||||||
64 | } | - | ||||||||||||||||||
65 | - | |||||||||||||||||||
66 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | - | ||||||||||||||||||
67 | { | - | ||||||||||||||||||
68 | int i; | - | ||||||||||||||||||
69 | - | |||||||||||||||||||
70 | i = EVP_DecryptFinal_ex(ctx, out, outl); | - | ||||||||||||||||||
71 | if (i
| 0-1 | ||||||||||||||||||
72 | i = EVP_DecryptInit_ex(ctx, executed 1 time by 1 test: i = EVP_DecryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); Executed by:
| 1 | ||||||||||||||||||
73 | ((void *)0) executed 1 time by 1 test: i = EVP_DecryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); Executed by:
| 1 | ||||||||||||||||||
74 | , executed 1 time by 1 test: i = EVP_DecryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); Executed by:
| 1 | ||||||||||||||||||
75 | ((void *)0) executed 1 time by 1 test: i = EVP_DecryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); Executed by:
| 1 | ||||||||||||||||||
76 | , executed 1 time by 1 test: i = EVP_DecryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); Executed by:
| 1 | ||||||||||||||||||
77 | ((void *)0) executed 1 time by 1 test: i = EVP_DecryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); Executed by:
| 1 | ||||||||||||||||||
78 | , executed 1 time by 1 test: i = EVP_DecryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); Executed by:
| 1 | ||||||||||||||||||
79 | ((void *)0) executed 1 time by 1 test: i = EVP_DecryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); Executed by:
| 1 | ||||||||||||||||||
80 | ); executed 1 time by 1 test: i = EVP_DecryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) ); Executed by:
| 1 | ||||||||||||||||||
81 | return executed 1 time by 1 test: i;return i; Executed by:
executed 1 time by 1 test: return i; Executed by:
| 1 | ||||||||||||||||||
82 | } | - | ||||||||||||||||||
Switch to Source code | Preprocessed file |