OpenCoverage

tasn_new.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/tasn_new.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2static int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it,-
3 int embed);-
4static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it,-
5 int embed);-
6static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);-
7static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);-
8static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);-
9static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);-
10-
11ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it)-
12{-
13 ASN1_VALUE *ret = -
14 ((void *)0)-
15 ;-
16 if (ASN1_item_ex_new(&ret, it) > 0
ASN1_item_ex_new(&ret, it) > 0Description
TRUEevaluated 368142 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-368142
17 return
executed 368142 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 368142 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
368142
18 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
19 ((void *)0)
never executed: return ((void *)0) ;
0
20 ;
never executed: return ((void *)0) ;
0
21}-
22-
23-
24-
25int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it)-
26{-
27 return
executed 1520094 times by 2 tests: return asn1_item_embed_new(pval, it, 0);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
asn1_item_embed_new(pval, it, 0);
executed 1520094 times by 2 tests: return asn1_item_embed_new(pval, it, 0);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1520094
28}-
29-
30int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed)-
31{-
32 const ASN1_TEMPLATE *tt = -
33 ((void *)0)-
34 ;-
35 const ASN1_EXTERN_FUNCS *ef;-
36 const ASN1_AUX *aux = it->funcs;-
37 ASN1_aux_cb *asn1_cb;-
38 ASN1_VALUE **pseqval;-
39 int i;-
40 if (aux
auxDescription
TRUEevaluated 637556 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3886273 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& aux->asn1_cb
aux->asn1_cbDescription
TRUEevaluated 440704 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 196852 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
196852-3886273
41 asn1_cb = aux->asn1_cb;
executed 440704 times by 2 tests: asn1_cb = aux->asn1_cb;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
440704
42 else-
43 asn1_cb = 0;
executed 4083125 times by 2 tests: asn1_cb = 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4083125
44-
45-
46-
47-
48-
49 switch (it->itype) {-
50-
51 case
executed 151109 times by 1 test: case 0x4:
Executed by:
  • libcrypto.so.1.1
0x4:
executed 151109 times by 1 test: case 0x4:
Executed by:
  • libcrypto.so.1.1
151109
52 ef = it->funcs;-
53 if (ef
efDescription
TRUEevaluated 151109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& ef->asn1_ex_new
ef->asn1_ex_newDescription
TRUEevaluated 151109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-151109
54 if (!ef->asn1_ex_new(pval, it)
!ef->asn1_ex_new(pval, it)Description
TRUEnever evaluated
FALSEevaluated 151109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-151109
55 goto
never executed: goto memerr;
memerr;
never executed: goto memerr;
0
56 }
executed 151109 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
151109
57 break;
executed 151109 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
151109
58-
59 case
executed 2016582 times by 2 tests: case 0x0:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x0:
executed 2016582 times by 2 tests: case 0x0:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2016582
60 if (it->templates
it->templatesDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2016581 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
1-2016581
61 if (!asn1_template_new(pval, it->templates)
!asn1_template...it->templates)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
62 goto
never executed: goto memerr;
memerr;
never executed: goto memerr;
0
63 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (!asn1_primitive_new(pval, it, embed)
!asn1_primitiv...al, it, embed)Description
TRUEnever evaluated
FALSEevaluated 2016581 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-2016581
64 goto
never executed: goto memerr;
memerr;
never executed: goto memerr;
0
65 break;
executed 2016582 times by 2 tests: break;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2016582
66-
67 case
executed 427413 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
0x5:
executed 427413 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
427413
68 if (!asn1_primitive_new(pval, it, embed)
!asn1_primitiv...al, it, embed)Description
TRUEnever evaluated
FALSEevaluated 427413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-427413
69 goto
never executed: goto memerr;
memerr;
never executed: goto memerr;
0
70 break;
executed 427413 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
427413
71-
72 case
executed 221755 times by 1 test: case 0x2:
Executed by:
  • libcrypto.so.1.1
0x2:
executed 221755 times by 1 test: case 0x2:
Executed by:
  • libcrypto.so.1.1
221755
73 if (asn1_cb
asn1_cbDescription
TRUEevaluated 32587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 189168 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
32587-189168
74 i = asn1_cb(0, pval, it, -
75 ((void *)0)-
76 );-
77 if (!i
!iDescription
TRUEnever evaluated
FALSEevaluated 32587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-32587
78 goto
never executed: goto auxerr;
auxerr;
never executed: goto auxerr;
0
79 if (i == 2
i == 2Description
TRUEnever evaluated
FALSEevaluated 32587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-32587
80-
81-
82-
83 return
never executed: return 1;
1;
never executed: return 1;
0
84 }-
85 }
executed 32587 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
32587
86 if (embed
embedDescription
TRUEevaluated 5986 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 215769 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5986-215769
87 memset(*pval, 0, it->size);-
88 }
executed 5986 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
5986
89 *pval = CRYPTO_zalloc(it->size, __FILE__, 97);-
90 if (*
*pval == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 215769 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pval ==
*pval == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 215769 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-215769
91 ((void *)0)
*pval == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 215769 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-215769
92 )-
93 goto
never executed: goto memerr;
memerr;
never executed: goto memerr;
0
94 }
executed 215769 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
215769
95 asn1_set_choice_selector(pval, -1, it);-
96 if (asn1_cb
asn1_cbDescription
TRUEevaluated 32587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 189168 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !asn1_cb(1, pval, it,
!asn1_cb(1, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 32587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-189168
97 ((void *)0)
!asn1_cb(1, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 32587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-32587
98 )
!asn1_cb(1, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 32587 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-32587
99 goto
never executed: goto auxerr2;
auxerr2;
never executed: goto auxerr2;
0
100 break;
executed 221755 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
221755
101-
102 case
executed 50927 times by 1 test: case 0x6:
Executed by:
  • libcrypto.so.1.1
0x6:
executed 50927 times by 1 test: case 0x6:
Executed by:
  • libcrypto.so.1.1
50927
103 case
executed 1656043 times by 2 tests: case 0x1:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x1:
executed 1656043 times by 2 tests: case 0x1:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1656043
104 if (asn1_cb
asn1_cbDescription
TRUEevaluated 312615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1394355 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
312615-1394355
105 i = asn1_cb(0, pval, it, -
106 ((void *)0)-
107 );-
108 if (!i
!iDescription
TRUEnever evaluated
FALSEevaluated 312615 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-312615
109 goto
never executed: goto auxerr;
auxerr;
never executed: goto auxerr;
0
110 if (i == 2
i == 2Description
TRUEevaluated 46982 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 265633 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
46982-265633
111-
112-
113-
114 return
executed 46982 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 46982 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
46982
115 }-
116 }
executed 265633 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
265633
117 if (embed
embedDescription
TRUEevaluated 312117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1347871 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
312117-1347871
118 memset(*pval, 0, it->size);-
119 }
executed 312117 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
312117
120 *pval = CRYPTO_zalloc(it->size, __FILE__, 122);-
121 if (*
*pval == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1347871 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
pval ==
*pval == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1347871 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-1347871
122 ((void *)0)
*pval == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1347871 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-1347871
123 )-
124 goto
never executed: goto memerr;
memerr;
never executed: goto memerr;
0
125 }
executed 1347871 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1347871
126-
127 if (asn1_do_lock(pval, 0, it) < 0
asn1_do_lock(pval, 0, it) < 0Description
TRUEnever evaluated
FALSEevaluated 1659988 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-1659988
128 if (!embed
!embedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
129 CRYPTO_free(*pval, __FILE__, 129);-
130 *pval = -
131 ((void *)0)-
132 ;-
133 }
never executed: end of block
0
134 goto
never executed: goto memerr;
memerr;
never executed: goto memerr;
0
135 }-
136 asn1_enc_init(pval, it);-
137 for (i = 0, tt = it->templates; i < it->tcount
i < it->tcountDescription
TRUEevaluated 4864787 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 1659988 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; tt++, i++) {
1659988-4864787
138 pseqval = asn1_get_field_ptr(pval, tt);-
139 if (!asn1_template_new(pseqval, tt)
!asn1_template...w(pseqval, tt)Description
TRUEnever evaluated
FALSEevaluated 4864787 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-4864787
140 goto
never executed: goto memerr2;
memerr2;
never executed: goto memerr2;
0
141 }
executed 4864787 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4864787
142 if (asn1_cb
asn1_cbDescription
TRUEevaluated 265633 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1394355 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& !asn1_cb(1, pval, it,
!asn1_cb(1, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265633 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1394355
143 ((void *)0)
!asn1_cb(1, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265633 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-265633
144 )
!asn1_cb(1, pv... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 265633 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-265633
145 goto
never executed: goto auxerr2;
auxerr2;
never executed: goto auxerr2;
0
146 break;
executed 1659988 times by 2 tests: break;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1659988
147 }-
148-
149-
150-
151 return
executed 4476847 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 4476847 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4476847
152-
153 memerr2:-
154 asn1_item_embed_free(pval, it, embed);-
155 memerr:
code before this statement never executed: memerr:
0
156 ERR_put_error(13,(121),((1|64)),__FILE__,152);-
157-
158-
159-
160 return
never executed: return 0;
0;
never executed: return 0;
0
161-
162 auxerr2:-
163 asn1_item_embed_free(pval, it, embed);-
164 auxerr:
code before this statement never executed: auxerr:
0
165 ERR_put_error(13,(121),(100),__FILE__,161);-
166-
167-
168-
169 return
never executed: return 0;
0;
never executed: return 0;
0
170-
171}-
172-
173static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)-
174{-
175 const ASN1_EXTERN_FUNCS *ef;-
176-
177 switch (it->itype) {-
178-
179 case
never executed: case 0x4:
0x4:
never executed: case 0x4:
0
180 ef = it->funcs;-
181 if (ef
efDescription
TRUEnever evaluated
FALSEnever evaluated
&& ef->asn1_ex_clear
ef->asn1_ex_clearDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
182 ef->asn1_ex_clear(pval, it);
never executed: ef->asn1_ex_clear(pval, it);
0
183 else-
184 *
never executed: *pval = ((void *)0) ;
pval =
never executed: *pval = ((void *)0) ;
0
185 ((void *)0)
never executed: *pval = ((void *)0) ;
0
186 ;
never executed: *pval = ((void *)0) ;
0
187 break;
never executed: break;
0
188-
189 case
executed 1252222 times by 1 test: case 0x0:
Executed by:
  • libcrypto.so.1.1
0x0:
executed 1252222 times by 1 test: case 0x0:
Executed by:
  • libcrypto.so.1.1
1252222
190 if (it->templates
it->templatesDescription
TRUEnever evaluated
FALSEevaluated 1252222 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1252222
191 asn1_template_clear(pval, it->templates);
never executed: asn1_template_clear(pval, it->templates);
0
192 else-
193 asn1_primitive_clear(pval, it);
executed 1252222 times by 1 test: asn1_primitive_clear(pval, it);
Executed by:
  • libcrypto.so.1.1
1252222
194 break;
executed 1252222 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1252222
195-
196 case
executed 67411 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
0x5:
executed 67411 times by 1 test: case 0x5:
Executed by:
  • libcrypto.so.1.1
67411
197 asn1_primitive_clear(pval, it);-
198 break;
executed 67411 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
67411
199-
200 case
executed 75605 times by 1 test: case 0x2:
Executed by:
  • libcrypto.so.1.1
0x2:
executed 75605 times by 1 test: case 0x2:
Executed by:
  • libcrypto.so.1.1
75605
201 case
executed 52755 times by 1 test: case 0x1:
Executed by:
  • libcrypto.so.1.1
0x1:
executed 52755 times by 1 test: case 0x1:
Executed by:
  • libcrypto.so.1.1
52755
202 case
executed 2962 times by 1 test: case 0x6:
Executed by:
  • libcrypto.so.1.1
0x6:
executed 2962 times by 1 test: case 0x6:
Executed by:
  • libcrypto.so.1.1
2962
203 *pval = -
204 ((void *)0)-
205 ;-
206 break;
executed 131322 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
131322
207 }-
208}
executed 1450955 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1450955
209-
210static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)-
211{-
212 const ASN1_ITEM *it = (tt->item);-
213 int embed = tt->flags & (0x1 << 12);-
214 ASN1_VALUE *tval;-
215 int ret;-
216 if (embed
embedDescription
TRUEevaluated 772994 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4091794 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
772994-4091794
217 tval = (ASN1_VALUE *)pval;-
218 pval = &tval;-
219 }
executed 772994 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
772994
220 if (tt->flags & (0x1)
tt->flags & (0x1)Description
TRUEevaluated 1745970 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3118818 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
1745970-3118818
221 asn1_template_clear(pval, tt);-
222 return
executed 1745970 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1745970 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1745970
223 }-
224-
225-
226 if (tt->flags & (0x3<<8)
tt->flags & (0x3<<8)Description
TRUEevaluated 48005 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3070813 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
48005-3070813
227 *pval = -
228 ((void *)0)-
229 ;-
230 return
executed 48005 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 48005 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
48005
231 }-
232-
233-
234-
235-
236-
237 if (tt->flags & (0x3 << 1)
tt->flags & (0x3 << 1)Description
TRUEevaluated 67078 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3003735 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
67078-3003735
238 struct stack_st_ASN1_VALUE *skval;-
239 skval = sk_ASN1_VALUE_new_null();-
240 if (!skval
!skvalDescription
TRUEnever evaluated
FALSEevaluated 67078 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-67078
241 ERR_put_error(13,(133),((1|64)),__FILE__,231);-
242 ret = 0;-
243 goto
never executed: goto done;
done;
never executed: goto done;
0
244 }-
245 *pval = (ASN1_VALUE *)skval;-
246 ret = 1;-
247 goto
executed 67078 times by 1 test: goto done;
Executed by:
  • libcrypto.so.1.1
done;
executed 67078 times by 1 test: goto done;
Executed by:
  • libcrypto.so.1.1
67078
248 }-
249-
250 ret = asn1_item_embed_new(pval, it, embed);-
251 done:
code before this statement executed 3003735 times by 2 tests: done:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3003735
252-
253-
254-
255 return
executed 3070813 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
ret;
executed 3070813 times by 2 tests: return ret;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3070813
256}-
257-
258static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)-
259{-
260-
261 if (tt->flags & ((0x3<<8) | (0x3 << 1))
tt->flags & ((... | (0x3 << 1))Description
TRUEevaluated 295015 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1450955 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
295015-1450955
262 *
executed 295015 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
pval =
executed 295015 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
295015
263 ((void *)0)
executed 295015 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
295015
264 ;
executed 295015 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
295015
265 else-
266 asn1_item_clear(pval, (tt->item));
executed 1450955 times by 1 test: asn1_item_clear(pval, (tt->item));
Executed by:
  • libcrypto.so.1.1
1450955
267}-
268-
269-
270-
271-
272-
273-
274static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it,-
275 int embed)-
276{-
277 ASN1_TYPE *typ;-
278 ASN1_STRING *str;-
279 int utype;-
280-
281 if (!it
!itDescription
TRUEnever evaluated
FALSEevaluated 2443994 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-2443994
282 return
never executed: return 0;
0;
never executed: return 0;
0
283-
284 if (it->funcs
it->funcsDescription
TRUEevaluated 95502 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 2348492 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
95502-2348492
285 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;-
286 if (embed
embedDescription
TRUEevaluated 41973 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53529 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
41973-53529
287 if (pf->prim_clear
pf->prim_clearDescription
TRUEevaluated 41973 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-41973
288 pf->prim_clear(pval, it);-
289 return
executed 41973 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 41973 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
41973
290 }-
291 }
never executed: end of block
else if (pf->prim_new
pf->prim_newDescription
TRUEevaluated 53529 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
) {
0-53529
292 return
executed 53529 times by 2 tests: return pf->prim_new(pval, it);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
pf->prim_new(pval, it);
executed 53529 times by 2 tests: return pf->prim_new(pval, it);
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
53529
293 }-
294 }
never executed: end of block
0
295-
296 if (it->itype == 0x5
it->itype == 0x5Description
TRUEevaluated 427413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1921079 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
427413-1921079
297 utype = -1;
executed 427413 times by 1 test: utype = -1;
Executed by:
  • libcrypto.so.1.1
427413
298 else-
299 utype = it->utype;
executed 1921079 times by 2 tests: utype = it->utype;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1921079
300 switch (utype) {-
301 case
executed 933921 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
6:
executed 933921 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
933921
302 *pval = (ASN1_VALUE *)OBJ_nid2obj(0);-
303 return
executed 933921 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 933921 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
933921
304-
305 case
executed 232 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 232 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
232
306 *(ASN1_BOOLEAN *)pval = it->size;-
307 return
executed 232 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 232 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
232
308-
309 case
executed 2 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
5:
executed 2 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
2
310 *pval = (ASN1_VALUE *)1;-
311 return
executed 2 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2
312-
313 case
executed 237207 times by 1 test: case -4:
Executed by:
  • libcrypto.so.1.1
-4:
executed 237207 times by 1 test: case -4:
Executed by:
  • libcrypto.so.1.1
237207
314 if ((
(typ = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 237207 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
typ = CRYPTO_malloc(sizeof(*typ), __FILE__, 302)) ==
(typ = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 237207 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-237207
315 ((void *)0)
(typ = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 237207 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-237207
316 ) {-
317 ERR_put_error(13,(119),((1|64)),__FILE__,303);-
318 return
never executed: return 0;
0;
never executed: return 0;
0
319 }-
320 typ->value.ptr = -
321 ((void *)0)-
322 ;-
323 typ->type = -1;-
324 *pval = (ASN1_VALUE *)typ;-
325 break;
executed 237207 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
237207
326-
327 default
executed 1177130 times by 2 tests: default:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
:
executed 1177130 times by 2 tests: default:
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1177130
328 if (embed
embedDescription
TRUEevaluated 373108 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 804022 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
373108-804022
329 str = *(ASN1_STRING **)pval;-
330 memset(str, 0, sizeof(*str));-
331 str->type = utype;-
332 str->flags = 0x080;-
333 }
executed 373108 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
373108
334 str = ASN1_STRING_type_new(utype);-
335 *pval = (ASN1_VALUE *)str;-
336 }
executed 804022 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
804022
337 if (it->itype == 0x5
it->itype == 0x5Description
TRUEevaluated 427413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 749717 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
&& str
strDescription
TRUEevaluated 427413 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-749717
338 str->flags |= 0x040;
executed 427413 times by 1 test: str->flags |= 0x040;
Executed by:
  • libcrypto.so.1.1
427413
339 break;
executed 1177130 times by 2 tests: break;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1177130
340 }-
341 if (*
*pvalDescription
TRUEevaluated 1414337 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
pval
*pvalDescription
TRUEevaluated 1414337 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEnever evaluated
)
0-1414337
342 return
executed 1414337 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 1414337 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1414337
343 return
never executed: return 0;
0;
never executed: return 0;
0
344}-
345-
346static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)-
347{-
348 int utype;-
349 if (it
itDescription
TRUEevaluated 1319633 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& it->funcs
it->funcsDescription
TRUEevaluated 45001 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1274632 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1319633
350 const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;-
351 if (pf->prim_clear
pf->prim_clearDescription
TRUEevaluated 39856 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5145 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
5145-39856
352 pf->prim_clear(pval, it);
executed 39856 times by 1 test: pf->prim_clear(pval, it);
Executed by:
  • libcrypto.so.1.1
39856
353 else-
354 *
executed 5145 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
pval =
executed 5145 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
5145
355 ((void *)0)
executed 5145 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
5145
356 ;
executed 5145 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
5145
357 return;
executed 45001 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
45001
358 }-
359 if (!it
!itDescription
TRUEnever evaluated
FALSEevaluated 1274632 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(it->itype == 0x5)Description
TRUEevaluated 67411 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1207221 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
it->itype == 0x5)
(it->itype == 0x5)Description
TRUEevaluated 67411 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1207221 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1274632
360 utype = -1;
executed 67411 times by 1 test: utype = -1;
Executed by:
  • libcrypto.so.1.1
67411
361 else-
362 utype = it->utype;
executed 1207221 times by 1 test: utype = it->utype;
Executed by:
  • libcrypto.so.1.1
1207221
363 if (utype == 1
utype == 1Description
TRUEevaluated 367682 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 906950 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
367682-906950
364 *(
executed 367682 times by 1 test: *(ASN1_BOOLEAN *)pval = it->size;
Executed by:
  • libcrypto.so.1.1
ASN1_BOOLEAN *)pval = it->size;
executed 367682 times by 1 test: *(ASN1_BOOLEAN *)pval = it->size;
Executed by:
  • libcrypto.so.1.1
367682
365 else-
366 *
executed 906950 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
pval =
executed 906950 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
906950
367 ((void *)0)
executed 906950 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
906950
368 ;
executed 906950 times by 1 test: *pval = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
906950
369}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2