OpenCoverage

rsa_ameth.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/rsa/rsa_ameth.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4static int rsa_cms_sign(CMS_SignerInfo *si);-
5static int rsa_cms_verify(CMS_SignerInfo *si);-
6static int rsa_cms_decrypt(CMS_RecipientInfo *ri);-
7static int rsa_cms_encrypt(CMS_RecipientInfo *ri);-
8-
9-
10static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg);-
11-
12-
13static int rsa_param_encode(const EVP_PKEY *pkey,-
14 ASN1_STRING **pstr, int *pstrtype)-
15{-
16 const RSA *rsa = pkey->pkey.rsa;-
17-
18 *pstr = -
19 ((void *)0)-
20 ;-
21-
22 if (pkey->ameth->pkey_id == 6
pkey->ameth->pkey_id == 6Description
TRUEevaluated 1692 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1692
23 *pstrtype = 5;-
24 return
executed 1692 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1692 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1692
25 }-
26-
27 if (rsa->pss ==
rsa->pss == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
28 ((void *)0)
rsa->pss == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
29 ) {-
30 *pstrtype = -1;-
31 return
never executed: return 1;
1;
never executed: return 1;
0
32 }-
33-
34 if (ASN1_item_pack(rsa->pss, (&(RSA_PSS_PARAMS_it)), pstr) ==
ASN1_item_pack...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
35 ((void *)0)
ASN1_item_pack...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
36 )-
37 return
never executed: return 0;
0;
never executed: return 0;
0
38-
39 *pstrtype = 16;-
40 return
never executed: return 1;
1;
never executed: return 1;
0
41}-
42-
43static int rsa_param_decode(RSA *rsa, const X509_ALGOR *alg)-
44{-
45 const ASN1_OBJECT *algoid;-
46 const void *algp;-
47 int algptype;-
48-
49 X509_ALGOR_get0(&algoid, &algptype, &algp, alg);-
50 if (OBJ_obj2nid(algoid) == 6
OBJ_obj2nid(algoid) == 6Description
TRUEevaluated 12305 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 58 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
58-12305
51 return
executed 12305 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 12305 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
12305
52 if (algptype == -1
algptype == -1Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
22-36
53 return
executed 22 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 22 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
22
54 if (algptype != 16
algptype != 16Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8-28
55 ERR_put_error(4,(164),(149),__FILE__,66);-
56 return
executed 28 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 28 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
28
57 }-
58 rsa->pss = rsa_pss_decode(alg);-
59 if (rsa->pss ==
rsa->pss == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-7
60 ((void *)0)
rsa->pss == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-7
61 )-
62 return
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1
63 return
executed 7 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 7 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
7
64}-
65-
66static int rsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)-
67{-
68 unsigned char *penc = -
69 ((void *)0)-
70 ;-
71 int penclen;-
72 ASN1_STRING *str;-
73 int strtype;-
74-
75 if (!rsa_param_encode(pkey, &str, &strtype)
!rsa_param_enc...str, &strtype)Description
TRUEnever evaluated
FALSEevaluated 1676 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1676
76 return
never executed: return 0;
0;
never executed: return 0;
0
77 penclen = i2d_RSAPublicKey(pkey->pkey.rsa, &penc);-
78 if (penclen <= 0
penclen <= 0Description
TRUEnever evaluated
FALSEevaluated 1676 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1676
79 return
never executed: return 0;
0;
never executed: return 0;
0
80 if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(pkey->ameth->pkey_id),
X509_PUBKEY_se...penc, penclen)Description
TRUEevaluated 1676 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1676
81 strtype, str, penc, penclen)
X509_PUBKEY_se...penc, penclen)Description
TRUEevaluated 1676 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-1676
82 return
executed 1676 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1676 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1676
83-
84 CRYPTO_free(penc, __FILE__, 91);-
85 return
never executed: return 0;
0;
never executed: return 0;
0
86}-
87-
88static int rsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)-
89{-
90 const unsigned char *p;-
91 int pklen;-
92 X509_ALGOR *alg;-
93 RSA *rsa = -
94 ((void *)0)-
95 ;-
96-
97 if (!X509_PUBKEY_get0_param(
!X509_PUBKEY_g... &alg, pubkey)Description
TRUEnever evaluated
FALSEevaluated 11012 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-11012
98 ((void *)0)
!X509_PUBKEY_g... &alg, pubkey)Description
TRUEnever evaluated
FALSEevaluated 11012 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-11012
99 , &p, &pklen, &alg, pubkey)
!X509_PUBKEY_g... &alg, pubkey)Description
TRUEnever evaluated
FALSEevaluated 11012 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11012
100 return
never executed: return 0;
0;
never executed: return 0;
0
101 if ((
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10635 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
rsa = d2i_RSAPublicKey(
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10635 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
377-10635
102 ((void *)0)
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10635 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
377-10635
103 , &p, pklen)) ==
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10635 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
377-10635
104 ((void *)0)
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10635 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
377-10635
105 ) {-
106 ERR_put_error(4,(139),(4),__FILE__,105);-
107 return
executed 377 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 377 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
377
108 }-
109 if (!rsa_param_decode(rsa, alg)
!rsa_param_decode(rsa, alg)Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10606 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
29-10606
110 RSA_free(rsa);-
111 return
executed 29 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 29 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
29
112 }-
113 EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa);-
114 return
executed 10606 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 10606 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
10606
115}-
116-
117static int rsa_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b)-
118{-
119 if (BN_cmp(b->pkey.rsa->n, a->pkey.rsa->n) != 0
BN_cmp(b->pkey...y.rsa->n) != 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4533 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-4533
120 || BN_cmp(b->pkey.rsa->e, a->pkey.rsa->e) != 0
BN_cmp(b->pkey...y.rsa->e) != 0Description
TRUEnever evaluated
FALSEevaluated 4533 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4533
121 return
executed 3 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 3 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
3
122 return
executed 4533 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 4533 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4533
123}-
124-
125static int old_rsa_priv_decode(EVP_PKEY *pkey,-
126 const unsigned char **pder, int derlen)-
127{-
128 RSA *rsa;-
129-
130 if ((
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 2334 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 645 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
rsa = d2i_RSAPrivateKey(
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 2334 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 645 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
645-2334
131 ((void *)0)
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 2334 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 645 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
645-2334
132 , pder, derlen)) ==
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 2334 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 645 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
645-2334
133 ((void *)0)
(rsa = d2i_RSA...== ((void *)0)Description
TRUEevaluated 2334 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 645 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
645-2334
134 ) {-
135 ERR_put_error(4,(147),(4),__FILE__,130);-
136 return
executed 2334 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 2334 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
2334
137 }-
138 EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa);-
139 return
executed 645 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 645 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
645
140}-
141-
142static int old_rsa_priv_encode(const EVP_PKEY *pkey, unsigned char **pder)-
143{-
144 return
executed 95 times by 1 test: return i2d_RSAPrivateKey(pkey->pkey.rsa, pder);
Executed by:
  • libcrypto.so.1.1
i2d_RSAPrivateKey(pkey->pkey.rsa, pder);
executed 95 times by 1 test: return i2d_RSAPrivateKey(pkey->pkey.rsa, pder);
Executed by:
  • libcrypto.so.1.1
95
145}-
146-
147static int rsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)-
148{-
149 unsigned char *rk = -
150 ((void *)0)-
151 ;-
152 int rklen;-
153 ASN1_STRING *str;-
154 int strtype;-
155-
156 if (!rsa_param_encode(pkey, &str, &strtype)
!rsa_param_enc...str, &strtype)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-16
157 return
never executed: return 0;
0;
never executed: return 0;
0
158 rklen = i2d_RSAPrivateKey(pkey->pkey.rsa, &rk);-
159-
160 if (rklen <= 0
rklen <= 0Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-16
161 ERR_put_error(4,(138),((1|64)),__FILE__,154);-
162 ASN1_STRING_free(str);-
163 return
never executed: return 0;
0;
never executed: return 0;
0
164 }-
165-
166 if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(pkey->ameth->pkey_id), 0,
!PKCS8_pkey_se...tr, rk, rklen)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16
167 strtype, str, rk, rklen)
!PKCS8_pkey_se...tr, rk, rklen)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-16
168 ERR_put_error(4,(138),((1|64)),__FILE__,161);-
169 ASN1_STRING_free(str);-
170 return
never executed: return 0;
0;
never executed: return 0;
0
171 }-
172-
173 return
executed 16 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 16 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
16
174}-
175-
176static int rsa_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8)-
177{-
178 const unsigned char *p;-
179 RSA *rsa;-
180 int pklen;-
181 const X509_ALGOR *alg;-
182-
183 if (!PKCS8_pkey_get0(
!PKCS8_pkey_ge...len, &alg, p8)Description
TRUEnever evaluated
FALSEevaluated 1729 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1729
184 ((void *)0)
!PKCS8_pkey_ge...len, &alg, p8)Description
TRUEnever evaluated
FALSEevaluated 1729 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1729
185 , &p, &pklen, &alg, p8)
!PKCS8_pkey_ge...len, &alg, p8)Description
TRUEnever evaluated
FALSEevaluated 1729 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1729
186 return
never executed: return 0;
0;
never executed: return 0;
0
187 rsa = d2i_RSAPrivateKey(-
188 ((void *)0)-
189 , &p, pklen);-
190 if (rsa ==
rsa == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1728 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-1728
191 ((void *)0)
rsa == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1728 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-1728
192 ) {-
193 ERR_put_error(4,(150),(4),__FILE__,180);-
194 return
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1
195 }-
196 if (!rsa_param_decode(rsa, alg)
!rsa_param_decode(rsa, alg)Description
TRUEnever evaluated
FALSEevaluated 1728 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1728
197 RSA_free(rsa);-
198 return
never executed: return 0;
0;
never executed: return 0;
0
199 }-
200 EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa);-
201 return
executed 1728 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1728 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1728
202}-
203-
204static int int_rsa_size(const EVP_PKEY *pkey)-
205{-
206 return
executed 7980 times by 1 test: return RSA_size(pkey->pkey.rsa);
Executed by:
  • libcrypto.so.1.1
RSA_size(pkey->pkey.rsa);
executed 7980 times by 1 test: return RSA_size(pkey->pkey.rsa);
Executed by:
  • libcrypto.so.1.1
7980
207}-
208-
209static int rsa_bits(const EVP_PKEY *pkey)-
210{-
211 return
executed 234 times by 1 test: return BN_num_bits(pkey->pkey.rsa->n);
Executed by:
  • libcrypto.so.1.1
BN_num_bits(pkey->pkey.rsa->n);
executed 234 times by 1 test: return BN_num_bits(pkey->pkey.rsa->n);
Executed by:
  • libcrypto.so.1.1
234
212}-
213-
214static int rsa_security_bits(const EVP_PKEY *pkey)-
215{-
216 return
executed 8547 times by 1 test: return RSA_security_bits(pkey->pkey.rsa);
Executed by:
  • libcrypto.so.1.1
RSA_security_bits(pkey->pkey.rsa);
executed 8547 times by 1 test: return RSA_security_bits(pkey->pkey.rsa);
Executed by:
  • libcrypto.so.1.1
8547
217}-
218-
219static void int_rsa_free(EVP_PKEY *pkey)-
220{-
221 RSA_free(pkey->pkey.rsa);-
222}
executed 17571 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
17571
223-
224static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg)-
225{-
226 if (OBJ_obj2nid(alg->algorithm) != 911
OBJ_obj2nid(al...orithm) != 911Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 56 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7-56
227 return
executed 7 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 7 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
7
228 ((void *)0)
executed 7 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
7
229 ;
executed 7 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
7
230 return
executed 56 times by 1 test: return ASN1_TYPE_unpack_sequence((&(X509_ALGOR_it)), alg->parameter);
Executed by:
  • libcrypto.so.1.1
ASN1_TYPE_unpack_sequence((&(X509_ALGOR_it)),
executed 56 times by 1 test: return ASN1_TYPE_unpack_sequence((&(X509_ALGOR_it)), alg->parameter);
Executed by:
  • libcrypto.so.1.1
56
231 alg->parameter);
executed 56 times by 1 test: return ASN1_TYPE_unpack_sequence((&(X509_ALGOR_it)), alg->parameter);
Executed by:
  • libcrypto.so.1.1
56
232}-
233-
234static int rsa_pss_param_print(BIO *bp, int pss_key, RSA_PSS_PARAMS *pss,-
235 int indent)-
236{-
237 int rv = 0;-
238 X509_ALGOR *maskHash = -
239 ((void *)0)-
240 ;-
241-
242 if (!BIO_indent(bp, indent, 128)
!BIO_indent(bp, indent, 128)Description
TRUEnever evaluated
FALSEevaluated 195 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-195
243 goto
never executed: goto err;
err;
never executed: goto err;
0
244 if (pss_key
pss_keyDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-193
245 if (pss ==
pss == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1
246 ((void *)0)
pss == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1
247 ) {-
248 if (BIO_puts(bp, "No PSS parameter restrictions\n") <= 0
BIO_puts(bp, "...tions\n") <= 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
249 return
never executed: return 0;
0;
never executed: return 0;
0
250 return
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1
251 } else {-
252 if (BIO_puts(bp, "PSS parameter restrictions:") <= 0
BIO_puts(bp, "...ctions:") <= 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
253 return
never executed: return 0;
0;
never executed: return 0;
0
254 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
255 } else if (pss ==
pss == ((void *)0)Description
TRUEevaluated 154 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
39-154
256 ((void *)0)
pss == ((void *)0)Description
TRUEevaluated 154 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
39-154
257 ) {-
258 if (BIO_puts(bp,"(INVALID PSS PARAMETERS)\n") <= 0
BIO_puts(bp,"(...TERS)\n") <= 0Description
TRUEnever evaluated
FALSEevaluated 154 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-154
259 return
never executed: return 0;
0;
never executed: return 0;
0
260 return
executed 154 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 154 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
154
261 }-
262 if (BIO_puts(bp, "\n") <= 0
BIO_puts(bp, "\n") <= 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
263 goto
never executed: goto err;
err;
never executed: goto err;
0
264 if (pss_key
pss_keyDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-39
265 indent += 2;
executed 1 time by 1 test: indent += 2;
Executed by:
  • libcrypto.so.1.1
1
266 if (!BIO_indent(bp, indent, 128)
!BIO_indent(bp, indent, 128)Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
267 goto
never executed: goto err;
err;
never executed: goto err;
0
268 if (BIO_puts(bp, "Hash Algorithm: ") <= 0
BIO_puts(bp, "...rithm: ") <= 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
269 goto
never executed: goto err;
err;
never executed: goto err;
0
270-
271 if (pss->hashAlgorithm
pss->hashAlgorithmDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
10-30
272 if (i2a_ASN1_OBJECT(bp, pss->hashAlgorithm->algorithm) <= 0
i2a_ASN1_OBJEC...lgorithm) <= 0Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-10
273 goto
never executed: goto err;
err;
never executed: goto err;
0
274 }
executed 10 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (BIO_puts(bp, "sha1 (default)") <= 0
BIO_puts(bp, "...efault)") <= 0Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-30
275 goto
never executed: goto err;
err;
never executed: goto err;
0
276 }-
277-
278 if (BIO_puts(bp, "\n") <= 0
BIO_puts(bp, "\n") <= 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
279 goto
never executed: goto err;
err;
never executed: goto err;
0
280-
281 if (!BIO_indent(bp, indent, 128)
!BIO_indent(bp, indent, 128)Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
282 goto
never executed: goto err;
err;
never executed: goto err;
0
283-
284 if (BIO_puts(bp, "Mask Algorithm: ") <= 0
BIO_puts(bp, "...rithm: ") <= 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
285 goto
never executed: goto err;
err;
never executed: goto err;
0
286 if (pss->maskGenAlgorithm
pss->maskGenAlgorithmDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
20
287 if (i2a_ASN1_OBJECT(bp, pss->maskGenAlgorithm->algorithm) <= 0
i2a_ASN1_OBJEC...lgorithm) <= 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-20
288 goto
never executed: goto err;
err;
never executed: goto err;
0
289 if (BIO_puts(bp, " with ") <= 0
BIO_puts(bp, " with ") <= 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-20
290 goto
never executed: goto err;
err;
never executed: goto err;
0
291 maskHash = rsa_mgf1_decode(pss->maskGenAlgorithm);-
292 if (maskHash !=
maskHash != ((void *)0)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-20
293 ((void *)0)
maskHash != ((void *)0)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-20
294 ) {-
295 if (i2a_ASN1_OBJECT(bp, maskHash->algorithm) <= 0
i2a_ASN1_OBJEC...lgorithm) <= 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-20
296 goto
never executed: goto err;
err;
never executed: goto err;
0
297 }
executed 20 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (BIO_puts(bp, "INVALID") <= 0
BIO_puts(bp, "INVALID") <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-20
298 goto
never executed: goto err;
err;
never executed: goto err;
0
299 }-
300 }
executed 20 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (BIO_puts(bp, "mgf1 with sha1 (default)") <= 0
BIO_puts(bp, "...efault)") <= 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-20
301 goto
never executed: goto err;
err;
never executed: goto err;
0
302 }-
303 BIO_puts(bp, "\n");-
304-
305 if (!BIO_indent(bp, indent, 128)
!BIO_indent(bp, indent, 128)Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
306 goto
never executed: goto err;
err;
never executed: goto err;
0
307 if (BIO_printf(bp, "%s Salt Length: 0x", pss_key ? "Minimum" : "") <= 0
BIO_printf(bp,...um" : "") <= 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
308 goto
never executed: goto err;
err;
never executed: goto err;
0
309 if (pss->saltLength
pss->saltLengthDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
6-34
310 if (i2a_ASN1_INTEGER(bp, pss->saltLength) <= 0
i2a_ASN1_INTEG...ltLength) <= 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6
311 goto
never executed: goto err;
err;
never executed: goto err;
0
312 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (BIO_puts(bp, "14 (default)") <= 0
BIO_puts(bp, "...efault)") <= 0Description
TRUEnever evaluated
FALSEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-34
313 goto
never executed: goto err;
err;
never executed: goto err;
0
314 }-
315 BIO_puts(bp, "\n");-
316-
317 if (!BIO_indent(bp, indent, 128)
!BIO_indent(bp, indent, 128)Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
318 goto
never executed: goto err;
err;
never executed: goto err;
0
319 if (BIO_puts(bp, "Trailer Field: 0x") <= 0
BIO_puts(bp, "...eld: 0x") <= 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-40
320 goto
never executed: goto err;
err;
never executed: goto err;
0
321 if (pss->trailerField
pss->trailerFieldDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
6-34
322 if (i2a_ASN1_INTEGER(bp, pss->trailerField) <= 0
i2a_ASN1_INTEG...lerField) <= 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6
323 goto
never executed: goto err;
err;
never executed: goto err;
0
324 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (BIO_puts(bp, "BC (default)") <= 0
BIO_puts(bp, "...efault)") <= 0Description
TRUEnever evaluated
FALSEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-34
325 goto
never executed: goto err;
err;
never executed: goto err;
0
326 }-
327 BIO_puts(bp, "\n");-
328-
329 rv = 1;-
330-
331 err:
code before this statement executed 40 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
40
332 X509_ALGOR_free(maskHash);-
333 return
executed 40 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
rv;
executed 40 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
40
334-
335}-
336-
337static int pkey_rsa_print(BIO *bp, const EVP_PKEY *pkey, int off, int priv)-
338{-
339 const RSA *x = pkey->pkey.rsa;-
340 char *str;-
341 const char *s;-
342 int ret = 0, mod_len = 0, ex_primes;-
343-
344 if (x->n !=
x->n != ((void *)0)Description
TRUEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-274
345 ((void *)0)
x->n != ((void *)0)Description
TRUEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-274
346 )-
347 mod_len = BN_num_bits(x->n);
executed 274 times by 1 test: mod_len = BN_num_bits(x->n);
Executed by:
  • libcrypto.so.1.1
274
348 ex_primes = sk_RSA_PRIME_INFO_num(x->prime_infos);-
349-
350 if (!BIO_indent(bp, off, 128)
!BIO_indent(bp, off, 128)Description
TRUEnever evaluated
FALSEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-274
351 goto
never executed: goto err;
err;
never executed: goto err;
0
352-
353 if (BIO_printf(bp, "%s ", (pkey->ameth->pkey_id == 912) ? "RSA-PSS" : "RSA") <= 0
BIO_printf(bp,... : "RSA") <= 0Description
TRUEnever evaluated
FALSEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-274
354 goto
never executed: goto err;
err;
never executed: goto err;
0
355-
356 if (priv
privDescription
TRUEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 174 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& x->d
x->dDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
10-174
357 if (BIO_printf(bp, "Private-Key: (%d bit, %d primes)\n",
BIO_printf(bp,...imes + 2) <= 0Description
TRUEnever evaluated
FALSEevaluated 90 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-90
358 mod_len, ex_primes <= 0 ? 2 : ex_primes + 2) <= 0
BIO_printf(bp,...imes + 2) <= 0Description
TRUEnever evaluated
FALSEevaluated 90 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-90
359 goto
never executed: goto err;
err;
never executed: goto err;
0
360 str = "modulus:";-
361 s = "publicExponent:";-
362 }
executed 90 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
90
363 if (BIO_printf(bp, "Public-Key: (%d bit)\n", mod_len) <= 0
BIO_printf(bp,... mod_len) <= 0Description
TRUEnever evaluated
FALSEevaluated 184 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-184
364 goto
never executed: goto err;
err;
never executed: goto err;
0
365 str = "Modulus:";-
366 s = "Exponent:";-
367 }
executed 184 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
184
368 if (!ASN1_bn_print(bp, str, x->n,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-274
369 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-274
370 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-274
371 goto
never executed: goto err;
err;
never executed: goto err;
0
372 if (!ASN1_bn_print(bp, s, x->e,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-274
373 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-274
374 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-274
375 goto
never executed: goto err;
err;
never executed: goto err;
0
376 if (priv
privDescription
TRUEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 174 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
100-174
377 int i;-
378-
379 if (!ASN1_bn_print(bp, "privateExponent:", x->d,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
380 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
381 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-100
382 goto
never executed: goto err;
err;
never executed: goto err;
0
383 if (!ASN1_bn_print(bp, "prime1:", x->p,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
384 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
385 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-100
386 goto
never executed: goto err;
err;
never executed: goto err;
0
387 if (!ASN1_bn_print(bp, "prime2:", x->q,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
388 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
389 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-100
390 goto
never executed: goto err;
err;
never executed: goto err;
0
391 if (!ASN1_bn_print(bp, "exponent1:", x->dmp1,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
392 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
393 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-100
394 goto
never executed: goto err;
err;
never executed: goto err;
0
395 if (!ASN1_bn_print(bp, "exponent2:", x->dmq1,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
396 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
397 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-100
398 goto
never executed: goto err;
err;
never executed: goto err;
0
399 if (!ASN1_bn_print(bp, "coefficient:", x->iqmp,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
400 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
401 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-100
402 goto
never executed: goto err;
err;
never executed: goto err;
0
403 for (i = 0; i < sk_RSA_PRIME_INFO_num(x->prime_infos)
i < sk_RSA_PRI...->prime_infos)Description
TRUEevaluated 3459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
100-3459
404-
405 BIGNUM *bn = -
406 ((void *)0)-
407 ;-
408 RSA_PRIME_INFO *pinfo;-
409 int j;-
410-
411 pinfo = sk_RSA_PRIME_INFO_value(x->prime_infos, i);-
412 for (j = 0; j < 3
j < 3Description
TRUEevaluated 10377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
3459-10377
413 if (!BIO_indent(bp, off, 128)
!BIO_indent(bp, off, 128)Description
TRUEnever evaluated
FALSEevaluated 10377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-10377
414 goto
never executed: goto err;
err;
never executed: goto err;
0
415 switch (j) {-
416 case
executed 3459 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
0:
executed 3459 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
3459
417 if (BIO_printf(bp, "prime%d:", i + 3) <= 0
BIO_printf(bp,...", i + 3) <= 0Description
TRUEnever evaluated
FALSEevaluated 3459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3459
418 goto
never executed: goto err;
err;
never executed: goto err;
0
419 bn = pinfo->r;-
420 break;
executed 3459 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
3459
421 case
executed 3459 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 3459 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
3459
422 if (BIO_printf(bp, "exponent%d:", i + 3) <= 0
BIO_printf(bp,...", i + 3) <= 0Description
TRUEnever evaluated
FALSEevaluated 3459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3459
423 goto
never executed: goto err;
err;
never executed: goto err;
0
424 bn = pinfo->d;-
425 break;
executed 3459 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
3459
426 case
executed 3459 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
2:
executed 3459 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
3459
427 if (BIO_printf(bp, "coefficient%d:", i + 3) <= 0
BIO_printf(bp,...", i + 3) <= 0Description
TRUEnever evaluated
FALSEevaluated 3459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3459
428 goto
never executed: goto err;
err;
never executed: goto err;
0
429 bn = pinfo->t;-
430 break;
executed 3459 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
3459
431 default
never executed: default:
:
never executed: default:
0
432 break;
never executed: break;
0
433 }-
434 if (!ASN1_bn_print(bp, "", bn,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 10377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10377
435 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 10377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10377
436 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 10377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-10377
437 goto
never executed: goto err;
err;
never executed: goto err;
0
438 }
executed 10377 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
10377
439 }
executed 3459 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3459
440 }
executed 100 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
100
441 if ((
(pkey->ameth->pkey_id == 912)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 272 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pkey->ameth->pkey_id == 912)
(pkey->ameth->pkey_id == 912)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 272 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !rsa_pss_param_print(bp, 1, x->pss, off)
!rsa_pss_param..., x->pss, off)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-272
442 goto
never executed: goto err;
err;
never executed: goto err;
0
443 ret = 1;-
444 err:
code before this statement executed 274 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
274
445 return
executed 274 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 274 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
274
446}-
447-
448static int rsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent,-
449 ASN1_PCTX *ctx)-
450{-
451 return
executed 174 times by 1 test: return pkey_rsa_print(bp, pkey, indent, 0);
Executed by:
  • libcrypto.so.1.1
pkey_rsa_print(bp, pkey, indent, 0);
executed 174 times by 1 test: return pkey_rsa_print(bp, pkey, indent, 0);
Executed by:
  • libcrypto.so.1.1
174
452}-
453-
454static int rsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,-
455 ASN1_PCTX *ctx)-
456{-
457 return
executed 100 times by 1 test: return pkey_rsa_print(bp, pkey, indent, 1);
Executed by:
  • libcrypto.so.1.1
pkey_rsa_print(bp, pkey, indent, 1);
executed 100 times by 1 test: return pkey_rsa_print(bp, pkey, indent, 1);
Executed by:
  • libcrypto.so.1.1
100
458}-
459-
460static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg)-
461{-
462 RSA_PSS_PARAMS *pss;-
463-
464 pss = ASN1_TYPE_unpack_sequence((&(RSA_PSS_PARAMS_it)),-
465 alg->parameter);-
466-
467 if (pss ==
pss == ((void *)0)Description
TRUEevaluated 179 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
74-179
468 ((void *)0)
pss == ((void *)0)Description
TRUEevaluated 179 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
74-179
469 )-
470 return
executed 179 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 179 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
179
471 ((void *)0)
executed 179 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
179
472 ;
executed 179 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
179
473-
474 if (pss->maskGenAlgorithm !=
pss->maskGenAl...!= ((void *)0)Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
32-42
475 ((void *)0)
pss->maskGenAl...!= ((void *)0)Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
32-42
476 ) {-
477 pss->maskHash = rsa_mgf1_decode(pss->maskGenAlgorithm);-
478 if (pss->maskHash ==
pss->maskHash == ((void *)0)Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 27 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
15-27
479 ((void *)0)
pss->maskHash == ((void *)0)Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 27 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
15-27
480 ) {-
481 RSA_PSS_PARAMS_free(pss);-
482 return
executed 15 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 15 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
15
483 ((void *)0)
executed 15 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
15
484 ;
executed 15 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
15
485 }-
486 }
executed 27 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
27
487-
488 return
executed 59 times by 1 test: return pss;
Executed by:
  • libcrypto.so.1.1
pss;
executed 59 times by 1 test: return pss;
Executed by:
  • libcrypto.so.1.1
59
489}-
490-
491static int rsa_sig_print(BIO *bp, const X509_ALGOR *sigalg,-
492 const ASN1_STRING *sig, int indent, ASN1_PCTX *pctx)-
493{-
494 if (OBJ_obj2nid(sigalg->algorithm) == 912
OBJ_obj2nid(si...orithm) == 912Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 665 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
193-665
495 int rv;-
496 RSA_PSS_PARAMS *pss = rsa_pss_decode(sigalg);-
497-
498 rv = rsa_pss_param_print(bp, 0, pss, indent);-
499 RSA_PSS_PARAMS_free(pss);-
500 if (!rv
!rvDescription
TRUEnever evaluated
FALSEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-193
501 return
never executed: return 0;
0;
never executed: return 0;
0
502 }
executed 193 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (!sig
!sigDescription
TRUEevaluated 310 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 355 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& BIO_puts(bp, "\n") <= 0
BIO_puts(bp, "\n") <= 0Description
TRUEnever evaluated
FALSEevaluated 310 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-355
503 return
never executed: return 0;
0;
never executed: return 0;
0
504 }-
505 if (sig
sigDescription
TRUEevaluated 436 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 422 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
422-436
506 return
executed 436 times by 1 test: return X509_signature_dump(bp, sig, indent);
Executed by:
  • libcrypto.so.1.1
X509_signature_dump(bp, sig, indent);
executed 436 times by 1 test: return X509_signature_dump(bp, sig, indent);
Executed by:
  • libcrypto.so.1.1
436
507 return
executed 422 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 422 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
422
508}-
509-
510static int rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)-
511{-
512 X509_ALGOR *alg = -
513 ((void *)0)-
514 ;-
515-
516 switch (op) {-
517-
518 case
executed 13 times by 1 test: case 0x1:
Executed by:
  • libcrypto.so.1.1
0x1:
executed 13 times by 1 test: case 0x1:
Executed by:
  • libcrypto.so.1.1
13
519 if (arg1 == 0
arg1 == 0Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-13
520 PKCS7_SIGNER_INFO_get0_algs(arg2,
executed 13 times by 1 test: PKCS7_SIGNER_INFO_get0_algs(arg2, ((void *)0) , ((void *)0) , &alg);
Executed by:
  • libcrypto.so.1.1
13
521 ((void *)0)
executed 13 times by 1 test: PKCS7_SIGNER_INFO_get0_algs(arg2, ((void *)0) , ((void *)0) , &alg);
Executed by:
  • libcrypto.so.1.1
13
522 ,
executed 13 times by 1 test: PKCS7_SIGNER_INFO_get0_algs(arg2, ((void *)0) , ((void *)0) , &alg);
Executed by:
  • libcrypto.so.1.1
13
523 ((void *)0)
executed 13 times by 1 test: PKCS7_SIGNER_INFO_get0_algs(arg2, ((void *)0) , ((void *)0) , &alg);
Executed by:
  • libcrypto.so.1.1
13
524 , &alg);
executed 13 times by 1 test: PKCS7_SIGNER_INFO_get0_algs(arg2, ((void *)0) , ((void *)0) , &alg);
Executed by:
  • libcrypto.so.1.1
13
525 break;
executed 13 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
13
526-
527 case
executed 12 times by 1 test: case 0x2:
Executed by:
  • libcrypto.so.1.1
0x2:
executed 12 times by 1 test: case 0x2:
Executed by:
  • libcrypto.so.1.1
12
528 if ((
(pkey->ameth->pkey_id == 912)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pkey->ameth->pkey_id == 912)
(pkey->ameth->pkey_id == 912)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-12
529 return
never executed: return -2;
-2;
never executed: return -2;
0
530 if (arg1 == 0
arg1 == 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-12
531 PKCS7_RECIP_INFO_get0_alg(arg2, &alg);
executed 12 times by 1 test: PKCS7_RECIP_INFO_get0_alg(arg2, &alg);
Executed by:
  • libcrypto.so.1.1
12
532 break;
executed 12 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
12
533-
534 case
executed 70 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
0x5:
executed 70 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
70
535 if (arg1 == 0
arg1 == 0Description
TRUEevaluated 35 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 35 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
35
536 return
executed 35 times by 1 test: return rsa_cms_sign(arg2);
Executed by:
  • libcrypto.so.1.1
rsa_cms_sign(arg2);
executed 35 times by 1 test: return rsa_cms_sign(arg2);
Executed by:
  • libcrypto.so.1.1
35
537 else if (arg1 == 1
arg1 == 1Description
TRUEevaluated 35 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-35
538 return
executed 35 times by 1 test: return rsa_cms_verify(arg2);
Executed by:
  • libcrypto.so.1.1
rsa_cms_verify(arg2);
executed 35 times by 1 test: return rsa_cms_verify(arg2);
Executed by:
  • libcrypto.so.1.1
35
539 break;
never executed: break;
0
540-
541 case
executed 46 times by 1 test: case 0x7:
Executed by:
  • libcrypto.so.1.1
0x7:
executed 46 times by 1 test: case 0x7:
Executed by:
  • libcrypto.so.1.1
46
542 if ((
(pkey->ameth->pkey_id == 912)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pkey->ameth->pkey_id == 912)
(pkey->ameth->pkey_id == 912)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-46
543 return
never executed: return -2;
-2;
never executed: return -2;
0
544 if (arg1 == 0
arg1 == 0Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
16-30
545 return
executed 30 times by 1 test: return rsa_cms_encrypt(arg2);
Executed by:
  • libcrypto.so.1.1
rsa_cms_encrypt(arg2);
executed 30 times by 1 test: return rsa_cms_encrypt(arg2);
Executed by:
  • libcrypto.so.1.1
30
546 else if (arg1 == 1
arg1 == 1Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-16
547 return
executed 16 times by 1 test: return rsa_cms_decrypt(arg2);
Executed by:
  • libcrypto.so.1.1
rsa_cms_decrypt(arg2);
executed 16 times by 1 test: return rsa_cms_decrypt(arg2);
Executed by:
  • libcrypto.so.1.1
16
548 break;
never executed: break;
0
549-
550 case
executed 42 times by 1 test: case 0x8:
Executed by:
  • libcrypto.so.1.1
0x8:
executed 42 times by 1 test: case 0x8:
Executed by:
  • libcrypto.so.1.1
42
551 if ((
(pkey->ameth->pkey_id == 912)Description
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pkey->ameth->pkey_id == 912)
(pkey->ameth->pkey_id == 912)Description
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-42
552 return
never executed: return -2;
-2;
never executed: return -2;
0
553 *(int *)arg2 = 0;-
554 return
executed 42 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 42 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
42
555-
556-
557 case
executed 65 times by 1 test: case 0x3:
Executed by:
  • libcrypto.so.1.1
0x3:
executed 65 times by 1 test: case 0x3:
Executed by:
  • libcrypto.so.1.1
65
558 *(int *)arg2 = 672;-
559 return
executed 65 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 65 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
65
560-
561 default
never executed: default:
:
never executed: default:
0
562 return
never executed: return -2;
-2;
never executed: return -2;
0
563-
564 }-
565-
566 if (alg
algDescription
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-25
567 X509_ALGOR_set0(alg, OBJ_nid2obj(6), 5, 0);
executed 25 times by 1 test: X509_ALGOR_set0(alg, OBJ_nid2obj(6), 5, 0);
Executed by:
  • libcrypto.so.1.1
25
568-
569 return
executed 25 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 25 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
25
570-
571}-
572-
573-
574static int rsa_md_to_algor(X509_ALGOR **palg, const EVP_MD *md)-
575{-
576 if (md ==
md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15
577 ((void *)0)
md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15
578 || EVP_MD_type(md) == 64
EVP_MD_type(md) == 64Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-14
579 return
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1
580 *palg = X509_ALGOR_new();-
581 if (*
*palg == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
palg ==
*palg == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14
582 ((void *)0)
*palg == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-14
583 )-
584 return
never executed: return 0;
0;
never executed: return 0;
0
585 X509_ALGOR_set_md(*palg, md);-
586 return
executed 14 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 14 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
14
587}-
588-
589-
590static int rsa_md_to_mgf1(X509_ALGOR **palg, const EVP_MD *mgf1md)-
591{-
592 X509_ALGOR *algtmp = -
593 ((void *)0)-
594 ;-
595 ASN1_STRING *stmp = -
596 ((void *)0)-
597 ;-
598-
599 *palg = -
600 ((void *)0)-
601 ;-
602 if (mgf1md ==
mgf1md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
603 ((void *)0)
mgf1md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
604 || EVP_MD_type(mgf1md) == 64
EVP_MD_type(mgf1md) == 64Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-5
605 return
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1
606-
607 if (!rsa_md_to_algor(&algtmp, mgf1md)
!rsa_md_to_alg...lgtmp, mgf1md)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
608 goto
never executed: goto err;
err;
never executed: goto err;
0
609 if (ASN1_item_pack(algtmp, (&(X509_ALGOR_it)), &stmp) ==
ASN1_item_pack...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
610 ((void *)0)
ASN1_item_pack...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
611 )-
612 goto
never executed: goto err;
err;
never executed: goto err;
0
613 *palg = X509_ALGOR_new();-
614 if (*
*palg == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
palg ==
*palg == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
615 ((void *)0)
*palg == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
616 )-
617 goto
never executed: goto err;
err;
never executed: goto err;
0
618 X509_ALGOR_set0(*palg, OBJ_nid2obj(911), 16, stmp);-
619 stmp = -
620 ((void *)0)-
621 ;-
622 err:
code before this statement executed 5 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
5
623 ASN1_STRING_free(stmp);-
624 X509_ALGOR_free(algtmp);-
625 if (*
*palgDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
palg
*palgDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-5
626 return
executed 5 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 5 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
5
627 return
never executed: return 0;
0;
never executed: return 0;
0
628}-
629-
630-
631static const EVP_MD *rsa_algor_to_md(X509_ALGOR *alg)-
632{-
633 const EVP_MD *md;-
634-
635 if (!alg
!algDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
22-34
636 return
executed 34 times by 1 test: return EVP_sha1();
Executed by:
  • libcrypto.so.1.1
EVP_sha1();
executed 34 times by 1 test: return EVP_sha1();
Executed by:
  • libcrypto.so.1.1
34
637 md = EVP_get_digestbyname(OBJ_nid2sn(OBJ_obj2nid(alg->algorithm)));-
638 if (md ==
md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-22
639 ((void *)0)
md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-22
640 )-
641 ERR_put_error(4,(156),(166),__FILE__,560);
never executed: ERR_put_error(4,(156),(166),__FILE__,560);
0
642 return
executed 22 times by 1 test: return md;
Executed by:
  • libcrypto.so.1.1
md;
executed 22 times by 1 test: return md;
Executed by:
  • libcrypto.so.1.1
22
643}-
644-
645-
646-
647-
648-
649-
650static RSA_PSS_PARAMS *rsa_ctx_to_pss(EVP_PKEY_CTX *pkctx)-
651{-
652 const EVP_MD *sigmd, *mgf1md;-
653 EVP_PKEY *pk = EVP_PKEY_CTX_get0_pkey(pkctx);-
654 int saltlen;-
655-
656 if (EVP_PKEY_CTX_ctrl(pkctx, -1, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 13, 0, (void *)(&sigmd)) <= 0
EVP_PKEY_CTX_c...(&sigmd)) <= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
657 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
658 ((void *)0)
never executed: return ((void *)0) ;
0
659 ;
never executed: return ((void *)0) ;
0
660 if (RSA_pkey_ctx_ctrl(pkctx, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)) | ((1<<8) | (1<<9)), (0x1000 + 8), 0, (void *)(&mgf1md)) <= 0
RSA_pkey_ctx_c...&mgf1md)) <= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
661 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
662 ((void *)0)
never executed: return ((void *)0) ;
0
663 ;
never executed: return ((void *)0) ;
0
664 if (!RSA_pkey_ctx_ctrl(pkctx, ((1<<3)|(1<<4)), (0x1000 + 7), 0, &saltlen)
!RSA_pkey_ctx_..., 0, &saltlen)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
665 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
666 ((void *)0)
never executed: return ((void *)0) ;
0
667 ;
never executed: return ((void *)0) ;
0
668 if (saltlen == -1
saltlen == -1Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-3
669 saltlen = EVP_MD_size(sigmd);-
670 }
never executed: end of block
else if (saltlen == -2
saltlen == -2Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-3
671 saltlen = EVP_PKEY_size(pk) - EVP_MD_size(sigmd) - 2;-
672 if ((
(EVP_PKEY_bits(pk) & 0x7) == 1Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
EVP_PKEY_bits(pk) & 0x7) == 1
(EVP_PKEY_bits(pk) & 0x7) == 1Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
673 saltlen--;
never executed: saltlen--;
0
674 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3
675-
676 return
executed 3 times by 1 test: return rsa_pss_params_create(sigmd, mgf1md, saltlen);
Executed by:
  • libcrypto.so.1.1
rsa_pss_params_create(sigmd, mgf1md, saltlen);
executed 3 times by 1 test: return rsa_pss_params_create(sigmd, mgf1md, saltlen);
Executed by:
  • libcrypto.so.1.1
3
677}-
678-
679RSA_PSS_PARAMS *rsa_pss_params_create(const EVP_MD *sigmd,-
680 const EVP_MD *mgf1md, int saltlen)-
681{-
682 RSA_PSS_PARAMS *pss = RSA_PSS_PARAMS_new();-
683-
684 if (pss ==
pss == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
685 ((void *)0)
pss == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
686 )-
687 goto
never executed: goto err;
err;
never executed: goto err;
0
688 if (saltlen != 20
saltlen != 20Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-4
689 pss->saltLength = ASN1_INTEGER_new();-
690 if (pss->saltLength ==
pss->saltLength == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
691 ((void *)0)
pss->saltLength == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
692 )-
693 goto
never executed: goto err;
err;
never executed: goto err;
0
694 if (!ASN1_INTEGER_set(pss->saltLength, saltlen)
!ASN1_INTEGER_...ngth, saltlen)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4
695 goto
never executed: goto err;
err;
never executed: goto err;
0
696 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
697 if (!rsa_md_to_algor(&pss->hashAlgorithm, sigmd)
!rsa_md_to_alg...orithm, sigmd)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4
698 goto
never executed: goto err;
err;
never executed: goto err;
0
699 if (mgf1md ==
mgf1md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
700 ((void *)0)
mgf1md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
701 )-
702 mgf1md = sigmd;
never executed: mgf1md = sigmd;
0
703 if (!rsa_md_to_mgf1(&pss->maskGenAlgorithm, mgf1md)
!rsa_md_to_mgf...rithm, mgf1md)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4
704 goto
never executed: goto err;
err;
never executed: goto err;
0
705 if (!rsa_md_to_algor(&pss->maskHash, mgf1md)
!rsa_md_to_alg...kHash, mgf1md)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4
706 goto
never executed: goto err;
err;
never executed: goto err;
0
707 return
executed 4 times by 1 test: return pss;
Executed by:
  • libcrypto.so.1.1
pss;
executed 4 times by 1 test: return pss;
Executed by:
  • libcrypto.so.1.1
4
708 err:-
709 RSA_PSS_PARAMS_free(pss);-
710 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
711 ((void *)0)
never executed: return ((void *)0) ;
0
712 ;
never executed: return ((void *)0) ;
0
713}-
714-
715static ASN1_STRING *rsa_ctx_to_pss_string(EVP_PKEY_CTX *pkctx)-
716{-
717 RSA_PSS_PARAMS *pss = rsa_ctx_to_pss(pkctx);-
718 ASN1_STRING *os;-
719-
720 if (pss ==
pss == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3
721 ((void *)0)
pss == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3
722 )-
723 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
724 ((void *)0)
never executed: return ((void *)0) ;
0
725 ;
never executed: return ((void *)0) ;
0
726-
727 os = ASN1_item_pack(pss, (&(RSA_PSS_PARAMS_it)), -
728 ((void *)0)-
729 );-
730 RSA_PSS_PARAMS_free(pss);-
731 return
executed 3 times by 1 test: return os;
Executed by:
  • libcrypto.so.1.1
os;
executed 3 times by 1 test: return os;
Executed by:
  • libcrypto.so.1.1
3
732}-
733-
734-
735-
736-
737-
738-
739-
740static int rsa_pss_to_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pkctx,-
741 X509_ALGOR *sigalg, EVP_PKEY *pkey)-
742{-
743 int rv = -1;-
744 int saltlen;-
745 const EVP_MD *mgf1md = -
746 ((void *)0)-
747 , *md = -
748 ((void *)0)-
749 ;-
750 RSA_PSS_PARAMS *pss;-
751-
752-
753 if (OBJ_obj2nid(sigalg->algorithm) != 912
OBJ_obj2nid(si...orithm) != 912Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-6
754 ERR_put_error(4,(155),(155),__FILE__,649);-
755 return
never executed: return -1;
-1;
never executed: return -1;
0
756 }-
757-
758 pss = rsa_pss_decode(sigalg);-
759-
760 if (!rsa_pss_get_param(pss, &md, &mgf1md, &saltlen)
!rsa_pss_get_p...1md, &saltlen)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-6
761 ERR_put_error(4,(155),(149),__FILE__,656);-
762 goto
never executed: goto err;
err;
never executed: goto err;
0
763 }-
764-
765-
766 if (pkey
pkeyDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3
767 if (!EVP_DigestVerifyInit(ctx, &pkctx, md,
!EVP_DigestVer...d *)0) , pkey)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3
768 ((void *)0)
!EVP_DigestVer...d *)0) , pkey)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3
769 , pkey)
!EVP_DigestVer...d *)0) , pkey)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
770 goto
never executed: goto err;
err;
never executed: goto err;
0
771 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
3
772 const EVP_MD *checkmd;-
773 if (EVP_PKEY_CTX_ctrl(pkctx, -1, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)), 13, 0, (void *)(&checkmd)) <= 0
EVP_PKEY_CTX_c...checkmd)) <= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
774 goto
never executed: goto err;
err;
never executed: goto err;
0
775 if (EVP_MD_type(md) != EVP_MD_type(checkmd)
EVP_MD_type(md..._type(checkmd)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-3
776 ERR_put_error(4,(155),(158),__FILE__,669);-
777 goto
never executed: goto err;
err;
never executed: goto err;
0
778 }-
779 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3
780-
781 if (RSA_pkey_ctx_ctrl(pkctx, -1, (0x1000 + 1), 6,
RSA_pkey_ctx_c...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
782 ((void *)0)
RSA_pkey_ctx_c...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
783 ) <= 0
RSA_pkey_ctx_c...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6
784 goto
never executed: goto err;
err;
never executed: goto err;
0
785-
786 if (RSA_pkey_ctx_ctrl(pkctx, ((1<<3)|(1<<4)), (0x1000 + 2), saltlen,
RSA_pkey_ctx_c...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
787 ((void *)0)
RSA_pkey_ctx_c...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
788 ) <= 0
RSA_pkey_ctx_c...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6
789 goto
never executed: goto err;
err;
never executed: goto err;
0
790-
791 if (RSA_pkey_ctx_ctrl(pkctx, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)) | ((1<<8) | (1<<9)), (0x1000 + 5), 0, (void *)(mgf1md)) <= 0
RSA_pkey_ctx_c...(mgf1md)) <= 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-6
792 goto
never executed: goto err;
err;
never executed: goto err;
0
793-
794 rv = 1;-
795-
796 err:
code before this statement executed 6 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
6
797 RSA_PSS_PARAMS_free(pss);-
798 return
executed 6 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
rv;
executed 6 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
6
799}-
800-
801int rsa_pss_get_param(const RSA_PSS_PARAMS *pss, const EVP_MD **pmd,-
802 const EVP_MD **pmgf1md, int *psaltlen)-
803{-
804 if (pss ==
pss == ((void *)0)Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
26-39
805 ((void *)0)
pss == ((void *)0)Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
26-39
806 )-
807 return
executed 39 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 39 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
39
808 *pmd = rsa_algor_to_md(pss->hashAlgorithm);-
809 if (*
*pmd == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pmd ==
*pmd == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26
810 ((void *)0)
*pmd == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26
811 )-
812 return
never executed: return 0;
0;
never executed: return 0;
0
813 *pmgf1md = rsa_algor_to_md(pss->maskHash);-
814 if (*
*pmgf1md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pmgf1md ==
*pmgf1md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26
815 ((void *)0)
*pmgf1md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26
816 )-
817 return
never executed: return 0;
0;
never executed: return 0;
0
818 if (pss->saltLength
pss->saltLengthDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
12-14
819 *psaltlen = ASN1_INTEGER_get(pss->saltLength);-
820 if (*
*psaltlen < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
psaltlen < 0
*psaltlen < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-11
821 ERR_put_error(4,(151),(150),__FILE__,704);-
822 return
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1
823 }-
824 }
executed 11 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
11
825 *psaltlen = 20;-
826 }
executed 14 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
14
827-
828-
829-
830-
831-
832 if (pss->trailerField
pss->trailerFieldDescription
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& ASN1_INTEGER_get(pss->trailerField) != 1
ASN1_INTEGER_g...lerField) != 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-25
833 ERR_put_error(4,(151),(139),__FILE__,716);-
834 return
never executed: return 0;
0;
never executed: return 0;
0
835 }-
836-
837 return
executed 25 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 25 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
25
838}-
839-
840-
841static int rsa_cms_verify(CMS_SignerInfo *si)-
842{-
843 int nid, nid2;-
844 X509_ALGOR *alg;-
845 EVP_PKEY_CTX *pkctx = CMS_SignerInfo_get0_pkey_ctx(si);-
846-
847 CMS_SignerInfo_get0_algs(si, -
848 ((void *)0)-
849 , -
850 ((void *)0)-
851 , -
852 ((void *)0)-
853 , &alg);-
854 nid = OBJ_obj2nid(alg->algorithm);-
855 if (nid == 912
nid == 912Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-32
856 return
executed 3 times by 1 test: return rsa_pss_to_ctx( ((void *)0) , pkctx, alg, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
rsa_pss_to_ctx(
executed 3 times by 1 test: return rsa_pss_to_ctx( ((void *)0) , pkctx, alg, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
3
857 ((void *)0)
executed 3 times by 1 test: return rsa_pss_to_ctx( ((void *)0) , pkctx, alg, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
3
858 , pkctx, alg,
executed 3 times by 1 test: return rsa_pss_to_ctx( ((void *)0) , pkctx, alg, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
3
859 ((void *)0)
executed 3 times by 1 test: return rsa_pss_to_ctx( ((void *)0) , pkctx, alg, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
3
860 );
executed 3 times by 1 test: return rsa_pss_to_ctx( ((void *)0) , pkctx, alg, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
3
861-
862 if ((
(pkctx->pmeth->pkey_id == 912)Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pkctx->pmeth->pkey_id == 912)
(pkctx->pmeth->pkey_id == 912)Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-32
863 ERR_put_error(4,(158),(144),__FILE__,736);-
864 return
never executed: return 0;
0;
never executed: return 0;
0
865 }-
866 if (nid == 6
nid == 6Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-32
867 return
executed 32 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 32 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
32
868-
869 if (OBJ_find_sigid_algs(nid,
OBJ_find_sigid... *)0) , &nid2)Description
TRUEnever evaluated
FALSEnever evaluated
0
870 ((void *)0)
OBJ_find_sigid... *)0) , &nid2)Description
TRUEnever evaluated
FALSEnever evaluated
0
871 , &nid2)
OBJ_find_sigid... *)0) , &nid2)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
872 if (nid2 == 6
nid2 == 6Description
TRUEnever evaluated
FALSEnever evaluated
)
0
873 return
never executed: return 1;
1;
never executed: return 1;
0
874 }
never executed: end of block
0
875 return
never executed: return 0;
0;
never executed: return 0;
0
876}-
877-
878-
879-
880-
881-
882-
883-
884static int rsa_item_verify(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,-
885 X509_ALGOR *sigalg, ASN1_BIT_STRING *sig,-
886 EVP_PKEY *pkey)-
887{-
888-
889 if (OBJ_obj2nid(sigalg->algorithm) != 912
OBJ_obj2nid(si...orithm) != 912Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-3
890 ERR_put_error(4,(148),(155),__FILE__,761);-
891 return
never executed: return -1;
-1;
never executed: return -1;
0
892 }-
893 if (rsa_pss_to_ctx(ctx,
rsa_pss_to_ctx...alg, pkey) > 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-3
894 ((void *)0)
rsa_pss_to_ctx...alg, pkey) > 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-3
895 , sigalg, pkey) > 0
rsa_pss_to_ctx...alg, pkey) > 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-3
896-
897 return
executed 3 times by 1 test: return 2;
Executed by:
  • libcrypto.so.1.1
2;
executed 3 times by 1 test: return 2;
Executed by:
  • libcrypto.so.1.1
3
898 }-
899 return
never executed: return -1;
-1;
never executed: return -1;
0
900}-
901-
902-
903static int rsa_cms_sign(CMS_SignerInfo *si)-
904{-
905 int pad_mode = 1;-
906 X509_ALGOR *alg;-
907 EVP_PKEY_CTX *pkctx = CMS_SignerInfo_get0_pkey_ctx(si);-
908 ASN1_STRING *os = -
909 ((void *)0)-
910 ;-
911-
912 CMS_SignerInfo_get0_algs(si, -
913 ((void *)0)-
914 , -
915 ((void *)0)-
916 , -
917 ((void *)0)-
918 , &alg);-
919 if (pkctx
pkctxDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3-32
920 if (RSA_pkey_ctx_ctrl(pkctx, -1, (0x1000 + 6), 0, &pad_mode) <= 0
RSA_pkey_ctx_c...pad_mode) <= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
921 return
never executed: return 0;
0;
never executed: return 0;
0
922 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3
923 if (pad_mode == 1
pad_mode == 1Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3-32
924 X509_ALGOR_set0(alg, OBJ_nid2obj(6), 5, 0);-
925 return
executed 32 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 32 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
32
926 }-
927-
928 if (pad_mode != 6
pad_mode != 6Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
929 return
never executed: return 0;
0;
never executed: return 0;
0
930 os = rsa_ctx_to_pss_string(pkctx);-
931 if (!os
!osDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
932 return
never executed: return 0;
0;
never executed: return 0;
0
933 X509_ALGOR_set0(alg, OBJ_nid2obj(912), 16, os);-
934 return
executed 3 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 3 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
3
935}-
936-
937-
938static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,-
939 X509_ALGOR *alg1, X509_ALGOR *alg2,-
940 ASN1_BIT_STRING *sig)-
941{-
942 int pad_mode;-
943 EVP_PKEY_CTX *pkctx = EVP_MD_CTX_pkey_ctx(ctx);-
944-
945 if (RSA_pkey_ctx_ctrl(pkctx, -1, (0x1000 + 6), 0, &pad_mode) <= 0
RSA_pkey_ctx_c...pad_mode) <= 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-20
946 return
never executed: return 0;
0;
never executed: return 0;
0
947 if (pad_mode == 1
pad_mode == 1Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-20
948 return
executed 20 times by 1 test: return 2;
Executed by:
  • libcrypto.so.1.1
2;
executed 20 times by 1 test: return 2;
Executed by:
  • libcrypto.so.1.1
20
949 if (pad_mode == 6
pad_mode == 6Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
950 ASN1_STRING *os1 = -
951 ((void *)0)-
952 ;-
953 os1 = rsa_ctx_to_pss_string(pkctx);-
954 if (!os1
!os1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
955 return
never executed: return 0;
0;
never executed: return 0;
0
956-
957 if (alg2
alg2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
958 ASN1_STRING *os2 = ASN1_STRING_dup(os1);-
959 if (!os2
!os2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
960 ASN1_STRING_free(os1);-
961 return
never executed: return 0;
0;
never executed: return 0;
0
962 }-
963 X509_ALGOR_set0(alg2, OBJ_nid2obj(912),-
964 16, os2);-
965 }
never executed: end of block
0
966 X509_ALGOR_set0(alg1, OBJ_nid2obj(912),-
967 16, os1);-
968 return
never executed: return 3;
3;
never executed: return 3;
0
969 }-
970 return
never executed: return 2;
2;
never executed: return 2;
0
971}-
972-
973static int rsa_sig_info_set(X509_SIG_INFO *siginf, const X509_ALGOR *sigalg,-
974 const ASN1_STRING *sig)-
975{-
976 int rv = 0;-
977 int mdnid, saltlen;-
978 uint32_t flags;-
979 const EVP_MD *mgf1md = -
980 ((void *)0)-
981 , *md = -
982 ((void *)0)-
983 ;-
984 RSA_PSS_PARAMS *pss;-
985-
986-
987 if (OBJ_obj2nid(sigalg->algorithm) != 912
OBJ_obj2nid(si...orithm) != 912Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-46
988 return
never executed: return 0;
0;
never executed: return 0;
0
989-
990 pss = rsa_pss_decode(sigalg);-
991 if (!rsa_pss_get_param(pss, &md, &mgf1md, &saltlen)
!rsa_pss_get_p...1md, &saltlen)Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7-39
992 goto
executed 39 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 39 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
39
993 mdnid = EVP_MD_type(md);-
994-
995-
996-
997-
998 if ((mdnid == 672
mdnid == 672Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| mdnid == 673
mdnid == 673Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| mdnid == 674
mdnid == 674Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
999 && mdnid == EVP_MD_type(mgf1md)
mdnid == EVP_MD_type(mgf1md)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& saltlen == EVP_MD_size(md)
saltlen == EVP_MD_size(md)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-2
1000 flags = 0x2;
executed 2 times by 1 test: flags = 0x2;
Executed by:
  • libcrypto.so.1.1
2
1001 else-
1002 flags = 0;
executed 5 times by 1 test: flags = 0;
Executed by:
  • libcrypto.so.1.1
5
1003-
1004 X509_SIG_INFO_set(siginf, mdnid, 912, EVP_MD_size(md) * 4,-
1005 flags);-
1006 rv = 1;-
1007 err:
code before this statement executed 7 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
7
1008 RSA_PSS_PARAMS_free(pss);-
1009 return
executed 46 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
rv;
executed 46 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
46
1010}-
1011-
1012-
1013static RSA_OAEP_PARAMS *rsa_oaep_decode(const X509_ALGOR *alg)-
1014{-
1015 RSA_OAEP_PARAMS *oaep;-
1016-
1017 oaep = ASN1_TYPE_unpack_sequence((&(RSA_OAEP_PARAMS_it)),-
1018 alg->parameter);-
1019-
1020 if (oaep ==
oaep == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1021 ((void *)0)
oaep == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1022 )-
1023 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
1024 ((void *)0)
never executed: return ((void *)0) ;
0
1025 ;
never executed: return ((void *)0) ;
0
1026-
1027 if (oaep->maskGenFunc !=
oaep->maskGenF...!= ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1
1028 ((void *)0)
oaep->maskGenF...!= ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1
1029 ) {-
1030 oaep->maskHash = rsa_mgf1_decode(oaep->maskGenFunc);-
1031 if (oaep->maskHash ==
oaep->maskHash == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
1032 ((void *)0)
oaep->maskHash == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
1033 ) {-
1034 RSA_OAEP_PARAMS_free(oaep);-
1035 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
1036 ((void *)0)
never executed: return ((void *)0) ;
0
1037 ;
never executed: return ((void *)0) ;
0
1038 }-
1039 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
1040 return
executed 2 times by 1 test: return oaep;
Executed by:
  • libcrypto.so.1.1
oaep;
executed 2 times by 1 test: return oaep;
Executed by:
  • libcrypto.so.1.1
2
1041}-
1042-
1043static int rsa_cms_decrypt(CMS_RecipientInfo *ri)-
1044{-
1045 EVP_PKEY_CTX *pkctx;-
1046 X509_ALGOR *cmsalg;-
1047 int nid;-
1048 int rv = -1;-
1049 unsigned char *label = -
1050 ((void *)0)-
1051 ;-
1052 int labellen = 0;-
1053 const EVP_MD *mgf1md = -
1054 ((void *)0)-
1055 , *md = -
1056 ((void *)0)-
1057 ;-
1058 RSA_OAEP_PARAMS *oaep;-
1059-
1060 pkctx = CMS_RecipientInfo_get0_pkey_ctx(ri);-
1061 if (pkctx ==
pkctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16
1062 ((void *)0)
pkctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16
1063 )-
1064 return
never executed: return 0;
0;
never executed: return 0;
0
1065 if (!CMS_RecipientInfo_ktri_get0_algs(ri,
!CMS_Recipient...)0) , &cmsalg)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16
1066 ((void *)0)
!CMS_Recipient...)0) , &cmsalg)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16
1067 ,
!CMS_Recipient...)0) , &cmsalg)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16
1068 ((void *)0)
!CMS_Recipient...)0) , &cmsalg)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16
1069 , &cmsalg)
!CMS_Recipient...)0) , &cmsalg)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-16
1070 return
never executed: return -1;
-1;
never executed: return -1;
0
1071 nid = OBJ_obj2nid(cmsalg->algorithm);-
1072 if (nid == 6
nid == 6Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2-14
1073 return
executed 14 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 14 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
14
1074 if (nid != 919
nid != 919Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2
1075 ERR_put_error(4,(159),(162),__FILE__,908);-
1076 return
never executed: return -1;
-1;
never executed: return -1;
0
1077 }-
1078-
1079 oaep = rsa_oaep_decode(cmsalg);-
1080-
1081 if (oaep ==
oaep == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1082 ((void *)0)
oaep == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1083 ) {-
1084 ERR_put_error(4,(159),(161),__FILE__,915);-
1085 goto
never executed: goto err;
err;
never executed: goto err;
0
1086 }-
1087-
1088 mgf1md = rsa_algor_to_md(oaep->maskHash);-
1089 if (mgf1md ==
mgf1md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1090 ((void *)0)
mgf1md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1091 )-
1092 goto
never executed: goto err;
err;
never executed: goto err;
0
1093 md = rsa_algor_to_md(oaep->hashFunc);-
1094 if (md ==
md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1095 ((void *)0)
md == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1096 )-
1097 goto
never executed: goto err;
err;
never executed: goto err;
0
1098-
1099 if (oaep->pSourceFunc !=
oaep->pSourceF...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1100 ((void *)0)
oaep->pSourceF...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1101 ) {-
1102 X509_ALGOR *plab = oaep->pSourceFunc;-
1103-
1104 if (OBJ_obj2nid(plab->algorithm) != 935
OBJ_obj2nid(pl...orithm) != 935Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1105 ERR_put_error(4,(159),(163),__FILE__,930);-
1106 goto
never executed: goto err;
err;
never executed: goto err;
0
1107 }-
1108 if (plab->parameter->type != 4
plab->parameter->type != 4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1109 ERR_put_error(4,(159),(160),__FILE__,934);-
1110 goto
never executed: goto err;
err;
never executed: goto err;
0
1111 }-
1112-
1113 label = plab->parameter->value.octet_string->data;-
1114-
1115 plab->parameter->value.octet_string->data = -
1116 ((void *)0)-
1117 ;-
1118 labellen = plab->parameter->value.octet_string->length;-
1119 }
never executed: end of block
0
1120-
1121 if (RSA_pkey_ctx_ctrl(pkctx, -1, (0x1000 + 1), 4,
RSA_pkey_ctx_c...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1122 ((void *)0)
RSA_pkey_ctx_c...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1123 ) <= 0
RSA_pkey_ctx_c...id *)0) ) <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1124 goto
never executed: goto err;
err;
never executed: goto err;
0
1125 if (EVP_PKEY_CTX_ctrl(pkctx, 6, ((1<<8) | (1<<9)), (0x1000 + 9), 0, (void *)(md)) <= 0
EVP_PKEY_CTX_c...d *)(md)) <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1126 goto
never executed: goto err;
err;
never executed: goto err;
0
1127 if (RSA_pkey_ctx_ctrl(pkctx, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)) | ((1<<8) | (1<<9)), (0x1000 + 5), 0, (void *)(mgf1md)) <= 0
RSA_pkey_ctx_c...(mgf1md)) <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1128 goto
never executed: goto err;
err;
never executed: goto err;
0
1129 if (EVP_PKEY_CTX_ctrl(pkctx, 6, ((1<<8) | (1<<9)), (0x1000 + 10), labellen, (void *)(label)) <= 0
EVP_PKEY_CTX_c...)(label)) <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1130 goto
never executed: goto err;
err;
never executed: goto err;
0
1131-
1132 rv = 1;-
1133-
1134 err:
code before this statement executed 2 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
2
1135 RSA_OAEP_PARAMS_free(oaep);-
1136 return
executed 2 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
rv;
executed 2 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
2
1137}-
1138-
1139static int rsa_cms_encrypt(CMS_RecipientInfo *ri)-
1140{-
1141 const EVP_MD *md, *mgf1md;-
1142 RSA_OAEP_PARAMS *oaep = -
1143 ((void *)0)-
1144 ;-
1145 ASN1_STRING *os = -
1146 ((void *)0)-
1147 ;-
1148 X509_ALGOR *alg;-
1149 EVP_PKEY_CTX *pkctx = CMS_RecipientInfo_get0_pkey_ctx(ri);-
1150 int pad_mode = 1, rv = 0, labellen;-
1151 unsigned char *label;-
1152-
1153 if (CMS_RecipientInfo_ktri_get0_algs(ri,
CMS_RecipientI...) , &alg) <= 0Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-30
1154 ((void *)0)
CMS_RecipientI...) , &alg) <= 0Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-30
1155 ,
CMS_RecipientI...) , &alg) <= 0Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-30
1156 ((void *)0)
CMS_RecipientI...) , &alg) <= 0Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-30
1157 , &alg) <= 0
CMS_RecipientI...) , &alg) <= 0Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-30
1158 return
never executed: return 0;
0;
never executed: return 0;
0
1159 if (pkctx
pkctxDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 28 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-28
1160 if (RSA_pkey_ctx_ctrl(pkctx, -1, (0x1000 + 6), 0, &pad_mode) <= 0
RSA_pkey_ctx_c...pad_mode) <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1161 return
never executed: return 0;
0;
never executed: return 0;
0
1162 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
1163 if (pad_mode == 1
pad_mode == 1Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-28
1164 X509_ALGOR_set0(alg, OBJ_nid2obj(6), 5, 0);-
1165 return
executed 28 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 28 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
28
1166 }-
1167-
1168 if (pad_mode != 4
pad_mode != 4Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1169 return
never executed: return 0;
0;
never executed: return 0;
0
1170 if (EVP_PKEY_CTX_ctrl(pkctx, 6, ((1<<8) | (1<<9)), (0x1000 + 11), 0, (void *)(&md)) <= 0
EVP_PKEY_CTX_c... *)(&md)) <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1171 goto
never executed: goto err;
err;
never executed: goto err;
0
1172 if (RSA_pkey_ctx_ctrl(pkctx, ((1<<3) | (1<<4) | (1<<5) | (1<<6) | (1<<7)) | ((1<<8) | (1<<9)), (0x1000 + 8), 0, (void *)(&mgf1md)) <= 0
RSA_pkey_ctx_c...&mgf1md)) <= 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1173 goto
never executed: goto err;
err;
never executed: goto err;
0
1174 labellen = EVP_PKEY_CTX_ctrl(pkctx, 6, ((1<<8) | (1<<9)), (0x1000 + 12), 0, (void *)(&label));-
1175 if (labellen < 0
labellen < 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1176 goto
never executed: goto err;
err;
never executed: goto err;
0
1177 oaep = RSA_OAEP_PARAMS_new();-
1178 if (oaep ==
oaep == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1179 ((void *)0)
oaep == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
1180 )-
1181 goto
never executed: goto err;
err;
never executed: goto err;
0
1182 if (!rsa_md_to_algor(&oaep->hashFunc, md)
!rsa_md_to_alg...>hashFunc, md)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1183 goto
never executed: goto err;
err;
never executed: goto err;
0
1184 if (!rsa_md_to_mgf1(&oaep->maskGenFunc, mgf1md)
!rsa_md_to_mgf...nFunc, mgf1md)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1185 goto
never executed: goto err;
err;
never executed: goto err;
0
1186 if (labellen > 0
labellen > 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2
1187 ASN1_OCTET_STRING *los;-
1188 oaep->pSourceFunc = X509_ALGOR_new();-
1189 if (oaep->pSourceFunc ==
oaep->pSourceF...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1190 ((void *)0)
oaep->pSourceF...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1191 )-
1192 goto
never executed: goto err;
err;
never executed: goto err;
0
1193 los = ASN1_OCTET_STRING_new();-
1194 if (los ==
los == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1195 ((void *)0)
los == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1196 )-
1197 goto
never executed: goto err;
err;
never executed: goto err;
0
1198 if (!ASN1_OCTET_STRING_set(los, label, labellen)
!ASN1_OCTET_ST...bel, labellen)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1199 ASN1_OCTET_STRING_free(los);-
1200 goto
never executed: goto err;
err;
never executed: goto err;
0
1201 }-
1202 X509_ALGOR_set0(oaep->pSourceFunc, OBJ_nid2obj(935),-
1203 4, los);-
1204 }
never executed: end of block
0
1205-
1206 if (!ASN1_item_pack(oaep, (&(RSA_OAEP_PARAMS_it)), &os)
!ASN1_item_pac...AMS_it)), &os)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
1207 goto
never executed: goto err;
err;
never executed: goto err;
0
1208 X509_ALGOR_set0(alg, OBJ_nid2obj(919), 16, os);-
1209 os = -
1210 ((void *)0)-
1211 ;-
1212 rv = 1;-
1213 err:
code before this statement executed 2 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
2
1214 RSA_OAEP_PARAMS_free(oaep);-
1215 ASN1_STRING_free(os);-
1216 return
executed 2 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
rv;
executed 2 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
2
1217}-
1218-
1219-
1220static int rsa_pkey_check(const EVP_PKEY *pkey)-
1221{-
1222 return
executed 2 times by 1 test: return RSA_check_key_ex(pkey->pkey.rsa, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
RSA_check_key_ex(pkey->pkey.rsa,
executed 2 times by 1 test: return RSA_check_key_ex(pkey->pkey.rsa, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
2
1223 ((void *)0)
executed 2 times by 1 test: return RSA_check_key_ex(pkey->pkey.rsa, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
2
1224 );
executed 2 times by 1 test: return RSA_check_key_ex(pkey->pkey.rsa, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
2
1225}-
1226-
1227const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[2] = {-
1228 {-
1229 6,-
1230 6,-
1231 0x4,-
1232-
1233 "RSA",-
1234 "OpenSSL RSA method",-
1235-
1236 rsa_pub_decode,-
1237 rsa_pub_encode,-
1238 rsa_pub_cmp,-
1239 rsa_pub_print,-
1240-
1241 rsa_priv_decode,-
1242 rsa_priv_encode,-
1243 rsa_priv_print,-
1244-
1245 int_rsa_size,-
1246 rsa_bits,-
1247 rsa_security_bits,-
1248-
1249 0, 0, 0, 0, 0, 0,-
1250-
1251 rsa_sig_print,-
1252 int_rsa_free,-
1253 rsa_pkey_ctrl,-
1254 old_rsa_priv_decode,-
1255 old_rsa_priv_encode,-
1256 rsa_item_verify,-
1257 rsa_item_sign,-
1258 rsa_sig_info_set,-
1259 rsa_pkey_check-
1260 },-
1261-
1262 {-
1263 19,-
1264 6,-
1265 0x1}-
1266};-
1267-
1268const EVP_PKEY_ASN1_METHOD rsa_pss_asn1_meth = {-
1269 912,-
1270 912,-
1271 0x4,-
1272-
1273 "RSA-PSS",-
1274 "OpenSSL RSA-PSS method",-
1275-
1276 rsa_pub_decode,-
1277 rsa_pub_encode,-
1278 rsa_pub_cmp,-
1279 rsa_pub_print,-
1280-
1281 rsa_priv_decode,-
1282 rsa_priv_encode,-
1283 rsa_priv_print,-
1284-
1285 int_rsa_size,-
1286 rsa_bits,-
1287 rsa_security_bits,-
1288-
1289 0, 0, 0, 0, 0, 0,-
1290-
1291 rsa_sig_print,-
1292 int_rsa_free,-
1293 rsa_pkey_ctrl,-
1294 0, 0,-
1295 rsa_item_verify,-
1296 rsa_item_sign,-
1297 0,-
1298 rsa_pkey_check-
1299};-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2