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