Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/ec/ec_check.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | int | - | ||||||||||||
3 | EC_GROUP_check(const EC_GROUP * group, BN_CTX * ctx) | - | ||||||||||||
4 | { | - | ||||||||||||
5 | int ret = 0; | - | ||||||||||||
6 | BIGNUM *order; | - | ||||||||||||
7 | BN_CTX *new_ctx = | - | ||||||||||||
8 | ((void *)0) | - | ||||||||||||
9 | ; | - | ||||||||||||
10 | EC_POINT *point = | - | ||||||||||||
11 | ((void *)0) | - | ||||||||||||
12 | ; | - | ||||||||||||
13 | - | |||||||||||||
14 | if (ctx ==
| 0-90 | ||||||||||||
15 | ((void *)0)
| 0-90 | ||||||||||||
16 | ) { | - | ||||||||||||
17 | ctx = new_ctx = BN_CTX_new(); | - | ||||||||||||
18 | if (ctx ==
| 0-90 | ||||||||||||
19 | ((void *)0)
| 0-90 | ||||||||||||
20 | ) { | - | ||||||||||||
21 | ERR_put_error(16,(0xfff),((1|64)),__FILE__,70); | - | ||||||||||||
22 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
23 | } | - | ||||||||||||
24 | } executed 90 times by 1 test: end of block Executed by:
| 90 | ||||||||||||
25 | BN_CTX_start(ctx); | - | ||||||||||||
26 | if ((
| 0-90 | ||||||||||||
27 | ((void *)0)
| 0-90 | ||||||||||||
28 | ) | - | ||||||||||||
29 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
30 | - | |||||||||||||
31 | - | |||||||||||||
32 | if (!EC_GROUP_check_discriminant(group, ctx)
| 0-90 | ||||||||||||
33 | ERR_put_error(16,(0xfff),(118),__FILE__,80); | - | ||||||||||||
34 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
35 | } | - | ||||||||||||
36 | - | |||||||||||||
37 | if (group->generator ==
| 0-90 | ||||||||||||
38 | ((void *)0)
| 0-90 | ||||||||||||
39 | ) { | - | ||||||||||||
40 | ERR_put_error(16,(0xfff),(113),__FILE__,85); | - | ||||||||||||
41 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
42 | } | - | ||||||||||||
43 | if (EC_POINT_is_on_curve(group, group->generator, ctx) <= 0
| 0-90 | ||||||||||||
44 | ERR_put_error(16,(0xfff),(107),__FILE__,89); | - | ||||||||||||
45 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
46 | } | - | ||||||||||||
47 | - | |||||||||||||
48 | if ((
| 0-90 | ||||||||||||
49 | ((void *)0)
| 0-90 | ||||||||||||
50 | ) | - | ||||||||||||
51 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
52 | if (!EC_GROUP_get_order(group, order, ctx)
| 0-90 | ||||||||||||
53 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
54 | if (((
| 0-90 | ||||||||||||
55 | ERR_put_error(16,(0xfff),(128),__FILE__,98); | - | ||||||||||||
56 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
57 | } | - | ||||||||||||
58 | if (!EC_POINT_mul(group, point, order,
| 0-90 | ||||||||||||
59 | ((void *)0)
| 0-90 | ||||||||||||
60 | ,
| 0-90 | ||||||||||||
61 | ((void *)0)
| 0-90 | ||||||||||||
62 | , ctx)
| 0-90 | ||||||||||||
63 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
64 | if (EC_POINT_is_at_infinity(group, point) <= 0
| 0-90 | ||||||||||||
65 | ERR_put_error(16,(0xfff),(122),__FILE__,104); | - | ||||||||||||
66 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
67 | } | - | ||||||||||||
68 | ret = 1; | - | ||||||||||||
69 | - | |||||||||||||
70 | err: code before this statement executed 90 times by 1 test: err: Executed by:
| 90 | ||||||||||||
71 | if (ctx !=
| 0-90 | ||||||||||||
72 | ((void *)0)
| 0-90 | ||||||||||||
73 | ) | - | ||||||||||||
74 | BN_CTX_end(ctx); executed 90 times by 1 test: BN_CTX_end(ctx); Executed by:
| 90 | ||||||||||||
75 | BN_CTX_free(new_ctx); | - | ||||||||||||
76 | EC_POINT_free(point); | - | ||||||||||||
77 | return executed 90 times by 1 test: ret;return ret; Executed by:
executed 90 times by 1 test: return ret; Executed by:
| 90 | ||||||||||||
78 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |