OpenCoverage

rsa_mp.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/rsa/rsa_mp.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2void rsa_multip_info_free_ex(RSA_PRIME_INFO *pinfo)-
3{-
4-
5 BN_clear_free(pinfo->pp);-
6 CRYPTO_free(pinfo, __FILE__, 19);-
7}
executed 8639 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8639
8-
9void rsa_multip_info_free(RSA_PRIME_INFO *pinfo)-
10{-
11-
12 BN_clear_free(pinfo->r);-
13 BN_clear_free(pinfo->d);-
14 BN_clear_free(pinfo->t);-
15 rsa_multip_info_free_ex(pinfo);-
16}
executed 8639 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8639
17-
18RSA_PRIME_INFO *rsa_multip_info_new(void)-
19{-
20 RSA_PRIME_INFO *pinfo;-
21-
22-
23 if ((
(pinfo = CRYPT...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pinfo = CRYPTO_zalloc(sizeof(RSA_PRIME_INFO), __FILE__, 36)) ==
(pinfo = CRYPT...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
24 ((void *)0)
(pinfo = CRYPT...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
25 ) {-
26 ERR_put_error(4,(166),((1|64)),__FILE__,37);-
27 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
28 ((void *)0)
never executed: return ((void *)0) ;
0
29 ;
never executed: return ((void *)0) ;
0
30 }-
31 if ((
(pinfo->r = BN...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pinfo->r = BN_secure_new()) ==
(pinfo->r = BN...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
32 ((void *)0)
(pinfo->r = BN...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
33 )-
34 goto
never executed: goto err;
err;
never executed: goto err;
0
35 if ((
(pinfo->d = BN...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pinfo->d = BN_secure_new()) ==
(pinfo->d = BN...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
36 ((void *)0)
(pinfo->d = BN...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
37 )-
38 goto
never executed: goto err;
err;
never executed: goto err;
0
39 if ((
(pinfo->t = BN...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pinfo->t = BN_secure_new()) ==
(pinfo->t = BN...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
40 ((void *)0)
(pinfo->t = BN...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
41 )-
42 goto
never executed: goto err;
err;
never executed: goto err;
0
43 if ((
(pinfo->pp = B...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pinfo->pp = BN_secure_new()) ==
(pinfo->pp = B...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
44 ((void *)0)
(pinfo->pp = B...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13
45 )-
46 goto
never executed: goto err;
err;
never executed: goto err;
0
47-
48 return
executed 13 times by 1 test: return pinfo;
Executed by:
  • libcrypto.so.1.1
pinfo;
executed 13 times by 1 test: return pinfo;
Executed by:
  • libcrypto.so.1.1
13
49-
50 err:-
51 BN_free(pinfo->r);-
52 BN_free(pinfo->d);-
53 BN_free(pinfo->t);-
54 BN_free(pinfo->pp);-
55 CRYPTO_free(pinfo, __FILE__, 56);-
56 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
57 ((void *)0)
never executed: return ((void *)0) ;
0
58 ;
never executed: return ((void *)0) ;
0
59}-
60-
61-
62int rsa_multip_calc_product(RSA *rsa)-
63{-
64 RSA_PRIME_INFO *pinfo;-
65 BIGNUM *p1 = -
66 ((void *)0)-
67 , *p2 = -
68 ((void *)0)-
69 ;-
70 BN_CTX *ctx = -
71 ((void *)0)-
72 ;-
73 int i, rv = 0, ex_primes;-
74-
75 if ((
(ex_primes = s...e_infos)) <= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 167 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ex_primes = sk_RSA_PRIME_INFO_num(rsa->prime_infos)) <= 0
(ex_primes = s...e_infos)) <= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 167 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-167
76-
77 goto
executed 2 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 2 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
2
78 }-
79-
80 if ((
(ctx = BN_CTX_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 167 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx = BN_CTX_new()) ==
(ctx = BN_CTX_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 167 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-167
81 ((void *)0)
(ctx = BN_CTX_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 167 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-167
82 )-
83 goto
never executed: goto err;
err;
never executed: goto err;
0
84-
85-
86 p1 = rsa->p;-
87 p2 = rsa->q;-
88-
89 for (i = 0; i < ex_primes
i < ex_primesDescription
TRUEevaluated 3947 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 167 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
167-3947
90 pinfo = sk_RSA_PRIME_INFO_value(rsa->prime_infos, i);-
91 if (pinfo->pp ==
pinfo->pp == ((void *)0)Description
TRUEevaluated 3946 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-3946
92 ((void *)0)
pinfo->pp == ((void *)0)Description
TRUEevaluated 3946 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-3946
93 ) {-
94 pinfo->pp = BN_secure_new();-
95 if (pinfo->pp ==
pinfo->pp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3946 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3946
96 ((void *)0)
pinfo->pp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3946 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3946
97 )-
98 goto
never executed: goto err;
err;
never executed: goto err;
0
99 }
executed 3946 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3946
100 if (!BN_mul(pinfo->pp, p1, p2, ctx)
!BN_mul(pinfo-..., p1, p2, ctx)Description
TRUEnever evaluated
FALSEevaluated 3947 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3947
101 goto
never executed: goto err;
err;
never executed: goto err;
0
102-
103 p1 = pinfo->pp;-
104 p2 = pinfo->r;-
105 }
executed 3947 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3947
106-
107 rv = 1;-
108 err:
code before this statement executed 167 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
167
109 BN_CTX_free(ctx);-
110 return
executed 169 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
rv;
executed 169 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
169
111}-
112-
113int rsa_multip_cap(int bits)-
114{-
115 int cap = 5;-
116-
117 if (bits < 1024
bits < 1024Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-23
118 cap = 2;
executed 3 times by 1 test: cap = 2;
Executed by:
  • libcrypto.so.1.1
3
119 else if (bits < 4096
bits < 4096Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8-15
120 cap = 3;
executed 15 times by 1 test: cap = 3;
Executed by:
  • libcrypto.so.1.1
15
121 else if (bits < 8192
bits < 8192Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4
122 cap = 4;
executed 4 times by 1 test: cap = 4;
Executed by:
  • libcrypto.so.1.1
4
123-
124 if (cap > 5
cap > 5Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-26
125 cap = 5;
never executed: cap = 5;
0
126-
127 return
executed 26 times by 1 test: return cap;
Executed by:
  • libcrypto.so.1.1
cap;
executed 26 times by 1 test: return cap;
Executed by:
  • libcrypto.so.1.1
26
128}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2