OpenCoverage

tasn_dec.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/tasn_dec.c
Switch to Source codePreprocessed file
LineSourceCount
1static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,-
2 long len, const ASN1_ITEM *it,-
3 int tag, int aclass, char opt, ASN1_TLC *ctx,-
4 int depth);-
5-
6static int asn1_check_eoc(const unsigned char **in, long len);-
7static int asn1_find_end(const unsigned char **in, long len, char inf);-
8-
9static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len,-
10 char inf, int tag, int aclass, int depth);-
11-
12static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen);-
13-
14static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass,-
15 char *inf, char *cst,-
16 const unsigned char **in, long len,-
17 int exptag, int expclass, char opt, ASN1_TLC *ctx);-
18-
19static int asn1_template_ex_d2i(ASN1_VALUE **pval,-
20 const unsigned char **in, long len,-
21 const ASN1_TEMPLATE *tt, char opt,-
22 ASN1_TLC *ctx, int depth);-
23static int asn1_template_noexp_d2i(ASN1_VALUE **val,-
24 const unsigned char **in, long len,-
25 const ASN1_TEMPLATE *tt, char opt,-
26 ASN1_TLC *ctx, int depth);-
27static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,-
28 const unsigned char **in, long len,-
29 const ASN1_ITEM *it,-
30 int tag, int aclass, char opt,-
31 ASN1_TLC *ctx);-
32static int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,-
33 int utype, char *free_cont, const ASN1_ITEM *it);-
34-
35-
36static const unsigned long tag2bit[32] = {-
37-
38 0, 0, 0, 0x0400,-
39-
40 0x0200, 0, 0, 0x1000,-
41-
42 0x1000, 0x1000, 0x1000, 0x1000,-
43-
44 0x2000, 0x1000, 0x1000, 0x1000,-
45-
46 0x10000, 0, 0x0001, 0x0002,-
47-
48 0x0004, 0x0008, 0x0010,-
49-
50 0x4000, 0x8000,-
51-
52 0x0020, 0x0040, 0x0080,-
53-
54 0x0100, 0x1000, 0x0800, 0x1000,-
55};-
56-
57unsigned long ASN1_tag2bit(int tag)-
58{-
59 if ((
(tag < 0)Description
TRUEnever evaluated
FALSEevaluated 426869 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
tag < 0)
(tag < 0)Description
TRUEnever evaluated
FALSEevaluated 426869 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(tag > 30)Description
TRUEevaluated 5655 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 421214 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
tag > 30)
(tag > 30)Description
TRUEevaluated 5655 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 421214 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-426869
60 return
executed 5655 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 5655 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
5655
61 return
executed 421214 times by 1 test: return tag2bit[tag];
Executed by:
  • libcrypto.so.1.1
tag2bit[tag];
executed 421214 times by 1 test: return tag2bit[tag];
Executed by:
  • libcrypto.so.1.1
421214
62}-
63ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval,-
64 const unsigned char **in, long len,-
65 const ASN1_ITEM *it)-
66{-
67 ASN1_TLC c;-
68 ASN1_VALUE *ptmpval = -
69 ((void *)0)-
70 ;-
71 if (!pval
!pvalDescription
TRUEevaluated 1044253 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 9281 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
9281-1044253
72 pval = &ptmpval;
executed 1044253 times by 2 tests: pval = &ptmpval;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1044253
73 (&c)->valid = 0;-
74 if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0
ASN1_item_ex_d... 0, 0, &c) > 0Description
TRUEevaluated 440372 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 613162 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
440372-613162
75 return
executed 440372 times by 2 tests: return *pval;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
*pval;
executed 440372 times by 2 tests: return *pval;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
440372
76 return
executed 613162 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 613162 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
613162
77 ((void *)0)
executed 613162 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
613162
78 ;
executed 613162 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
613162
79}-
80-
81int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,-
82 const ASN1_ITEM *it,-
83 int tag, int aclass, char opt, ASN1_TLC *ctx)-
84{-
85 int rv;-
86 rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0);-
87 if (rv <= 0
rv <= 0Description
TRUEevaluated 628266 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 564053 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
564053-628266
88 ASN1_item_ex_free(pval, it);
executed 628266 times by 1 test: ASN1_item_ex_free(pval, it);
Executed by:
  • libcrypto.so.1.1
628266
89 return
executed 1192319 times by 2 tests: return rv;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
rv;
executed 1192319 times by 2 tests: return rv;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1192319
90}-
91-
92-
93-
94-
95-
96-
97static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,-
98 long len, const ASN1_ITEM *it,-
99 int tag, int aclass, char opt, ASN1_TLC *ctx,-
100 int depth)-
101{-
102 const ASN1_TEMPLATE *tt, *errtt = -
103 ((void *)0)-
104 ;-
105 const ASN1_EXTERN_FUNCS *ef;-
106 const ASN1_AUX *aux = it->funcs;-
107 ASN1_aux_cb *asn1_cb;-
108 const unsigned char *p = -
109 ((void *)0)-
110 , *q;-
111 unsigned char oclass;-
112 char seq_eoc, seq_nolen, cst, isopt;-
113 long tmplen;-
114 int i;-
115 int otag;-
116 int ret = 0;-
117 ASN1_VALUE **pchptr;-
118 if (!pval
!pvalDescription
TRUEnever evaluated
FALSEevaluated 5388010 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-5388010
119 return
never executed: return 0;
0;
never executed: return 0;
0
120 if (aux
auxDescription
TRUEevaluated 762076 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 4625934 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& aux->asn1_cb
aux->asn1_cbDescription
TRUEevaluated 577368 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 184708 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
184708-4625934
121 asn1_cb = aux->asn1_cb;
executed 577368 times by 2 tests: asn1_cb = aux->asn1_cb;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
577368
122 else-
123 asn1_cb = 0;
executed 4810642 times by 2 tests: asn1_cb = 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4810642
124-
125 if (++
++depth > 30Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5388009 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
depth > 30
++depth > 30Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5388009 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
1-5388009
126 ERR_put_error(13,(120),(201),__FILE__,160);-
127 goto
executed 1 time by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1 time by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1
128 }-
129-
130 switch (it->itype) {-
131 case
executed 3075763 times by 2 tests: case 0x0:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x0:
executed 3075763 times by 2 tests: case 0x0:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3075763
132 if (it->templates
it->templatesDescription
TRUEevaluated 333662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2742101 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
333662-2742101
133-
134-
135-
136-
137-
138-
139 if ((
(tag != -1)Description
TRUEnever evaluated
FALSEevaluated 333662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
tag != -1)
(tag != -1)Description
TRUEnever evaluated
FALSEevaluated 333662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| opt
optDescription
TRUEnever evaluated
FALSEevaluated 333662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-333662
140 ERR_put_error(13,(120),(170),__FILE__,175)-
141 ;-
142 goto
never executed: goto err;
err;
never executed: goto err;
0
143 }-
144 return
executed 333662 times by 1 test: return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx, depth);
Executed by:
  • libcrypto.so.1.1
asn1_template_ex_d2i(pval, in, len,
executed 333662 times by 1 test: return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx, depth);
Executed by:
  • libcrypto.so.1.1
333662
145 it->templates, opt, ctx, depth);
executed 333662 times by 1 test: return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx, depth);
Executed by:
  • libcrypto.so.1.1
333662
146 }-
147 return
executed 2742101 times by 2 tests: return asn1_d2i_ex_primitive(pval, in, len, it, tag, aclass, opt, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
asn1_d2i_ex_primitive(pval, in, len, it,
executed 2742101 times by 2 tests: return asn1_d2i_ex_primitive(pval, in, len, it, tag, aclass, opt, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2742101
148 tag, aclass, opt, ctx);
executed 2742101 times by 2 tests: return asn1_d2i_ex_primitive(pval, in, len, it, tag, aclass, opt, ctx);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2742101
149-
150 case
executed 338797 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
0x5:
executed 338797 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
338797
151 p = *in;-
152-
153 ret = asn1_check_tlen(-
154 ((void *)0)-
155 , &otag, &oclass, -
156 ((void *)0)-
157 , -
158 ((void *)0)-
159 ,-
160 &p, len, -1, 0, 1, ctx);-
161 if (!ret
!retDescription
TRUEevaluated 1986 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 336811 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1986-336811
162 ERR_put_error(13,(120),(58),__FILE__,190);-
163 goto
executed 1986 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1986 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1986
164 }-
165-
166-
167 if (oclass != 0x00
oclass != 0x00Description
TRUEevaluated 30143 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 306668 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
30143-306668
168-
169 if (opt
optDescription
TRUEevaluated 27426 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2717 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2717-27426
170 return
executed 27426 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 27426 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
27426
171 ERR_put_error(13,(120),(139),__FILE__,199);-
172 goto
executed 2717 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 2717 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
2717
173 }-
174-
175 if (!(ASN1_tag2bit(otag) & it->utype)
!(ASN1_tag2bit...) & it->utype)Description
TRUEevaluated 29666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 277002 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
29666-277002
176-
177 if (opt
optDescription
TRUEevaluated 6116 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 23550 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
6116-23550
178 return
executed 6116 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 6116 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
6116
179 ERR_put_error(13,(120),(140),__FILE__,207);-
180 goto
executed 23550 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 23550 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
23550
181 }-
182 return
executed 277002 times by 1 test: return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx);
Executed by:
  • libcrypto.so.1.1
asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx);
executed 277002 times by 1 test: return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx);
Executed by:
  • libcrypto.so.1.1
277002
183-
184 case
executed 138785 times by 1 test: case 0x4:
Executed by:
  • libcrypto.so.1.1
0x4:
executed 138785 times by 1 test: case 0x4:
Executed by:
  • libcrypto.so.1.1
138785
185-
186 ef = it->funcs;-
187 return
executed 138785 times by 1 test: return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx);
Executed by:
  • libcrypto.so.1.1
ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx);
executed 138785 times by 1 test: return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx);
Executed by:
  • libcrypto.so.1.1
138785
188-
189 case
executed 207436 times by 1 test: case 0x2:
Executed by:
  • libcrypto.so.1.1
0x2:
executed 207436 times by 1 test: case 0x2:
Executed by:
  • libcrypto.so.1.1
207436
190 if (asn1_cb
asn1_cbDescription
TRUEevaluated 32548 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 174888 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !asn1_cb(4, pval, it,
!asn1_cb(4, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 32548 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-174888
191 ((void *)0)
!asn1_cb(4, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 32548 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-32548
192 )
!asn1_cb(4, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 32548 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-32548
193 goto
never executed: goto auxerr;
auxerr;
never executed: goto auxerr;
0
194 if (*
*pvalDescription
TRUEevaluated 22129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 185307 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pval
*pvalDescription
TRUEevaluated 22129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 185307 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
22129-185307
195-
196 i = asn1_get_choice_selector(pval, it);-
197 if ((
(i >= 0)Description
TRUEnever evaluated
FALSEevaluated 22129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i >= 0)
(i >= 0)Description
TRUEnever evaluated
FALSEevaluated 22129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(i < it->tcount)Description
TRUEnever evaluated
FALSEnever evaluated
i < it->tcount)
(i < it->tcount)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-22129
198 tt = it->templates + i;-
199 pchptr = asn1_get_field_ptr(pval, tt);-
200 asn1_template_free(pchptr, tt);-
201 asn1_set_choice_selector(pval, -1, it);-
202 }
never executed: end of block
0
203 }
executed 22129 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (!ASN1_item_ex_new(pval, it)
!ASN1_item_ex_new(pval, it)Description
TRUEnever evaluated
FALSEevaluated 185307 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-185307
204 ERR_put_error(13,(120),(58),__FILE__,230);-
205 goto
never executed: goto err;
err;
never executed: goto err;
0
206 }-
207-
208 p = *in;-
209 for (i = 0, tt = it->templates; i < it->tcount
i < it->tcountDescription
TRUEevaluated 643268 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 31535 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++, tt++) {
31535-643268
210 pchptr = asn1_get_field_ptr(pval, tt);-
211-
212-
213-
214 ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, depth);-
215-
216 if (ret == -1
ret == -1Description
TRUEevaluated 467367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 175901 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
175901-467367
217 continue;
executed 467367 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
467367
218-
219 if (ret > 0
ret > 0Description
TRUEevaluated 128174 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 47727 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
47727-128174
220 break;
executed 128174 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
128174
221-
222-
223-
224-
225 asn1_template_free(pchptr, tt);-
226 errtt = tt;-
227 ERR_put_error(13,(120),(58),__FILE__,253);-
228 goto
executed 47727 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 47727 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
47727
229 }-
230-
231-
232 if (i == it->tcount
i == it->tcountDescription
TRUEevaluated 31535 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 128174 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
31535-128174
233-
234 if (opt
optDescription
TRUEevaluated 1086 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 30449 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1086-30449
235-
236 ASN1_item_ex_free(pval, it);-
237 return
executed 1086 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 1086 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
1086
238 }-
239 ERR_put_error(13,(120),(143),__FILE__,265);-
240 goto
executed 30449 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 30449 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
30449
241 }-
242-
243 asn1_set_choice_selector(pval, i, it);-
244-
245 if (asn1_cb
asn1_cbDescription
TRUEevaluated 24816 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 103358 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !asn1_cb(5, pval, it,
!asn1_cb(5, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 24816 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-103358
246 ((void *)0)
!asn1_cb(5, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 24816 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24816
247 )
!asn1_cb(5, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 24816 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-24816
248 goto
never executed: goto auxerr;
auxerr;
never executed: goto auxerr;
0
249 *in = p;-
250 return
executed 128174 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 128174 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
128174
251-
252 case
executed 40257 times by 1 test: case 0x6:
Executed by:
  • libcrypto.so.1.1
0x6:
executed 40257 times by 1 test: case 0x6:
Executed by:
  • libcrypto.so.1.1
40257
253 case
executed 1586971 times by 2 tests: case 0x1:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x1:
executed 1586971 times by 2 tests: case 0x1:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1586971
254 p = *in;-
255 tmplen = len;-
256-
257-
258 if (tag == -1
tag == -1Description
TRUEevaluated 1468195 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 159033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
159033-1468195
259 tag = 16;-
260 aclass = 0x00;-
261 }
executed 1468195 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1468195
262-
263 ret = asn1_check_tlen(&len, -
264 ((void *)0)-
265 , -
266 ((void *)0)-
267 , &seq_eoc, &cst,-
268 &p, len, tag, aclass, opt, ctx);-
269 if (!ret
!retDescription
TRUEevaluated 119024 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1508204 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
119024-1508204
270 ERR_put_error(13,(120),(58),__FILE__,290);-
271 goto
executed 119024 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 119024 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
119024
272 } else if (ret == -1
ret == -1Description
TRUEevaluated 158106 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1350098 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
158106-1350098
273 return
executed 158106 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 158106 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
158106
274 if (aux
auxDescription
TRUEevaluated 309485 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1040613 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& (
(aux->flags & 4)Description
TRUEnever evaluated
FALSEevaluated 309485 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
aux->flags & 4)
(aux->flags & 4)Description
TRUEnever evaluated
FALSEevaluated 309485 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1040613
275 len = tmplen - (p - *in);-
276 seq_nolen = 1;-
277 }
never executed: end of block
0
278-
279 else-
280 seq_nolen = seq_eoc;
executed 1350098 times by 2 tests: seq_nolen = seq_eoc;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1350098
281 if (!cst
!cstDescription
TRUEevaluated 7603 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1342495 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
7603-1342495
282 ERR_put_error(13,(120),(149),__FILE__,302);-
283 goto
executed 7603 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 7603 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
7603
284 }-
285-
286 if (!*pval
!*pvalDescription
TRUEevaluated 966645 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 375850 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !ASN1_item_ex_new(pval, it)
!ASN1_item_ex_new(pval, it)Description
TRUEnever evaluated
FALSEevaluated 966645 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-966645
287 ERR_put_error(13,(120),(58),__FILE__,307);-
288 goto
never executed: goto err;
err;
never executed: goto err;
0
289 }-
290-
291 if (asn1_cb
asn1_cbDescription
TRUEevaluated 265208 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1077287 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& !asn1_cb(4, pval, it,
!asn1_cb(4, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265208 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1077287
292 ((void *)0)
!asn1_cb(4, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265208 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-265208
293 )
!asn1_cb(4, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265208 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-265208
294 goto
never executed: goto auxerr;
auxerr;
never executed: goto auxerr;
0
295-
296-
297 for (i = 0, tt = it->templates; i < it->tcount
i < it->tcountDescription
TRUEevaluated 4249393 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1342495 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i++, tt++) {
1342495-4249393
298 if (tt->flags & (0x3<<8)
tt->flags & (0x3<<8)Description
TRUEevaluated 29687 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4219706 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
29687-4219706
299 const ASN1_TEMPLATE *seqtt;-
300 ASN1_VALUE **pseqval;-
301 seqtt = asn1_do_adb(pval, tt, 0);-
302 if (seqtt ==
seqtt == ((void *)0)Description
TRUEevaluated 22246 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7441 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7441-22246
303 ((void *)0)
seqtt == ((void *)0)Description
TRUEevaluated 22246 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7441 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7441-22246
304 )-
305 continue;
executed 22246 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
22246
306 pseqval = asn1_get_field_ptr(pval, seqtt);-
307 asn1_template_free(pseqval, seqtt);-
308 }
executed 7441 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7441
309 }
executed 4227147 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4227147
310-
311-
312 for (i = 0, tt = it->templates; i < it->tcount
i < it->tcountDescription
TRUEevaluated 3364357 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 745538 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; i++, tt++) {
745538-3364357
313 const ASN1_TEMPLATE *seqtt;-
314 ASN1_VALUE **pseqval;-
315 seqtt = asn1_do_adb(pval, tt, 1);-
316 if (seqtt ==
seqtt == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3364357 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-3364357
317 ((void *)0)
seqtt == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3364357 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-3364357
318 )-
319 goto
never executed: goto err;
err;
never executed: goto err;
0
320 pseqval = asn1_get_field_ptr(pval, seqtt);-
321-
322 if (!len
!lenDescription
TRUEevaluated 78309 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3286048 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
78309-3286048
323 break;
executed 78309 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
78309
324 q = p;-
325 if (asn1_check_eoc(&p, len)
asn1_check_eoc(&p, len)Description
TRUEevaluated 139562 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3146486 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
139562-3146486
326 if (!seq_eoc
!seq_eocDescription
TRUEevaluated 1023 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 138539 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1023-138539
327 ERR_put_error(13,(120),(159),__FILE__,341);-
328 goto
executed 1023 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1023 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1023
329 }-
330 len -= p - q;-
331 seq_eoc = 0;-
332 q = p;-
333 break;
executed 138539 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
138539
334 }-
335-
336-
337-
338-
339-
340-
341 if (i == (it->tcount - 1)
i == (it->tcount - 1)Description
TRUEevaluated 827565 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2318921 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
827565-2318921
342 isopt = 0;
executed 827565 times by 2 tests: isopt = 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
827565
343 else-
344 isopt = (char)(seqtt->flags & (0x1));
executed 2318921 times by 2 tests: isopt = (char)(seqtt->flags & (0x1));
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2318921
345-
346-
347-
348-
349 ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx,-
350 depth);-
351 if (!ret
!retDescription
TRUEevaluated 379086 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2767400 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
379086-2767400
352 errtt = seqtt;-
353 goto
executed 379086 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 379086 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
379086
354 } else if (ret == -1
ret == -1Description
TRUEevaluated 516782 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2250618 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
516782-2250618
355-
356-
357-
358 asn1_template_free(pseqval, seqtt);-
359 continue;
executed 516782 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
516782
360 }-
361-
362 len -= p - q;-
363 }
executed 2250618 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2250618
364-
365-
366 if (seq_eoc
seq_eocDescription
TRUEevaluated 332997 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 629389 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& !asn1_check_eoc(&p, len)
!asn1_check_eoc(&p, len)Description
TRUEevaluated 6416 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 326581 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
6416-629389
367 ERR_put_error(13,(120),(137),__FILE__,381);-
368 goto
executed 6416 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 6416 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
6416
369 }-
370-
371 if (!seq_nolen
!seq_nolenDescription
TRUEevaluated 490850 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 465120 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& len
lenDescription
TRUEevaluated 1118 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 489732 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
1118-490850
372 ERR_put_error(13,(120),(148),__FILE__,386);-
373 goto
executed 1118 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1118 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1118
374 }-
375-
376-
377-
378-
379-
380-
381 for (; i < it->tcount
i < it->tcountDescription
TRUEevaluated 370403 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 951963 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; tt++, i++) {
370403-951963
382 const ASN1_TEMPLATE *seqtt;-
383 seqtt = asn1_do_adb(pval, tt, 1);-
384 if (seqtt ==
seqtt == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 370403 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-370403
385 ((void *)0)
seqtt == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 370403 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-370403
386 )-
387 goto
never executed: goto err;
err;
never executed: goto err;
0
388 if (seqtt->flags & (0x1)
seqtt->flags & (0x1)Description
TRUEevaluated 367514 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2889 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2889-367514
389 ASN1_VALUE **pseqval;-
390 pseqval = asn1_get_field_ptr(pval, seqtt);-
391 asn1_template_free(pseqval, seqtt);-
392 }
executed 367514 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
367514
393 errtt = seqtt;-
394 ERR_put_error(13,(120),(121),__FILE__,406);-
395 goto
executed 2889 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 2889 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
2889
396 }-
397 }-
398-
399 if (!asn1_enc_save(pval, *in, p - *in, it)
!asn1_enc_save..., p - *in, it)Description
TRUEnever evaluated
FALSEevaluated 951963 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-951963
400 goto
never executed: goto auxerr;
auxerr;
never executed: goto auxerr;
0
401 if (asn1_cb
asn1_cbDescription
TRUEevaluated 187069 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 764894 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& !asn1_cb(5, pval, it,
!asn1_cb(5, pv... ((void *)0) )Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 187061 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8-764894
402 ((void *)0)
!asn1_cb(5, pv... ((void *)0) )Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 187061 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8-187061
403 )
!asn1_cb(5, pv... ((void *)0) )Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 187061 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8-187061
404 goto
executed 8 times by 1 test: goto auxerr;
Executed by:
  • libcrypto.so.1.1
auxerr;
executed 8 times by 1 test: goto auxerr;
Executed by:
  • libcrypto.so.1.1
8
405 *in = p;-
406 return
executed 951955 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 951955 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
951955
407-
408 default
never executed: default:
:
never executed: default:
0
409 return
never executed: return 0;
0;
never executed: return 0;
0
410 }-
411 auxerr:
code before this statement never executed: auxerr:
0
412 ERR_put_error(13,(120),(100),__FILE__,422);-
413 err:
code before this statement executed 8 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
8
414 if (errtt
errttDescription
TRUEevaluated 429702 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 193895 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
193895-429702
415 ERR_add_error_data(4, "Field=", errtt->field_name,
executed 429702 times by 1 test: ERR_add_error_data(4, "Field=", errtt->field_name, ", Type=", it->sname);
Executed by:
  • libcrypto.so.1.1
429702
416 ", Type=", it->sname);
executed 429702 times by 1 test: ERR_add_error_data(4, "Field=", errtt->field_name, ", Type=", it->sname);
Executed by:
  • libcrypto.so.1.1
429702
417 else-
418 ERR_add_error_data(2, "Type=", it->sname);
executed 193895 times by 1 test: ERR_add_error_data(2, "Type=", it->sname);
Executed by:
  • libcrypto.so.1.1
193895
419 return
executed 623597 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 623597 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
623597
420}-
421-
422-
423-
424-
425-
426-
427static int asn1_template_ex_d2i(ASN1_VALUE **val,-
428 const unsigned char **in, long inlen,-
429 const ASN1_TEMPLATE *tt, char opt,-
430 ASN1_TLC *ctx, int depth)-
431{-
432 int flags, aclass;-
433 int ret;-
434 long len;-
435 const unsigned char *p, *q;-
436 char exp_eoc;-
437 if (!val
!valDescription
TRUEnever evaluated
FALSEevaluated 4123416 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-4123416
438 return
never executed: return 0;
0;
never executed: return 0;
0
439 flags = tt->flags;-
440 aclass = flags & (0x3<<6);-
441-
442 p = *in;-
443-
444-
445 if (flags & (0x2 << 3)
flags & (0x2 << 3)Description
TRUEevaluated 270022 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3853394 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
270022-3853394
446 char cst;-
447-
448-
449-
450-
451 ret = asn1_check_tlen(&len, -
452 ((void *)0)-
453 , -
454 ((void *)0)-
455 , &exp_eoc, &cst,-
456 &p, inlen, tt->tag, aclass, opt, ctx);-
457 q = p;-
458 if (!ret
!retDescription
TRUEevaluated 13767 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 256255 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
13767-256255
459 ERR_put_error(13,(132),(58),__FILE__,465);-
460 return
executed 13767 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 13767 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
13767
461 } else if (ret == -1
ret == -1Description
TRUEevaluated 146604 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 109651 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
109651-146604
462 return
executed 146604 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 146604 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
146604
463 if (!cst
!cstDescription
TRUEevaluated 947 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 108704 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
947-108704
464 ERR_put_error(13,(132),(120),__FILE__,471)-
465 ;-
466 return
executed 947 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 947 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
947
467 }-
468-
469 ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth);-
470 if (!ret
!retDescription
TRUEevaluated 12816 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 95888 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
12816-95888
471 ERR_put_error(13,(132),(58),__FILE__,477);-
472 return
executed 12816 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 12816 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
12816
473 }-
474-
475 len -= p - q;-
476 if (exp_eoc
exp_eocDescription
TRUEevaluated 44513 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 51375 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
44513-51375
477-
478 if (!asn1_check_eoc(&p, len)
!asn1_check_eoc(&p, len)Description
TRUEevaluated 1537 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 42976 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1537-42976
479 ERR_put_error(13,(132),(137),__FILE__,485);-
480 goto
executed 1537 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1537 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1537
481 }-
482 }
executed 42976 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
42976
483-
484-
485-
486 if (len
lenDescription
TRUEevaluated 790 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 50585 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
790-50585
487 ERR_put_error(13,(132),(119),__FILE__,494)-
488 ;-
489 goto
executed 790 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 790 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
790
490 }-
491 }
executed 50585 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
50585
492 } else-
493 return
executed 3853394 times by 2 tests: return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth);
executed 3853394 times by 2 tests: return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3853394
494-
495 *in = p;-
496 return
executed 93561 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 93561 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
93561
497-
498 err:-
499 return
executed 2327 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 2327 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
2327
500}-
501-
502static int asn1_template_noexp_d2i(ASN1_VALUE **val,-
503 const unsigned char **in, long len,-
504 const ASN1_TEMPLATE *tt, char opt,-
505 ASN1_TLC *ctx, int depth)-
506{-
507 int flags, aclass;-
508 int ret;-
509 ASN1_VALUE *tval;-
510 const unsigned char *p, *q;-
511 if (!val
!valDescription
TRUEnever evaluated
FALSEevaluated 3962098 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-3962098
512 return
never executed: return 0;
0;
never executed: return 0;
0
513 flags = tt->flags;-
514 aclass = flags & (0x3<<6);-
515-
516 p = *in;-
517 q = p;-
518-
519-
520-
521-
522-
523 if (tt->flags & (0x1 << 12)
tt->flags & (0x1 << 12)Description
TRUEevaluated 669091 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3293007 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
669091-3293007
524 tval = (ASN1_VALUE *)val;-
525 val = &tval;-
526 }
executed 669091 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
669091
527-
528 if (flags & (0x3 << 1)
flags & (0x3 << 1)Description
TRUEevaluated 533882 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3428216 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
533882-3428216
529-
530 int sktag, skaclass;-
531 char sk_eoc;-
532-
533 if (flags & (0x1 << 3)
flags & (0x1 << 3)Description
TRUEevaluated 77332 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 456550 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
77332-456550
534 sktag = tt->tag;-
535 skaclass = aclass;-
536 }
executed 77332 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
77332
537 skaclass = 0x00;-
538 if (flags & (0x1 << 1)
flags & (0x1 << 1)Description
TRUEevaluated 106057 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 350493 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
106057-350493
539 sktag = 17;
executed 106057 times by 1 test: sktag = 17;
Executed by:
  • libcrypto.so.1.1
106057
540 else-
541 sktag = 16;
executed 350493 times by 1 test: sktag = 16;
Executed by:
  • libcrypto.so.1.1
350493
542 }-
543-
544 ret = asn1_check_tlen(&len, -
545 ((void *)0)-
546 , -
547 ((void *)0)-
548 , &sk_eoc, -
549 ((void *)0)-
550 ,-
551 &p, len, sktag, skaclass, opt, ctx);-
552 if (!ret
!retDescription
TRUEevaluated 55199 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 478683 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
55199-478683
553 ERR_put_error(13,(131),(58),__FILE__,553);-
554 return
executed 55199 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 55199 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
55199
555 } else if (ret == -1
ret == -1Description
TRUEevaluated 64322 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 414361 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
64322-414361
556 return
executed 64322 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 64322 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
64322
557 if (!*val
!*valDescription
TRUEevaluated 401725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12636 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
12636-401725
558 *
executed 401725 times by 1 test: *val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
Executed by:
  • libcrypto.so.1.1
val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
executed 401725 times by 1 test: *val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
Executed by:
  • libcrypto.so.1.1
401725
559 else {-
560-
561-
562-
563 struct stack_st_ASN1_VALUE *sktmp = (struct stack_st_ASN1_VALUE *)*val;-
564 ASN1_VALUE *vtmp;-
565 while (sk_ASN1_VALUE_num(sktmp) > 0
sk_ASN1_VALUE_num(sktmp) > 0Description
TRUEnever evaluated
FALSEevaluated 12636 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-12636
566 vtmp = sk_ASN1_VALUE_pop(sktmp);-
567 ASN1_item_ex_free(&vtmp, (tt->item));-
568 }
never executed: end of block
0
569 }
executed 12636 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
12636
570-
571 if (!*val
!*valDescription
TRUEnever evaluated
FALSEevaluated 414361 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-414361
572 ERR_put_error(13,(131),((1|64)),__FILE__,572);-
573 goto
never executed: goto err;
err;
never executed: goto err;
0
574 }-
575-
576-
577 while (len > 0
len > 0Description
TRUEevaluated 840095 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 270318 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
270318-840095
578 ASN1_VALUE *skfield;-
579 q = p;-
580-
581 if (asn1_check_eoc(&p, len)
asn1_check_eoc(&p, len)Description
TRUEevaluated 72620 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 767475 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
72620-767475
582 if (!sk_eoc
!sk_eocDescription
TRUEevaluated 833 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 71787 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
833-71787
583 ERR_put_error(13,(131),(159),__FILE__,584)-
584 ;-
585 goto
executed 833 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 833 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
833
586 }-
587 len -= p - q;-
588 sk_eoc = 0;-
589 break;
executed 71787 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
71787
590 }-
591 skfield = -
592 ((void *)0)-
593 ;-
594 if (!asn1_item_embed_d2i(&skfield, &p, len,
!asn1_item_emb...0, ctx, depth)Description
TRUEevaluated 71423 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 696052 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
71423-696052
595 (tt->item), -1, 0, 0, ctx,
!asn1_item_emb...0, ctx, depth)Description
TRUEevaluated 71423 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 696052 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
71423-696052
596 depth)
!asn1_item_emb...0, ctx, depth)Description
TRUEevaluated 71423 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 696052 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
71423-696052
597 ERR_put_error(13,(131),(58),__FILE__,596)-
598 ;-
599-
600 ASN1_item_free(skfield, (tt->item));-
601 goto
executed 71423 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 71423 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
71423
602 }-
603 len -= p - q;-
604 if (!sk_ASN1_VALUE_push((struct stack_st_ASN1_VALUE *)*val, skfield)
!sk_ASN1_VALUE...*val, skfield)Description
TRUEnever evaluated
FALSEevaluated 696052 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-696052
605 ERR_put_error(13,(131),((1|64)),__FILE__,603);-
606 ASN1_item_free(skfield, (tt->item));-
607 goto
never executed: goto err;
err;
never executed: goto err;
0
608 }-
609 }
executed 696052 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
696052
610 if (sk_eoc
sk_eocDescription
TRUEevaluated 1116 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 340989 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1116-340989
611 ERR_put_error(13,(131),(137),__FILE__,609);-
612 goto
executed 1116 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1116 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1116
613 }-
614 }
executed 340989 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (flags & (0x1 << 3)
flags & (0x1 << 3)Description
TRUEevaluated 589897 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2838319 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
340989-2838319
615-
616 ret = asn1_item_embed_d2i(val, &p, len,-
617 (tt->item), tt->tag, aclass, opt,-
618 ctx, depth);-
619 if (!ret
!retDescription
TRUEevaluated 43659 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 546238 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
43659-546238
620 ERR_put_error(13,(131),(58),__FILE__,618);-
621 goto
executed 43659 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 43659 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
43659
622 } else if (ret == -1
ret == -1Description
TRUEevaluated 455254 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 90984 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
90984-455254
623 return
executed 455254 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 455254 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
455254
624 }
executed 90984 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
90984
625-
626 ret = asn1_item_embed_d2i(val, &p, len, (tt->item),-
627 -1, 0, opt, ctx, depth);-
628 if (!ret
!retDescription
TRUEevaluated 318226 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2520093 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
318226-2520093
629 ERR_put_error(13,(131),(58),__FILE__,627);-
630 goto
executed 318226 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 318226 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
318226
631 } else if (ret == -1
ret == -1Description
TRUEevaluated 317969 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2202124 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
317969-2202124
632 return
executed 317969 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 317969 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
317969
633 }
executed 2202124 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2202124
634-
635 *in = p;-
636 return
executed 2634097 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 2634097 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2634097
637-
638 err:-
639 return
executed 435257 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 435257 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
435257
640}-
641-
642static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,-
643 const unsigned char **in, long inlen,-
644 const ASN1_ITEM *it,-
645 int tag, int aclass, char opt, ASN1_TLC *ctx)-
646{-
647 int ret = 0, utype;-
648 long plen;-
649 char cst, inf, free_cont = 0;-
650 const unsigned char *p;-
651 BUF_MEM buf = { 0, -
652 ((void *)0)-
653 , 0, 0 };-
654 const unsigned char *cont = -
655 ((void *)0)-
656 ;-
657 long len;-
658 if (!pval
!pvalDescription
TRUEnever evaluated
FALSEevaluated 3019103 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-3019103
659 ERR_put_error(13,(108),(125),__FILE__,653);-
660 return
never executed: return 0;
0;
never executed: return 0;
0
661 }-
662-
663 if (it->itype == 0x5
it->itype == 0x5Description
TRUEevaluated 277002 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2742101 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
277002-2742101
664 utype = tag;-
665 tag = -1;-
666 }
executed 277002 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
277002
667 utype = it->utype;
executed 2742101 times by 2 tests: utype = it->utype;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2742101
668-
669 if (utype == -4
utype == -4Description
TRUEevaluated 225601 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2793502 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
225601-2793502
670-
671 unsigned char oclass;-
672 if (tag >= 0
tag >= 0Description
TRUEnever evaluated
FALSEevaluated 225601 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-225601
673 ERR_put_error(13,(108),(127),__FILE__,667);-
674 return
never executed: return 0;
0;
never executed: return 0;
0
675 }-
676 if (opt
optDescription
TRUEnever evaluated
FALSEevaluated 225601 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-225601
677 ERR_put_error(13,(108),(126),__FILE__,672)-
678 ;-
679 return
never executed: return 0;
0;
never executed: return 0;
0
680 }-
681 p = *in;-
682 ret = asn1_check_tlen(-
683 ((void *)0)-
684 , &utype, &oclass, -
685 ((void *)0)-
686 , -
687 ((void *)0)-
688 ,-
689 &p, inlen, -1, 0, 0, ctx);-
690 if (!ret
!retDescription
TRUEevaluated 424 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 225177 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
424-225177
691 ERR_put_error(13,(108),(58),__FILE__,679);-
692 return
executed 424 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 424 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
424
693 }-
694 if (oclass != 0x00
oclass != 0x00Description
TRUEevaluated 30060 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 195117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
30060-195117
695 utype = -3;
executed 30060 times by 1 test: utype = -3;
Executed by:
  • libcrypto.so.1.1
30060
696 }
executed 225177 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
225177
697 if (tag == -1
tag == -1Description
TRUEevaluated 2600196 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 418483 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
418483-2600196
698 tag = utype;-
699 aclass = 0x00;-
700 }
executed 2600196 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2600196
701 p = *in;-
702-
703 ret = asn1_check_tlen(&plen, -
704 ((void *)0)-
705 , -
706 ((void *)0)-
707 , &inf, &cst,-
708 &p, inlen, tag, aclass, opt, ctx);-
709 if (!ret
!retDescription
TRUEevaluated 303113 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2715566 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
303113-2715566
710 ERR_put_error(13,(108),(58),__FILE__,694);-
711 return
executed 303113 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 303113 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
303113
712 } else if (ret == -1
ret == -1Description
TRUEevaluated 580489 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2135077 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
580489-2135077
713 return
executed 580489 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 580489 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
580489
714 ret = 0;-
715-
716 if ((
(utype == 16)Description
TRUEevaluated 52051 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2083026 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
utype == 16)
(utype == 16)Description
TRUEevaluated 52051 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2083026 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
52051-2083026
717 || (
(utype == 17)Description
TRUEevaluated 3154 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2079872 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
utype == 17)
(utype == 17)Description
TRUEevaluated 3154 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2079872 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| (
(utype == -3)Description
TRUEevaluated 30060 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2049812 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
utype == -3)
(utype == -3)Description
TRUEevaluated 30060 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2049812 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
3154-2079872
718-
719-
720-
721-
722 if (utype == -3
utype == -3Description
TRUEevaluated 30060 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 55205 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
30060-55205
723 if (ctx
ctxDescription
TRUEevaluated 30060 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) (
executed 30060 times by 1 test: (ctx)->valid = 0;
Executed by:
  • libcrypto.so.1.1
ctx)->valid = 0;
executed 30060 times by 1 test: (ctx)->valid = 0;
Executed by:
  • libcrypto.so.1.1
0-30060
724 }
executed 30060 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
30060
725-
726 else if (!cst
!cstDescription
TRUEevaluated 1047 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 54158 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1047-54158
727 ERR_put_error(13,(108),(156),__FILE__,712)-
728 ;-
729 return
executed 1047 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1047 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1047
730 }-
731-
732 cont = *in;-
733-
734 if (inf
infDescription
TRUEevaluated 30513 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53705 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
30513-53705
735 if (!asn1_find_end(&p, plen, inf)
!asn1_find_end(&p, plen, inf)Description
TRUEevaluated 13173 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17340 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
13173-17340
736 goto
executed 13173 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 13173 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
13173
737 len = p - cont;-
738 }
executed 17340 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
17340
739 len = p - cont + plen;-
740 p += plen;-
741 }
executed 53705 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
53705
742 } else if (cst
cstDescription
TRUEevaluated 63711 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1986101 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
63711-1986101
743 if (utype == 5
utype == 5Description
TRUEevaluated 434 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 63277 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| utype == 1
utype == 1Description
TRUEevaluated 673 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 62604 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
434-63277
744 || utype == 6
utype == 6Description
TRUEevaluated 667 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 61937 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| utype == 2
utype == 2Description
TRUEevaluated 842 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 61095 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
667-61937
745 || utype == 10
utype == 10Description
TRUEevaluated 474 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 60621 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
474-60621
746 ERR_put_error(13,(108),(195),__FILE__,730);-
747 return
executed 3090 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 3090 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
3090
748 }-
749-
750-
751 free_cont = 1;-
752-
753-
754-
755-
756-
757-
758 if (!asn1_collect(&buf, &p, plen, inf, -1, 0x00, 0)
!asn1_collect(..., -1, 0x00, 0)Description
TRUEevaluated 3652 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 56969 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3652-56969
759 goto
executed 3652 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 3652 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
3652
760 }-
761 len = buf.length;-
762-
763 if (!BUF_MEM_grow_clean(&buf, len + 1)
!BUF_MEM_grow_...&buf, len + 1)Description
TRUEnever evaluated
FALSEevaluated 56969 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-56969
764 ERR_put_error(13,(108),((1|64)),__FILE__,748);-
765 goto
never executed: goto err;
err;
never executed: goto err;
0
766 }-
767 buf.data[len] = 0;-
768 cont = (const unsigned char *)buf.data;-
769 }
executed 56969 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
56969
770 cont = p;-
771 len = plen;-
772 p += plen;-
773 }
executed 1986101 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1986101
774-
775-
776-
777 if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it)
!asn1_ex_c2i(p...free_cont, it)Description
TRUEevaluated 16527 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2097588 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
16527-2097588
778 goto
executed 16527 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 16527 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
16527
779-
780 *in = p;-
781 ret = 1;-
782 err:
code before this statement executed 2097588 times by 2 tests: err:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2097588
783 if (free_cont
free_contDescription
TRUEevaluated 4097 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2126843 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
4097-2126843
784 CRYPTO_free(buf.data, __FILE__, 768);
executed 4097 times by 1 test: CRYPTO_free(buf.data, __FILE__, 768);
Executed by:
  • libcrypto.so.1.1
4097
785 return
executed 2130940 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 2130940 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2130940
786}-
787-
788-
789-
790static int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,-
791 int utype, char *free_cont, const ASN1_ITEM *it)-
792{-
793 ASN1_VALUE **opval = -
794 ((void *)0)-
795 ;-
796 ASN1_STRING *stmp;-
797 ASN1_TYPE *typ = -
798 ((void *)0)-
799 ;-
800 int ret = 0;-
801 const ASN1_PRIMITIVE_FUNCS *pf;-
802 ASN1_INTEGER **tint;-
803 pf = it->funcs;-
804-
805 if (pf
pfDescription
TRUEevaluated 163259 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1950856 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& pf->prim_c2i
pf->prim_c2iDescription
TRUEevaluated 163259 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
)
0-1950856
806 return
executed 163259 times by 2 tests: return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
pf->prim_c2i(pval, cont, len, utype, free_cont, it);
executed 163259 times by 2 tests: return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
163259
807-
808 if (it->utype == -4
it->utype == -4Description
TRUEevaluated 217001 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1733855 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
217001-1733855
809 if (!*pval
!*pvalDescription
TRUEevaluated 213398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3603 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3603-213398
810 typ = ASN1_TYPE_new();-
811 if (typ ==
typ == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 213398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-213398
812 ((void *)0)
typ == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 213398 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-213398
813 )-
814 goto
never executed: goto err;
err;
never executed: goto err;
0
815 *pval = (ASN1_VALUE *)typ;-
816 }
executed 213398 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
213398
817 typ = (ASN1_TYPE *)*pval;
executed 3603 times by 1 test: typ = (ASN1_TYPE *)*pval;
Executed by:
  • libcrypto.so.1.1
3603
818-
819 if (utype != typ->type
utype != typ->typeDescription
TRUEevaluated 217001 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-217001
820 ASN1_TYPE_set(typ, utype,
executed 217001 times by 1 test: ASN1_TYPE_set(typ, utype, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
217001
821 ((void *)0)
executed 217001 times by 1 test: ASN1_TYPE_set(typ, utype, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
217001
822 );
executed 217001 times by 1 test: ASN1_TYPE_set(typ, utype, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
217001
823 opval = pval;-
824 pval = &typ->value.asn1_value;-
825 }
executed 217001 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
217001
826 switch (utype) {-
827 case
executed 666098 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
6:
executed 666098 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
666098
828 if (!c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len)
!c2i_ASN1_OBJE...l, &cont, len)Description
TRUEevaluated 4369 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 661729 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4369-661729
829 goto
executed 4369 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 4369 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
4369
830 break;
executed 661729 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
661729
831-
832 case
executed 46684 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
5:
executed 46684 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
46684
833 if (len
lenDescription
TRUEevaluated 322 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46362 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
322-46362
834 ERR_put_error(13,(204),(144),__FILE__,810);-
835 goto
executed 322 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 322 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
322
836 }-
837 *pval = (ASN1_VALUE *)1;-
838 break;
executed 46362 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
46362
839-
840 case
executed 27684 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 27684 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
27684
841 if (len != 1
len != 1Description
TRUEevaluated 536 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 27148 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
536-27148
842 ERR_put_error(13,(204),(106),__FILE__,818);-
843 goto
executed 536 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 536 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
536
844 } else {-
845 ASN1_BOOLEAN *tbool;-
846 tbool = (ASN1_BOOLEAN *)pval;-
847 *tbool = *cont;-
848 }
executed 27148 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
27148
849 break;
executed 27148 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
27148
850-
851 case
executed 147882 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
3:
executed 147882 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
147882
852 if (!c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len)
!c2i_ASN1_BIT_...l, &cont, len)Description
TRUEevaluated 1870 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 146012 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1870-146012
853 goto
executed 1870 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1870 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1870
854 break;
executed 146012 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
146012
855-
856 case
executed 255497 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
2:
executed 255497 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
255497
857 case
executed 17429 times by 1 test: case 10:
Executed by:
  • libcrypto.so.1.1
10:
executed 17429 times by 1 test: case 10:
Executed by:
  • libcrypto.so.1.1
17429
858 tint = (ASN1_INTEGER **)pval;-
859 if (!c2i_ASN1_INTEGER(tint, &cont, len)
!c2i_ASN1_INTE...t, &cont, len)Description
TRUEevaluated 7184 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 265742 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7184-265742
860 goto
executed 7184 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 7184 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
7184
861-
862 (*tint)->type = utype | ((*tint)->type & 0x100);-
863 break;
executed 265742 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
265742
864-
865 case
executed 355812 times by 2 tests: case 4:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4:
executed 355812 times by 2 tests: case 4:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
355812
866 case
executed 5914 times by 1 test: case 18:
Executed by:
  • libcrypto.so.1.1
18:
executed 5914 times by 1 test: case 18:
Executed by:
  • libcrypto.so.1.1
5914
867 case
executed 28425 times by 1 test: case 19:
Executed by:
  • libcrypto.so.1.1
19:
executed 28425 times by 1 test: case 19:
Executed by:
  • libcrypto.so.1.1
28425
868 case
executed 17382 times by 1 test: case 20:
Executed by:
  • libcrypto.so.1.1
20:
executed 17382 times by 1 test: case 20:
Executed by:
  • libcrypto.so.1.1
17382
869 case
executed 423 times by 1 test: case 21:
Executed by:
  • libcrypto.so.1.1
21:
executed 423 times by 1 test: case 21:
Executed by:
  • libcrypto.so.1.1
423
870 case
executed 50244 times by 1 test: case 22:
Executed by:
  • libcrypto.so.1.1
22:
executed 50244 times by 1 test: case 22:
Executed by:
  • libcrypto.so.1.1
50244
871 case
executed 79365 times by 1 test: case 23:
Executed by:
  • libcrypto.so.1.1
23:
executed 79365 times by 1 test: case 23:
Executed by:
  • libcrypto.so.1.1
79365
872 case
executed 55881 times by 1 test: case 24:
Executed by:
  • libcrypto.so.1.1
24:
executed 55881 times by 1 test: case 24:
Executed by:
  • libcrypto.so.1.1
55881
873 case
executed 1086 times by 1 test: case 25:
Executed by:
  • libcrypto.so.1.1
25:
executed 1086 times by 1 test: case 25:
Executed by:
  • libcrypto.so.1.1
1086
874 case
executed 1782 times by 1 test: case 26:
Executed by:
  • libcrypto.so.1.1
26:
executed 1782 times by 1 test: case 26:
Executed by:
  • libcrypto.so.1.1
1782
875 case
executed 1807 times by 1 test: case 27:
Executed by:
  • libcrypto.so.1.1
27:
executed 1807 times by 1 test: case 27:
Executed by:
  • libcrypto.so.1.1
1807
876 case
executed 14720 times by 1 test: case 28:
Executed by:
  • libcrypto.so.1.1
28:
executed 14720 times by 1 test: case 28:
Executed by:
  • libcrypto.so.1.1
14720
877 case
executed 13083 times by 1 test: case 30:
Executed by:
  • libcrypto.so.1.1
30:
executed 13083 times by 1 test: case 30:
Executed by:
  • libcrypto.so.1.1
13083
878 case
executed 64473 times by 1 test: case 12:
Executed by:
  • libcrypto.so.1.1
12:
executed 64473 times by 1 test: case 12:
Executed by:
  • libcrypto.so.1.1
64473
879 case
executed 26809 times by 1 test: case -3:
Executed by:
  • libcrypto.so.1.1
-3:
executed 26809 times by 1 test: case -3:
Executed by:
  • libcrypto.so.1.1
26809
880 case
executed 2902 times by 1 test: case 17:
Executed by:
  • libcrypto.so.1.1
17:
executed 2902 times by 1 test: case 17:
Executed by:
  • libcrypto.so.1.1
2902
881 case
executed 41334 times by 1 test: case 16:
Executed by:
  • libcrypto.so.1.1
16:
executed 41334 times by 1 test: case 16:
Executed by:
  • libcrypto.so.1.1
41334
882 default
executed 28140 times by 1 test: default:
Executed by:
  • libcrypto.so.1.1
:
executed 28140 times by 1 test: default:
Executed by:
  • libcrypto.so.1.1
28140
883 if (utype == 30
utype == 30Description
TRUEevaluated 13083 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 776499 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& (
(len & 1)Description
TRUEevaluated 726 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12357 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
len & 1)
(len & 1)Description
TRUEevaluated 726 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12357 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
726-776499
884 ERR_put_error(13,(204),(214),__FILE__,860);-
885 goto
executed 726 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 726 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
726
886 }-
887 if (utype == 28
utype == 28Description
TRUEevaluated 14720 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 774136 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& (
(len & 3)Description
TRUEevaluated 471 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14249 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
len & 3)
(len & 3)Description
TRUEevaluated 471 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14249 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
471-774136
888 ERR_put_error(13,(204),(215),__FILE__,865)-
889 ;-
890 goto
executed 471 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 471 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
471
891 }-
892-
893 if (!*pval
!*pvalDescription
TRUEevaluated 298851 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 489534 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
298851-489534
894 stmp = ASN1_STRING_type_new(utype);-
895 if (stmp ==
stmp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 298851 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-298851
896 ((void *)0)
stmp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 298851 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-298851
897 ) {-
898 ERR_put_error(13,(204),((1|64)),__FILE__,872);-
899 goto
never executed: goto err;
err;
never executed: goto err;
0
900 }-
901 *pval = (ASN1_VALUE *)stmp;-
902 }
executed 298851 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
298851
903 stmp = (ASN1_STRING *)*pval;-
904 stmp->type = utype;-
905 }
executed 489534 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
489534
906-
907 if (*
*free_contDescription
TRUEevaluated 56524 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 731861 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
free_cont
*free_contDescription
TRUEevaluated 56524 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 731861 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
56524-731861
908 CRYPTO_free(stmp->data, __FILE__, 882);-
909 stmp->data = (unsigned char *)cont;-
910 stmp->length = len;-
911 *free_cont = 0;-
912 }
executed 56524 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
56524
913 if (!ASN1_STRING_set(stmp, cont, len)
!ASN1_STRING_s...mp, cont, len)Description
TRUEnever evaluated
FALSEevaluated 731861 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-731861
914 ERR_put_error(13,(204),((1|64)),__FILE__,888);-
915 ASN1_STRING_free(stmp);-
916 *pval = -
917 ((void *)0)-
918 ;-
919 goto
never executed: goto err;
err;
never executed: goto err;
0
920 }-
921 }
executed 731861 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
731861
922 break;
executed 788385 times by 2 tests: break;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
788385
923 }-
924-
925 if (typ
typDescription
TRUEevaluated 216405 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1718973 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& (
(utype == 5)Description
TRUEevaluated 45202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 171203 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
utype == 5)
(utype == 5)Description
TRUEevaluated 45202 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 171203 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
45202-1718973
926 typ->value.ptr =
executed 45202 times by 1 test: typ->value.ptr = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
45202
927 ((void *)0)
executed 45202 times by 1 test: typ->value.ptr = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
45202
928 ;
executed 45202 times by 1 test: typ->value.ptr = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
45202
929-
930 ret = 1;-
931 err:
code before this statement executed 1935378 times by 2 tests: err:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1935378
932 if (!ret
!retDescription
TRUEevaluated 15478 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1935378 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
15478-1935378
933 ASN1_TYPE_free(typ);-
934 if (opval
opvalDescription
TRUEevaluated 596 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14882 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
596-14882
935 *
executed 596 times by 1 test: *opval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
opval =
executed 596 times by 1 test: *opval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
596
936 ((void *)0)
executed 596 times by 1 test: *opval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
596
937 ;
executed 596 times by 1 test: *opval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
596
938 }
executed 15478 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
15478
939 return
executed 1950856 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 1950856 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1950856
940}-
941static int asn1_find_end(const unsigned char **in, long len, char inf)-
942{-
943 uint32_t expected_eoc;-
944 long plen;-
945 const unsigned char *p = *in, *q;-
946-
947 if (inf == 0
inf == 0Description
TRUEnever evaluated
FALSEevaluated 30513 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-30513
948 *in += len;-
949 return
never executed: return 1;
1;
never executed: return 1;
0
950 }-
951 expected_eoc = 1;-
952-
953-
954-
955-
956-
957-
958 while (len > 0
len > 0Description
TRUEevaluated 7407911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4610 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4610-7407911
959 if (asn1_check_eoc(&p, len)
asn1_check_eoc(&p, len)Description
TRUEevaluated 1956678 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5451233 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1956678-5451233
960 expected_eoc--;-
961 if (expected_eoc == 0
expected_eoc == 0Description
TRUEevaluated 17340 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1939338 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
17340-1939338
962 break;
executed 17340 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
17340
963 len -= 2;-
964 continue;
executed 1939338 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
1939338
965 }-
966 q = p;-
967-
968 if (!asn1_check_tlen(&plen,
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8563-5442670
969 ((void *)0)
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8563-5442670
970 ,
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8563-5442670
971 ((void *)0)
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8563-5442670
972 , &inf,
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8563-5442670
973 ((void *)0)
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8563-5442670
974 , &p, len,
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8563-5442670
975 -1, 0, 0,
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8563-5442670
976 ((void *)0)
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8563-5442670
977 )
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 8563 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5442670 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8563-5442670
978 ERR_put_error(13,(190),(58),__FILE__,946);-
979 return
executed 8563 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 8563 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
8563
980 }-
981 if (inf
infDescription
TRUEevaluated 1964365 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3478305 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1964365-3478305
982 if (expected_eoc ==
expected_eoc == (4294967295U)Description
TRUEnever evaluated
FALSEevaluated 1964365 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1964365
983 (4294967295U)
expected_eoc == (4294967295U)Description
TRUEnever evaluated
FALSEevaluated 1964365 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1964365
984 ) {-
985 ERR_put_error(13,(190),(58),__FILE__,951);-
986 return
never executed: return 0;
0;
never executed: return 0;
0
987 }-
988 expected_eoc++;-
989 }
executed 1964365 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
1964365
990 p += plen;-
991 }
executed 3478305 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3478305
992 len -= p - q;-
993 }
executed 5442670 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5442670
994 if (expected_eoc
expected_eocDescription
TRUEevaluated 4610 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17340 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4610-17340
995 ERR_put_error(13,(190),(137),__FILE__,961);-
996 return
executed 4610 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 4610 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
4610
997 }-
998 *in = p;-
999 return
executed 17340 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 17340 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
17340
1000}-
1001static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len,-
1002 char inf, int tag, int aclass, int depth)-
1003{-
1004 const unsigned char *p, *q;-
1005 long plen;-
1006 char cst, ininf;-
1007 p = *in;-
1008 inf &= 1;-
1009-
1010-
1011-
1012-
1013 if (!buf
!bufDescription
TRUEnever evaluated
FALSEevaluated 83235 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !inf
!infDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-83235
1014 *in += len;-
1015 return
never executed: return 1;
1;
never executed: return 1;
0
1016 }-
1017 while (len > 0
len > 0Description
TRUEevaluated 94320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 57614 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
57614-94320
1018 q = p;-
1019-
1020 if (asn1_check_eoc(&p, len)
asn1_check_eoc(&p, len)Description
TRUEevaluated 18830 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 75490 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
18830-75490
1021-
1022-
1023-
1024 if (!inf
!infDescription
TRUEevaluated 821 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18009 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
821-18009
1025 ERR_put_error(13,(106),(159),__FILE__,1008);-
1026 return
executed 821 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 821 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
821
1027 }-
1028 inf = 0;-
1029 break;
executed 18009 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
18009
1030 }-
1031-
1032 if (!asn1_check_tlen(&plen,
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 1309 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1309-74181
1033 ((void *)0)
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 1309 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1309-74181
1034 ,
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 1309 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1309-74181
1035 ((void *)0)
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 1309 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1309-74181
1036 , &ininf, &cst, &p,
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 1309 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1309-74181
1037 len, tag, aclass, 0,
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 1309 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1309-74181
1038 ((void *)0)
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 1309 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1309-74181
1039 )
!asn1_check_tl... ((void *)0) )Description
TRUEevaluated 1309 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1309-74181
1040 ERR_put_error(13,(106),(58),__FILE__,1017);-
1041 return
executed 1309 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1309 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
1309
1042 }-
1043-
1044-
1045 if (cst
cstDescription
TRUEevaluated 23156 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 51025 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
23156-51025
1046 if (depth >= 5
depth >= 5Description
TRUEevaluated 542 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 22614 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
542-22614
1047 ERR_put_error(13,(106),(197),__FILE__,1024);-
1048 return
executed 542 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 542 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
542
1049 }-
1050 if (!asn1_collect(buf, &p, plen, ininf, tag, aclass, depth + 1)
!asn1_collect(...ss, depth + 1)Description
TRUEevaluated 4940 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 17674 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4940-17674
1051 return
executed 4940 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 4940 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
4940
1052 }
executed 17674 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (plen
plenDescription
TRUEevaluated 43604 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7421 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !collect_data(buf, &p, plen)
!collect_data(buf, &p, plen)Description
TRUEnever evaluated
FALSEevaluated 43604 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-43604
1053 return
never executed: return 0;
0;
never executed: return 0;
0
1054 len -= p - q;-
1055 }
executed 68699 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
68699
1056 if (inf
infDescription
TRUEevaluated 980 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
980-74643
1057 ERR_put_error(13,(106),(137),__FILE__,1034);-
1058 return
executed 980 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 980 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
980
1059 }-
1060 *in = p;-
1061 return
executed 74643 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 74643 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
74643
1062}-
1063-
1064static int collect_data(BUF_MEM *buf, const unsigned char **p, long plen)-
1065{-
1066 int len;-
1067 if (buf
bufDescription
TRUEevaluated 43604 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-43604
1068 len = buf->length;-
1069 if (!BUF_MEM_grow_clean(buf, len + plen)
!BUF_MEM_grow_...f, len + plen)Description
TRUEnever evaluated
FALSEevaluated 43604 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-43604
1070 ERR_put_error(13,(140),((1|64)),__FILE__,1047);-
1071 return
never executed: return 0;
0;
never executed: return 0;
0
1072 }-
1073 memcpy(buf->data + len, *p, plen);-
1074 }
executed 43604 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
43604
1075 *p += plen;-
1076 return
executed 43604 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 43604 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
43604
1077}-
1078-
1079-
1080-
1081static int asn1_check_eoc(const unsigned char **in, long len)-
1082{-
1083 const unsigned char *p;-
1084 if (len < 2
len < 2Description
TRUEevaluated 7707 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11998177 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
7707-11998177
1085 return
executed 7707 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 7707 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
7707
1086 p = *in;-
1087 if (!p[0]
!p[0]Description
TRUEevaluated 2625094 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9373083 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& !p[1]
!p[1]Description
TRUEevaluated 2557247 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 67847 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
67847-9373083
1088 *in += 2;-
1089 return
executed 2557247 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2557247 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2557247
1090 }-
1091 return
executed 9440930 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0;
executed 9440930 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
9440930
1092}-
1093static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass,-
1094 char *inf, char *cst,-
1095 const unsigned char **in, long len,-
1096 int exptag, int expclass, char opt, ASN1_TLC *ctx)-
1097{-
1098 int i;-
1099 int ptag, pclass;-
1100 long plen;-
1101 const unsigned char *p, *q;-
1102 p = *in;-
1103 q = p;-
1104-
1105 if (ctx
ctxDescription
TRUEevaluated 6014209 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 5526723 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& ctx->valid
ctx->validDescription
TRUEevaluated 1454793 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4559416 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
1454793-6014209
1106 i = ctx->ret;-
1107 plen = ctx->plen;-
1108 pclass = ctx->pclass;-
1109 ptag = ctx->ptag;-
1110 p += ctx->hdrlen;-
1111 }
executed 1454793 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
1454793
1112 i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);-
1113 if (ctx
ctxDescription
TRUEevaluated 4559416 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 5526723 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4559416-5526723
1114 ctx->ret = i;-
1115 ctx->plen = plen;-
1116 ctx->pclass = pclass;-
1117 ctx->ptag = ptag;-
1118 ctx->hdrlen = p - q;-
1119 ctx->valid = 1;-
1120-
1121-
1122-
1123-
1124 if (!(i & 0x81)
!(i & 0x81)Description
TRUEevaluated 3314160 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1245256 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& ((
((plen + ctx->hdrlen) > len)Description
TRUEnever evaluated
FALSEevaluated 3314160 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
plen + ctx->hdrlen) > len)
((plen + ctx->hdrlen) > len)Description
TRUEnever evaluated
FALSEevaluated 3314160 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-3314160
1125 ERR_put_error(13,(104),(155),__FILE__,1110);-
1126 if (ctx
ctxDescription
TRUEnever evaluated
FALSEnever evaluated
) (
never executed: (ctx)->valid = 0;
ctx)->valid = 0;
never executed: (ctx)->valid = 0;
0
1127 return
never executed: return 0;
0;
never executed: return 0;
0
1128 }-
1129 }
executed 4559416 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4559416
1130 }
executed 10086139 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
10086139
1131-
1132 if (i & 0x80
i & 0x80Description
TRUEevaluated 37472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11503460 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
37472-11503460
1133 ERR_put_error(13,(104),(102),__FILE__,1118);-
1134 if (ctx
ctxDescription
TRUEevaluated 27600 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9872 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) (
executed 27600 times by 1 test: (ctx)->valid = 0;
Executed by:
  • libcrypto.so.1.1
ctx)->valid = 0;
executed 27600 times by 1 test: (ctx)->valid = 0;
Executed by:
  • libcrypto.so.1.1
9872-27600
1135 return
executed 37472 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 37472 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
37472
1136 }-
1137 if (exptag >= 0
exptag >= 0Description
TRUEevaluated 5394561 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 6108899 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5394561-6108899
1138 if ((
(exptag != ptag)Description
TRUEevaluated 1398884 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3995677 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
exptag != ptag)
(exptag != ptag)Description
TRUEevaluated 1398884 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3995677 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| (
(expclass != pclass)Description
TRUEevaluated 16550 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3979127 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
expclass != pclass)
(expclass != pclass)Description
TRUEevaluated 16550 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3979127 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
16550-3995677
1139-
1140-
1141-
1142 if (opt
optDescription
TRUEevaluated 949521 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 465913 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
465913-949521
1143 return
executed 949521 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 949521 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
949521
1144 if (ctx
ctxDescription
TRUEevaluated 465913 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) (
executed 465913 times by 1 test: (ctx)->valid = 0;
Executed by:
  • libcrypto.so.1.1
ctx)->valid = 0;
executed 465913 times by 1 test: (ctx)->valid = 0;
Executed by:
  • libcrypto.so.1.1
0-465913
1145 ERR_put_error(13,(104),(168),__FILE__,1130);-
1146 return
executed 465913 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 465913 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
465913
1147 }-
1148-
1149-
1150-
1151-
1152 if (ctx
ctxDescription
TRUEevaluated 3979127 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
) (
executed 3979127 times by 2 tests: (ctx)->valid = 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ctx)->valid = 0;
executed 3979127 times by 2 tests: (ctx)->valid = 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-3979127
1153 }
executed 3979127 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3979127
1154-
1155 if (i & 1
i & 1Description
TRUEevaluated 3064256 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7023770 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
3064256-7023770
1156 plen = len - (p - q);
executed 3064256 times by 1 test: plen = len - (p - q);
Executed by:
  • libcrypto.so.1.1
3064256
1157-
1158 if (inf
infDescription
TRUEevaluated 9526038 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 561988 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
561988-9526038
1159 *
executed 9526038 times by 2 tests: *inf = i & 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
inf = i & 1;
executed 9526038 times by 2 tests: *inf = i & 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
9526038
1160-
1161 if (cst
cstDescription
TRUEevaluated 3669007 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 6419019 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3669007-6419019
1162 *
executed 3669007 times by 2 tests: *cst = i & 0x20;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
cst = i & 0x20;
executed 3669007 times by 2 tests: *cst = i & 0x20;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3669007
1163-
1164 if (olen
olenDescription
TRUEevaluated 9526038 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 561988 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
561988-9526038
1165 *
executed 9526038 times by 2 tests: *olen = plen;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
olen = plen;
executed 9526038 times by 2 tests: *olen = plen;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
9526038
1166-
1167 if (oclass
oclassDescription
TRUEevaluated 561988 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9526038 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
561988-9526038
1168 *
executed 561988 times by 1 test: *oclass = pclass;
Executed by:
  • libcrypto.so.1.1
oclass = pclass;
executed 561988 times by 1 test: *oclass = pclass;
Executed by:
  • libcrypto.so.1.1
561988
1169-
1170 if (otag
otagDescription
TRUEevaluated 561988 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9526038 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
561988-9526038
1171 *
executed 561988 times by 1 test: *otag = ptag;
Executed by:
  • libcrypto.so.1.1
otag = ptag;
executed 561988 times by 1 test: *otag = ptag;
Executed by:
  • libcrypto.so.1.1
561988
1172-
1173 *in = p;-
1174 return
executed 10088026 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 10088026 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
10088026
1175}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2