OpenCoverage

dsa_ameth.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/dsa/dsa_ameth.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4static int dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)-
5{-
6 const unsigned char *p, *pm;-
7 int pklen, pmlen;-
8 int ptype;-
9 const void *pval;-
10 const ASN1_STRING *pstr;-
11 X509_ALGOR *palg;-
12 ASN1_INTEGER *public_key = -
13 ((void *)0)-
14 ;-
15-
16 DSA *dsa = -
17 ((void *)0)-
18 ;-
19-
20 if (!X509_PUBKEY_get0_param(
!X509_PUBKEY_g...&palg, pubkey)Description
TRUEnever evaluated
FALSEevaluated 4251 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4251
21 ((void *)0)
!X509_PUBKEY_g...&palg, pubkey)Description
TRUEnever evaluated
FALSEevaluated 4251 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4251
22 , &p, &pklen, &palg, pubkey)
!X509_PUBKEY_g...&palg, pubkey)Description
TRUEnever evaluated
FALSEevaluated 4251 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4251
23 return
never executed: return 0;
0;
never executed: return 0;
0
24 X509_ALGOR_get0(-
25 ((void *)0)-
26 , &ptype, &pval, palg);-
27-
28 if (ptype == 16
ptype == 16Description
TRUEevaluated 4122 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
129-4122
29 pstr = pval;-
30 pm = pstr->data;-
31 pmlen = pstr->length;-
32-
33 if ((
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2456 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dsa = d2i_DSAparams(
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2456 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1666-2456
34 ((void *)0)
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2456 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1666-2456
35 , &pm, pmlen)) ==
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2456 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1666-2456
36 ((void *)0)
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2456 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1666-2456
37 ) {-
38 ERR_put_error(10,(117),(104),__FILE__,42);-
39 goto
executed 1666 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1666 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1666
40 }-
41-
42 }
executed 2456 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if ((
(ptype == 5)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 124 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ptype == 5)
(ptype == 5)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 124 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(ptype == -1)Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 82 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ptype == -1)
(ptype == -1)Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 82 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5-2456
43 if ((
(dsa = DSA_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 47 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dsa = DSA_new()) ==
(dsa = DSA_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 47 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-47
44 ((void *)0)
(dsa = DSA_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 47 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-47
45 ) {-
46 ERR_put_error(10,(117),((1|64)),__FILE__,48);-
47 goto
never executed: goto err;
err;
never executed: goto err;
0
48 }-
49 }
executed 47 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
47
50 ERR_put_error(10,(117),(105),__FILE__,52);-
51 goto
executed 82 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 82 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
82
52 }-
53-
54 if ((
(public_key = ...== ((void *)0)Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
public_key = d2i_ASN1_INTEGER(
(public_key = ...== ((void *)0)Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
125-2378
55 ((void *)0)
(public_key = ...== ((void *)0)Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
125-2378
56 , &p, pklen)) ==
(public_key = ...== ((void *)0)Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
125-2378
57 ((void *)0)
(public_key = ...== ((void *)0)Description
TRUEevaluated 125 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
125-2378
58 ) {-
59 ERR_put_error(10,(117),(104),__FILE__,57);-
60 goto
executed 125 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 125 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
125
61 }-
62-
63 if ((
(dsa->pub_key ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dsa->pub_key = ASN1_INTEGER_to_BN(public_key,
(dsa->pub_key ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2378
64 ((void *)0)
(dsa->pub_key ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2378
65 )) ==
(dsa->pub_key ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2378
66 ((void *)0)
(dsa->pub_key ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2378 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2378
67 ) {-
68 ERR_put_error(10,(117),(108),__FILE__,62);-
69 goto
never executed: goto err;
err;
never executed: goto err;
0
70 }-
71-
72 ASN1_INTEGER_free(public_key);-
73 EVP_PKEY_assign((pkey),116, (char *)(dsa));-
74 return
executed 2378 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2378 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2378
75-
76 err:-
77 ASN1_INTEGER_free(public_key);-
78 DSA_free(dsa);-
79 return
executed 1873 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1873 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1873
80-
81}-
82-
83static int dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)-
84{-
85 DSA *dsa;-
86 int ptype;-
87 unsigned char *penc = -
88 ((void *)0)-
89 ;-
90 int penclen;-
91 ASN1_STRING *str = -
92 ((void *)0)-
93 ;-
94 ASN1_INTEGER *pubint = -
95 ((void *)0)-
96 ;-
97 ASN1_OBJECT *aobj;-
98-
99 dsa = pkey->pkey.dsa;-
100 if (pkey->save_parameters
pkey->save_parametersDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& dsa->p
dsa->pDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& dsa->q
dsa->qDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& dsa->g
dsa->gDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-18
101 str = ASN1_STRING_new();-
102 if (str ==
str == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-18
103 ((void *)0)
str == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-18
104 ) {-
105 ERR_put_error(10,(118),((1|64)),__FILE__,91);-
106 goto
never executed: goto err;
err;
never executed: goto err;
0
107 }-
108 str->length = i2d_DSAparams(dsa, &str->data);-
109 if (str->length <= 0
str->length <= 0Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-18
110 ERR_put_error(10,(118),((1|64)),__FILE__,96);-
111 goto
never executed: goto err;
err;
never executed: goto err;
0
112 }-
113 ptype = 16;-
114 }
executed 18 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
18
115 ptype = -1;
never executed: ptype = -1;
0
116-
117 pubint = BN_to_ASN1_INTEGER(dsa->pub_key, -
118 ((void *)0)-
119 );-
120-
121 if (pubint ==
pubint == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-18
122 ((void *)0)
pubint == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-18
123 ) {-
124 ERR_put_error(10,(118),((1|64)),__FILE__,106);-
125 goto
never executed: goto err;
err;
never executed: goto err;
0
126 }-
127-
128 penclen = i2d_ASN1_INTEGER(pubint, &penc);-
129 ASN1_INTEGER_free(pubint);-
130-
131 if (penclen <= 0
penclen <= 0Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-18
132 ERR_put_error(10,(118),((1|64)),__FILE__,114);-
133 goto
never executed: goto err;
err;
never executed: goto err;
0
134 }-
135-
136 aobj = OBJ_nid2obj(116);-
137 if (aobj ==
aobj == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-18
138 ((void *)0)
aobj == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-18
139 )-
140 goto
never executed: goto err;
err;
never executed: goto err;
0
141-
142 if (X509_PUBKEY_set0_param(pk, aobj, ptype, str, penc, penclen)
X509_PUBKEY_se...penc, penclen)Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-18
143 return
executed 18 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 18 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
18
144-
145 err:
code before this statement never executed: err:
0
146 CRYPTO_free(penc, __FILE__, 126);-
147 ASN1_STRING_free(str);-
148-
149 return
never executed: return 0;
0;
never executed: return 0;
0
150}-
151-
152-
153-
154-
155-
156-
157static int dsa_priv_decode(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8)-
158{-
159 const unsigned char *p, *pm;-
160 int pklen, pmlen;-
161 int ptype;-
162 const void *pval;-
163 const ASN1_STRING *pstr;-
164 const X509_ALGOR *palg;-
165 ASN1_INTEGER *privkey = -
166 ((void *)0)-
167 ;-
168 BN_CTX *ctx = -
169 ((void *)0)-
170 ;-
171-
172 DSA *dsa = -
173 ((void *)0)-
174 ;-
175-
176 int ret = 0;-
177-
178 if (!PKCS8_pkey_get0(
!PKCS8_pkey_ge...en, &palg, p8)Description
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-50
179 ((void *)0)
!PKCS8_pkey_ge...en, &palg, p8)Description
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-50
180 , &p, &pklen, &palg, p8)
!PKCS8_pkey_ge...en, &palg, p8)Description
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-50
181 return
never executed: return 0;
0;
never executed: return 0;
0
182 X509_ALGOR_get0(-
183 ((void *)0)-
184 , &ptype, &pval, palg);-
185-
186 if ((
(privkey = d2i...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 49 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
privkey = d2i_ASN1_INTEGER(
(privkey = d2i...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 49 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-49
187 ((void *)0)
(privkey = d2i...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 49 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-49
188 , &p, pklen)) ==
(privkey = d2i...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 49 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-49
189 ((void *)0)
(privkey = d2i...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 49 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-49
190 )-
191 goto
executed 1 time by 1 test: goto decerr;
Executed by:
  • libcrypto.so.1.1
decerr;
executed 1 time by 1 test: goto decerr;
Executed by:
  • libcrypto.so.1.1
1
192 if (privkey->type == (2 | 0x100)
privkey->type == (2 | 0x100)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 48 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ptype != 16
ptype != 16Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 47 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-48
193 goto
executed 2 times by 1 test: goto decerr;
Executed by:
  • libcrypto.so.1.1
decerr;
executed 2 times by 1 test: goto decerr;
Executed by:
  • libcrypto.so.1.1
2
194-
195 pstr = pval;-
196 pm = pstr->data;-
197 pmlen = pstr->length;-
198 if ((
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dsa = d2i_DSAparams(
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-46
199 ((void *)0)
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-46
200 , &pm, pmlen)) ==
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-46
201 ((void *)0)
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-46
202 )-
203 goto
executed 1 time by 1 test: goto decerr;
Executed by:
  • libcrypto.so.1.1
decerr;
executed 1 time by 1 test: goto decerr;
Executed by:
  • libcrypto.so.1.1
1
204-
205 if ((
(dsa->priv_key...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dsa->priv_key = BN_secure_new()) ==
(dsa->priv_key...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-46
206 ((void *)0)
(dsa->priv_key...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-46
207 -
208 || !ASN1_INTEGER_to_BN(privkey, dsa->priv_key)
!ASN1_INTEGER_...dsa->priv_key)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-46
209 ERR_put_error(10,(115),(109),__FILE__,169);-
210 goto
never executed: goto dsaerr;
dsaerr;
never executed: goto dsaerr;
0
211 }-
212-
213 if ((
(dsa->pub_key ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dsa->pub_key = BN_new()) ==
(dsa->pub_key ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-46
214 ((void *)0)
(dsa->pub_key ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-46
215 ) {-
216 ERR_put_error(10,(115),((1|64)),__FILE__,174);-
217 goto
never executed: goto dsaerr;
dsaerr;
never executed: goto dsaerr;
0
218 }-
219 if ((
(ctx = BN_CTX_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx = BN_CTX_new()) ==
(ctx = BN_CTX_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-46
220 ((void *)0)
(ctx = BN_CTX_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-46
221 ) {-
222 ERR_put_error(10,(115),((1|64)),__FILE__,178);-
223 goto
never executed: goto dsaerr;
dsaerr;
never executed: goto dsaerr;
0
224 }-
225-
226 BN_set_flags(dsa->priv_key, 0x04);-
227 if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)
!BN_mod_exp(ds..., dsa->p, ctx)Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-46
228 ERR_put_error(10,(115),(109),__FILE__,184);-
229 goto
never executed: goto dsaerr;
dsaerr;
never executed: goto dsaerr;
0
230 }-
231-
232 EVP_PKEY_assign((pkey),116, (char *)(dsa));-
233-
234 ret = 1;-
235 goto
executed 46 times by 1 test: goto done;
Executed by:
  • libcrypto.so.1.1
done;
executed 46 times by 1 test: goto done;
Executed by:
  • libcrypto.so.1.1
46
236-
237 decerr:-
238 ERR_put_error(10,(115),(104),__FILE__,194);-
239 dsaerr:
code before this statement executed 4 times by 1 test: dsaerr:
Executed by:
  • libcrypto.so.1.1
4
240 DSA_free(dsa);-
241 done:
code before this statement executed 4 times by 1 test: done:
Executed by:
  • libcrypto.so.1.1
4
242 BN_CTX_free(ctx);-
243 ASN1_STRING_clear_free(privkey);-
244 return
executed 50 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 50 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
50
245}-
246-
247static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)-
248{-
249 ASN1_STRING *params = -
250 ((void *)0)-
251 ;-
252 ASN1_INTEGER *prkey = -
253 ((void *)0)-
254 ;-
255 unsigned char *dp = -
256 ((void *)0)-
257 ;-
258 int dplen;-
259-
260 if (!pkey->pkey.dsa
!pkey->pkey.dsaDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !pkey->pkey.dsa->priv_key
!pkey->pkey.dsa->priv_keyDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4
261 ERR_put_error(10,(116),(101),__FILE__,211);-
262 goto
never executed: goto err;
err;
never executed: goto err;
0
263 }-
264-
265 params = ASN1_STRING_new();-
266-
267 if (params ==
params == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
268 ((void *)0)
params == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
269 ) {-
270 ERR_put_error(10,(116),((1|64)),__FILE__,218);-
271 goto
never executed: goto err;
err;
never executed: goto err;
0
272 }-
273-
274 params->length = i2d_DSAparams(pkey->pkey.dsa, &params->data);-
275 if (params->length <= 0
params->length <= 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4
276 ERR_put_error(10,(116),((1|64)),__FILE__,224);-
277 goto
never executed: goto err;
err;
never executed: goto err;
0
278 }-
279 params->type = 16;-
280-
281-
282 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, -
283 ((void *)0)-
284 );-
285-
286 if (!prkey
!prkeyDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4
287 ERR_put_error(10,(116),(109),__FILE__,233);-
288 goto
never executed: goto err;
err;
never executed: goto err;
0
289 }-
290-
291 dplen = i2d_ASN1_INTEGER(prkey, &dp);-
292-
293 ASN1_STRING_clear_free(prkey);-
294 prkey = -
295 ((void *)0)-
296 ;-
297-
298 if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(116), 0,
!PKCS8_pkey_se...ms, dp, dplen)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
299 16, params, dp, dplen)
!PKCS8_pkey_se...ms, dp, dplen)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4
300 goto
never executed: goto err;
err;
never executed: goto err;
0
301-
302 return
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4
303-
304 err:-
305 CRYPTO_free(dp, __FILE__, 249);-
306 ASN1_STRING_free(params);-
307 ASN1_STRING_clear_free(prkey);-
308 return
never executed: return 0;
0;
never executed: return 0;
0
309}-
310-
311static int int_dsa_size(const EVP_PKEY *pkey)-
312{-
313 return
executed 368 times by 1 test: return DSA_size(pkey->pkey.dsa);
Executed by:
  • libcrypto.so.1.1
DSA_size(pkey->pkey.dsa);
executed 368 times by 1 test: return DSA_size(pkey->pkey.dsa);
Executed by:
  • libcrypto.so.1.1
368
314}-
315-
316static int dsa_bits(const EVP_PKEY *pkey)-
317{-
318 return
executed 18 times by 1 test: return DSA_bits(pkey->pkey.dsa);
Executed by:
  • libcrypto.so.1.1
DSA_bits(pkey->pkey.dsa);
executed 18 times by 1 test: return DSA_bits(pkey->pkey.dsa);
Executed by:
  • libcrypto.so.1.1
18
319}-
320-
321static int dsa_security_bits(const EVP_PKEY *pkey)-
322{-
323 return
executed 2017 times by 1 test: return DSA_security_bits(pkey->pkey.dsa);
Executed by:
  • libcrypto.so.1.1
DSA_security_bits(pkey->pkey.dsa);
executed 2017 times by 1 test: return DSA_security_bits(pkey->pkey.dsa);
Executed by:
  • libcrypto.so.1.1
2017
324}-
325-
326static int dsa_missing_parameters(const EVP_PKEY *pkey)-
327{-
328 DSA *dsa;-
329 dsa = pkey->pkey.dsa;-
330 if (dsa ==
dsa == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4546 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4546
331 ((void *)0)
dsa == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4546 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4546
332 || dsa->p ==
dsa->p == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4546 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4546
333 ((void *)0)
dsa->p == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4546 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4546
334 || dsa->q ==
dsa->q == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4546 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4546
335 ((void *)0)
dsa->q == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4546 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4546
336 || dsa->g ==
dsa->g == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4546 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4546
337 ((void *)0)
dsa->g == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4546 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4546
338 )-
339 return
never executed: return 1;
1;
never executed: return 1;
0
340 return
executed 4546 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 4546 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
4546
341}-
342-
343static int dsa_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)-
344{-
345 BIGNUM *a;-
346-
347 if (to->pkey.dsa ==
to->pkey.dsa == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
348 ((void *)0)
to->pkey.dsa == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
349 ) {-
350 to->pkey.dsa = DSA_new();-
351 if (to->pkey.dsa ==
to->pkey.dsa == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
352 ((void *)0)
to->pkey.dsa == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
353 )-
354 return
never executed: return 0;
0;
never executed: return 0;
0
355 }
never executed: end of block
0
356-
357 if ((
(a = BN_dup(fr...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
a = BN_dup(from->pkey.dsa->p)) ==
(a = BN_dup(fr...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
358 ((void *)0)
(a = BN_dup(fr...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
359 )-
360 return
never executed: return 0;
0;
never executed: return 0;
0
361 BN_free(to->pkey.dsa->p);-
362 to->pkey.dsa->p = a;-
363-
364 if ((
(a = BN_dup(fr...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
a = BN_dup(from->pkey.dsa->q)) ==
(a = BN_dup(fr...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
365 ((void *)0)
(a = BN_dup(fr...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
366 )-
367 return
never executed: return 0;
0;
never executed: return 0;
0
368 BN_free(to->pkey.dsa->q);-
369 to->pkey.dsa->q = a;-
370-
371 if ((
(a = BN_dup(fr...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
a = BN_dup(from->pkey.dsa->g)) ==
(a = BN_dup(fr...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
372 ((void *)0)
(a = BN_dup(fr...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
373 )-
374 return
never executed: return 0;
0;
never executed: return 0;
0
375 BN_free(to->pkey.dsa->g);-
376 to->pkey.dsa->g = a;-
377 return
never executed: return 1;
1;
never executed: return 1;
0
378}-
379-
380static int dsa_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b)-
381{-
382 if (BN_cmp(a->pkey.dsa->p, b->pkey.dsa->p)
BN_cmp(a->pkey...->pkey.dsa->p)Description
TRUEnever evaluated
FALSEevaluated 4036 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-4036
383 BN_cmp(a->pkey.dsa->q, b->pkey.dsa->q)
BN_cmp(a->pkey...->pkey.dsa->q)Description
TRUEnever evaluated
FALSEevaluated 4036 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
||
0-4036
384 BN_cmp(a->pkey.dsa->g, b->pkey.dsa->g)
BN_cmp(a->pkey...->pkey.dsa->g)Description
TRUEnever evaluated
FALSEevaluated 4036 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4036
385 return
never executed: return 0;
0;
never executed: return 0;
0
386 else-
387 return
executed 4036 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 4036 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4036
388}-
389-
390static int dsa_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b)-
391{-
392 if (BN_cmp(b->pkey.dsa->pub_key, a->pkey.dsa->pub_key) != 0
BN_cmp(b->pkey...>pub_key) != 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2037 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2-2037
393 return
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 2 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
2
394 else-
395 return
executed 2037 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2037 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2037
396}-
397-
398static void int_dsa_free(EVP_PKEY *pkey)-
399{-
400 DSA_free(pkey->pkey.dsa);-
401}
executed 8190 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8190
402-
403static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype)-
404{-
405 int ret = 0;-
406 const char *ktype = -
407 ((void *)0)-
408 ;-
409 const BIGNUM *priv_key, *pub_key;-
410-
411 if (ptype == 2
ptype == 2Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
12-21
412 priv_key = x->priv_key;
executed 12 times by 1 test: priv_key = x->priv_key;
Executed by:
  • libcrypto.so.1.1
12
413 else-
414 priv_key =
executed 21 times by 1 test: priv_key = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
21
415 ((void *)0)
executed 21 times by 1 test: priv_key = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
21
416 ;
executed 21 times by 1 test: priv_key = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
21
417-
418 if (ptype > 0
ptype > 0Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
13-20
419 pub_key = x->pub_key;
executed 20 times by 1 test: pub_key = x->pub_key;
Executed by:
  • libcrypto.so.1.1
20
420 else-
421 pub_key =
executed 13 times by 1 test: pub_key = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
13
422 ((void *)0)
executed 13 times by 1 test: pub_key = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
13
423 ;
executed 13 times by 1 test: pub_key = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
13
424-
425 if (ptype == 2
ptype == 2Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
12-21
426 ktype = "Private-Key";
executed 12 times by 1 test: ktype = "Private-Key";
Executed by:
  • libcrypto.so.1.1
12
427 else if (ptype == 1
ptype == 1Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8-13
428 ktype = "Public-Key";
executed 8 times by 1 test: ktype = "Public-Key";
Executed by:
  • libcrypto.so.1.1
8
429 else-
430 ktype = "DSA-Parameters";
executed 13 times by 1 test: ktype = "DSA-Parameters";
Executed by:
  • libcrypto.so.1.1
13
431-
432 if (priv_key
priv_keyDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
9-24
433 if (!BIO_indent(bp, off, 128)
!BIO_indent(bp, off, 128)Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-9
434 goto
never executed: goto err;
err;
never executed: goto err;
0
435 if (BIO_printf(bp, "%s: (%d bit)\n", ktype, BN_num_bits(x->p))
BIO_printf(bp,...ts(x->p)) <= 0Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9
436 <= 0
BIO_printf(bp,...ts(x->p)) <= 0Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-9
437 goto
never executed: goto err;
err;
never executed: goto err;
0
438 }
executed 9 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
9
439-
440 if (!ASN1_bn_print(bp, "priv:", priv_key,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
441 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
442 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-33
443 goto
never executed: goto err;
err;
never executed: goto err;
0
444 if (!ASN1_bn_print(bp, "pub: ", pub_key,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
445 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
446 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-33
447 goto
never executed: goto err;
err;
never executed: goto err;
0
448 if (!ASN1_bn_print(bp, "P: ", x->p,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
449 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
450 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-33
451 goto
never executed: goto err;
err;
never executed: goto err;
0
452 if (!ASN1_bn_print(bp, "Q: ", x->q,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
453 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
454 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-33
455 goto
never executed: goto err;
err;
never executed: goto err;
0
456 if (!ASN1_bn_print(bp, "G: ", x->g,
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
457 ((void *)0)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-33
458 , off)
!ASN1_bn_print...id *)0) , off)Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-33
459 goto
never executed: goto err;
err;
never executed: goto err;
0
460 ret = 1;-
461 err:
code before this statement executed 33 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
33
462 return
executed 33 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 33 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
33
463}-
464-
465static int dsa_param_decode(EVP_PKEY *pkey,-
466 const unsigned char **pder, int derlen)-
467{-
468 DSA *dsa;-
469-
470 if ((
(dsa = d2i_DSA...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
dsa = d2i_DSAparams(
(dsa = d2i_DSA...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
471 ((void *)0)
(dsa = d2i_DSA...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
472 , pder, derlen)) ==
(dsa = d2i_DSA...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
473 ((void *)0)
(dsa = d2i_DSA...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
474 ) {-
475 ERR_put_error(10,(119),(10),__FILE__,381);-
476 return
never executed: return 0;
0;
never executed: return 0;
0
477 }-
478 EVP_PKEY_assign((pkey),116, (char *)(dsa));-
479 return
never executed: return 1;
1;
never executed: return 1;
0
480}-
481-
482static int dsa_param_encode(const EVP_PKEY *pkey, unsigned char **pder)-
483{-
484 return
never executed: return i2d_DSAparams(pkey->pkey.dsa, pder);
i2d_DSAparams(pkey->pkey.dsa, pder);
never executed: return i2d_DSAparams(pkey->pkey.dsa, pder);
0
485}-
486-
487static int dsa_param_print(BIO *bp, const EVP_PKEY *pkey, int indent,-
488 ASN1_PCTX *ctx)-
489{-
490 return
executed 13 times by 1 test: return do_dsa_print(bp, pkey->pkey.dsa, indent, 0);
Executed by:
  • libcrypto.so.1.1
do_dsa_print(bp, pkey->pkey.dsa, indent, 0);
executed 13 times by 1 test: return do_dsa_print(bp, pkey->pkey.dsa, indent, 0);
Executed by:
  • libcrypto.so.1.1
13
491}-
492-
493static int dsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent,-
494 ASN1_PCTX *ctx)-
495{-
496 return
executed 8 times by 1 test: return do_dsa_print(bp, pkey->pkey.dsa, indent, 1);
Executed by:
  • libcrypto.so.1.1
do_dsa_print(bp, pkey->pkey.dsa, indent, 1);
executed 8 times by 1 test: return do_dsa_print(bp, pkey->pkey.dsa, indent, 1);
Executed by:
  • libcrypto.so.1.1
8
497}-
498-
499static int dsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,-
500 ASN1_PCTX *ctx)-
501{-
502 return
executed 12 times by 1 test: return do_dsa_print(bp, pkey->pkey.dsa, indent, 2);
Executed by:
  • libcrypto.so.1.1
do_dsa_print(bp, pkey->pkey.dsa, indent, 2);
executed 12 times by 1 test: return do_dsa_print(bp, pkey->pkey.dsa, indent, 2);
Executed by:
  • libcrypto.so.1.1
12
503}-
504-
505static int old_dsa_priv_decode(EVP_PKEY *pkey,-
506 const unsigned char **pder, int derlen)-
507{-
508 DSA *dsa;-
509-
510 if ((
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2008 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dsa = d2i_DSAPrivateKey(
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2008 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
29-2008
511 ((void *)0)
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2008 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
29-2008
512 , pder, derlen)) ==
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2008 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
29-2008
513 ((void *)0)
(dsa = d2i_DSA...== ((void *)0)Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2008 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
29-2008
514 ) {-
515 ERR_put_error(10,(122),(10),__FILE__,417);-
516 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
517 }-
518 EVP_PKEY_assign((pkey),116, (char *)(dsa));-
519 return
executed 2008 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2008 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2008
520}-
521-
522static int old_dsa_priv_encode(const EVP_PKEY *pkey, unsigned char **pder)-
523{-
524 return
executed 7 times by 1 test: return i2d_DSAPrivateKey(pkey->pkey.dsa, pder);
Executed by:
  • libcrypto.so.1.1
i2d_DSAPrivateKey(pkey->pkey.dsa, pder);
executed 7 times by 1 test: return i2d_DSAPrivateKey(pkey->pkey.dsa, pder);
Executed by:
  • libcrypto.so.1.1
7
525}-
526-
527static int dsa_sig_print(BIO *bp, const X509_ALGOR *sigalg,-
528 const ASN1_STRING *sig, int indent, ASN1_PCTX *pctx)-
529{-
530 DSA_SIG *dsa_sig;-
531 const unsigned char *p;-
532-
533 if (!sig
!sigDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 64 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
46-64
534 if (BIO_puts(bp, "\n") <= 0
BIO_puts(bp, "\n") <= 0Description
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-46
535 return
never executed: return 0;
0;
never executed: return 0;
0
536 else-
537 return
executed 46 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 46 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
46
538 }-
539 p = sig->data;-
540 dsa_sig = d2i_DSA_SIG(-
541 ((void *)0)-
542 , &p, sig->length);-
543 if (dsa_sig
dsa_sigDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 43 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
21-43
544 int rv = 0;-
545 const BIGNUM *r, *s;-
546-
547 DSA_SIG_get0(dsa_sig, &r, &s);-
548-
549 if (BIO_write(bp, "\n", 1) != 1
BIO_write(bp, "\n", 1) != 1Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-21
550 goto
never executed: goto err;
err;
never executed: goto err;
0
551-
552 if (!ASN1_bn_print(bp, "r: ", r,
!ASN1_bn_print...*)0) , indent)Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-21
553 ((void *)0)
!ASN1_bn_print...*)0) , indent)Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-21
554 , indent)
!ASN1_bn_print...*)0) , indent)Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-21
555 goto
never executed: goto err;
err;
never executed: goto err;
0
556 if (!ASN1_bn_print(bp, "s: ", s,
!ASN1_bn_print...*)0) , indent)Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-21
557 ((void *)0)
!ASN1_bn_print...*)0) , indent)Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-21
558 , indent)
!ASN1_bn_print...*)0) , indent)Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-21
559 goto
never executed: goto err;
err;
never executed: goto err;
0
560 rv = 1;-
561 err:
code before this statement executed 21 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
21
562 DSA_SIG_free(dsa_sig);-
563 return
executed 21 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
rv;
executed 21 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
21
564 }-
565 return
executed 43 times by 1 test: return X509_signature_dump(bp, sig, indent);
Executed by:
  • libcrypto.so.1.1
X509_signature_dump(bp, sig, indent);
executed 43 times by 1 test: return X509_signature_dump(bp, sig, indent);
Executed by:
  • libcrypto.so.1.1
43
566}-
567-
568static int dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)-
569{-
570 switch (op) {-
571 case
executed 11 times by 1 test: case 0x1:
Executed by:
  • libcrypto.so.1.1
0x1:
executed 11 times by 1 test: case 0x1:
Executed by:
  • libcrypto.so.1.1
11
572 if (arg1 == 0
arg1 == 0Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-11
573 int snid, hnid;-
574 X509_ALGOR *alg1, *alg2;-
575 PKCS7_SIGNER_INFO_get0_algs(arg2, -
576 ((void *)0)-
577 , &alg1, &alg2);-
578 if (alg1 ==
alg1 == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-11
579 ((void *)0)
alg1 == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-11
580 || alg1->algorithm ==
alg1->algorithm == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-11
581 ((void *)0)
alg1->algorithm == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-11
582 )-
583 return
never executed: return -1;
-1;
never executed: return -1;
0
584 hnid = OBJ_obj2nid(alg1->algorithm);-
585 if (hnid == 0
hnid == 0Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11
586 return
never executed: return -1;
-1;
never executed: return -1;
0
587 if (!OBJ_find_sigid_by_algs(&snid, hnid, EVP_PKEY_id(pkey))
!OBJ_find_sigi...PKEY_id(pkey))Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-11
588 return
never executed: return -1;
-1;
never executed: return -1;
0
589 X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), -1, 0);-
590 }
executed 11 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
11
591 return
executed 11 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 11 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
11
592-
593 case
executed 54 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
0x5:
executed 54 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
54
594 if (arg1 == 0
arg1 == 0Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 28 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
26-28
595 int snid, hnid;-
596 X509_ALGOR *alg1, *alg2;-
597 CMS_SignerInfo_get0_algs(arg2, -
598 ((void *)0)-
599 , -
600 ((void *)0)-
601 , &alg1, &alg2);-
602 if (alg1 ==
alg1 == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26
603 ((void *)0)
alg1 == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26
604 || alg1->algorithm ==
alg1->algorithm == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26
605 ((void *)0)
alg1->algorithm == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26
606 )-
607 return
never executed: return -1;
-1;
never executed: return -1;
0
608 hnid = OBJ_obj2nid(alg1->algorithm);-
609 if (hnid == 0
hnid == 0Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-26
610 return
never executed: return -1;
-1;
never executed: return -1;
0
611 if (!OBJ_find_sigid_by_algs(&snid, hnid, EVP_PKEY_id(pkey))
!OBJ_find_sigi...PKEY_id(pkey))Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-26
612 return
never executed: return -1;
-1;
never executed: return -1;
0
613 X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), -1, 0);-
614 }
executed 26 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
26
615 return
executed 54 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 54 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
54
616-
617 case
never executed: case 0x8:
0x8:
never executed: case 0x8:
0
618 *(int *)arg2 = -1;-
619 return
never executed: return 1;
1;
never executed: return 1;
0
620-
621-
622 case
executed 38 times by 1 test: case 0x3:
Executed by:
  • libcrypto.so.1.1
0x3:
executed 38 times by 1 test: case 0x3:
Executed by:
  • libcrypto.so.1.1
38
623 *(int *)arg2 = 672;-
624 return
executed 38 times by 1 test: return 2;
Executed by:
  • libcrypto.so.1.1
2;
executed 38 times by 1 test: return 2;
Executed by:
  • libcrypto.so.1.1
38
625-
626 default
never executed: default:
:
never executed: default:
0
627 return
never executed: return -2;
-2;
never executed: return -2;
0
628-
629 }-
630-
631}-
632-
633-
634-
635const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[5] = {-
636-
637 {-
638 66,-
639 116,-
640 0x1},-
641-
642 {-
643 67,-
644 116,-
645 0x1},-
646-
647 {-
648 70,-
649 116,-
650 0x1},-
651-
652 {-
653 113,-
654 116,-
655 0x1},-
656-
657 {-
658 116,-
659 116,-
660 0,-
661-
662 "DSA",-
663 "OpenSSL DSA method",-
664-
665 dsa_pub_decode,-
666 dsa_pub_encode,-
667 dsa_pub_cmp,-
668 dsa_pub_print,-
669-
670 dsa_priv_decode,-
671 dsa_priv_encode,-
672 dsa_priv_print,-
673-
674 int_dsa_size,-
675 dsa_bits,-
676 dsa_security_bits,-
677-
678 dsa_param_decode,-
679 dsa_param_encode,-
680 dsa_missing_parameters,-
681 dsa_copy_parameters,-
682 dsa_cmp_parameters,-
683 dsa_param_print,-
684 dsa_sig_print,-
685-
686 int_dsa_free,-
687 dsa_pkey_ctrl,-
688 old_dsa_priv_decode,-
689 old_dsa_priv_encode}-
690};-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2