| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/tasn_new.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | static int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, | - | ||||||||||||||||||
| 3 | int embed); | - | ||||||||||||||||||
| 4 | static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it, | - | ||||||||||||||||||
| 5 | int embed); | - | ||||||||||||||||||
| 6 | static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it); | - | ||||||||||||||||||
| 7 | static int asn1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | - | ||||||||||||||||||
| 8 | static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | - | ||||||||||||||||||
| 9 | static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it); | - | ||||||||||||||||||
| 10 | - | |||||||||||||||||||
| 11 | ASN1_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
| 0-368142 | ||||||||||||||||||
| 17 | return executed 368142 times by 1 test: ret;return ret;Executed by:
executed 368142 times by 1 test: return ret;Executed by:
| 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 | - | |||||||||||||||||||
| 25 | int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it) | - | ||||||||||||||||||
| 26 | { | - | ||||||||||||||||||
| 27 | return executed 1520094 times by 2 tests: asn1_item_embed_new(pval, it, 0);return asn1_item_embed_new(pval, it, 0);Executed by:
executed 1520094 times by 2 tests: return asn1_item_embed_new(pval, it, 0);Executed by:
| 1520094 | ||||||||||||||||||
| 28 | } | - | ||||||||||||||||||
| 29 | - | |||||||||||||||||||
| 30 | int 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
| 196852-3886273 | ||||||||||||||||||
| 41 | asn1_cb = aux->asn1_cb; executed 440704 times by 2 tests: asn1_cb = aux->asn1_cb;Executed by:
| 440704 | ||||||||||||||||||
| 42 | else | - | ||||||||||||||||||
| 43 | asn1_cb = 0; executed 4083125 times by 2 tests: asn1_cb = 0;Executed by:
| 4083125 | ||||||||||||||||||
| 44 | - | |||||||||||||||||||
| 45 | - | |||||||||||||||||||
| 46 | - | |||||||||||||||||||
| 47 | - | |||||||||||||||||||
| 48 | - | |||||||||||||||||||
| 49 | switch (it->itype) { | - | ||||||||||||||||||
| 50 | - | |||||||||||||||||||
| 51 | case executed 151109 times by 1 test: 0x4:case 0x4:Executed by:
executed 151109 times by 1 test: case 0x4:Executed by:
| 151109 | ||||||||||||||||||
| 52 | ef = it->funcs; | - | ||||||||||||||||||
| 53 | if (ef
| 0-151109 | ||||||||||||||||||
| 54 | if (!ef->asn1_ex_new(pval, it)
| 0-151109 | ||||||||||||||||||
| 55 | goto never executed: memerr;goto memerr;never executed: goto memerr; | 0 | ||||||||||||||||||
| 56 | } executed 151109 times by 1 test: end of blockExecuted by:
| 151109 | ||||||||||||||||||
| 57 | break; executed 151109 times by 1 test: break;Executed by:
| 151109 | ||||||||||||||||||
| 58 | - | |||||||||||||||||||
| 59 | case executed 2016582 times by 2 tests: 0x0:case 0x0:Executed by:
executed 2016582 times by 2 tests: case 0x0:Executed by:
| 2016582 | ||||||||||||||||||
| 60 | if (it->templates
| 1-2016581 | ||||||||||||||||||
| 61 | if (!asn1_template_new(pval, it->templates)
| 0-1 | ||||||||||||||||||
| 62 | goto never executed: memerr;goto memerr;never executed: goto memerr; | 0 | ||||||||||||||||||
| 63 | } executed 1 time by 1 test: else if (!asn1_primitive_new(pval, it, embed)end of blockExecuted by:
| 0-2016581 | ||||||||||||||||||
| 64 | goto never executed: memerr;goto memerr;never executed: goto memerr; | 0 | ||||||||||||||||||
| 65 | break; executed 2016582 times by 2 tests: break;Executed by:
| 2016582 | ||||||||||||||||||
| 66 | - | |||||||||||||||||||
| 67 | case executed 427413 times by 1 test: 0x5:case 0x5:Executed by:
executed 427413 times by 1 test: case 0x5:Executed by:
| 427413 | ||||||||||||||||||
| 68 | if (!asn1_primitive_new(pval, it, embed)
| 0-427413 | ||||||||||||||||||
| 69 | goto never executed: memerr;goto memerr;never executed: goto memerr; | 0 | ||||||||||||||||||
| 70 | break; executed 427413 times by 1 test: break;Executed by:
| 427413 | ||||||||||||||||||
| 71 | - | |||||||||||||||||||
| 72 | case executed 221755 times by 1 test: 0x2:case 0x2:Executed by:
executed 221755 times by 1 test: case 0x2:Executed by:
| 221755 | ||||||||||||||||||
| 73 | if (asn1_cb
| 32587-189168 | ||||||||||||||||||
| 74 | i = asn1_cb(0, pval, it, | - | ||||||||||||||||||
| 75 | ((void *)0) | - | ||||||||||||||||||
| 76 | ); | - | ||||||||||||||||||
| 77 | if (!i
| 0-32587 | ||||||||||||||||||
| 78 | goto never executed: auxerr;goto auxerr;never executed: goto auxerr; | 0 | ||||||||||||||||||
| 79 | if (i == 2
| 0-32587 | ||||||||||||||||||
| 80 | - | |||||||||||||||||||
| 81 | - | |||||||||||||||||||
| 82 | - | |||||||||||||||||||
| 83 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 84 | } | - | ||||||||||||||||||
| 85 | } executed 32587 times by 1 test: end of blockExecuted by:
| 32587 | ||||||||||||||||||
| 86 | if (embed
| 5986-215769 | ||||||||||||||||||
| 87 | memset(*pval, 0, it->size); | - | ||||||||||||||||||
| 88 | } executed 5986 times by 1 test: else {end of blockExecuted by:
| 5986 | ||||||||||||||||||
| 89 | *pval = CRYPTO_zalloc(it->size, __FILE__, 97); | - | ||||||||||||||||||
| 90 | if (*
| 0-215769 | ||||||||||||||||||
| 91 | ((void *)0)
| 0-215769 | ||||||||||||||||||
| 92 | ) | - | ||||||||||||||||||
| 93 | goto never executed: memerr;goto memerr;never executed: goto memerr; | 0 | ||||||||||||||||||
| 94 | } executed 215769 times by 1 test: end of blockExecuted by:
| 215769 | ||||||||||||||||||
| 95 | asn1_set_choice_selector(pval, -1, it); | - | ||||||||||||||||||
| 96 | if (asn1_cb
| 0-189168 | ||||||||||||||||||
| 97 | ((void *)0)
| 0-32587 | ||||||||||||||||||
| 98 | )
| 0-32587 | ||||||||||||||||||
| 99 | goto never executed: auxerr2;goto auxerr2;never executed: goto auxerr2; | 0 | ||||||||||||||||||
| 100 | break; executed 221755 times by 1 test: break;Executed by:
| 221755 | ||||||||||||||||||
| 101 | - | |||||||||||||||||||
| 102 | case executed 50927 times by 1 test: 0x6:case 0x6:Executed by:
executed 50927 times by 1 test: case 0x6:Executed by:
| 50927 | ||||||||||||||||||
| 103 | case executed 1656043 times by 2 tests: 0x1:case 0x1:Executed by:
executed 1656043 times by 2 tests: case 0x1:Executed by:
| 1656043 | ||||||||||||||||||
| 104 | if (asn1_cb
| 312615-1394355 | ||||||||||||||||||
| 105 | i = asn1_cb(0, pval, it, | - | ||||||||||||||||||
| 106 | ((void *)0) | - | ||||||||||||||||||
| 107 | ); | - | ||||||||||||||||||
| 108 | if (!i
| 0-312615 | ||||||||||||||||||
| 109 | goto never executed: auxerr;goto auxerr;never executed: goto auxerr; | 0 | ||||||||||||||||||
| 110 | if (i == 2
| 46982-265633 | ||||||||||||||||||
| 111 | - | |||||||||||||||||||
| 112 | - | |||||||||||||||||||
| 113 | - | |||||||||||||||||||
| 114 | return executed 46982 times by 1 test: 1;return 1;Executed by:
executed 46982 times by 1 test: return 1;Executed by:
| 46982 | ||||||||||||||||||
| 115 | } | - | ||||||||||||||||||
| 116 | } executed 265633 times by 1 test: end of blockExecuted by:
| 265633 | ||||||||||||||||||
| 117 | if (embed
| 312117-1347871 | ||||||||||||||||||
| 118 | memset(*pval, 0, it->size); | - | ||||||||||||||||||
| 119 | } executed 312117 times by 1 test: else {end of blockExecuted by:
| 312117 | ||||||||||||||||||
| 120 | *pval = CRYPTO_zalloc(it->size, __FILE__, 122); | - | ||||||||||||||||||
| 121 | if (*
| 0-1347871 | ||||||||||||||||||
| 122 | ((void *)0)
| 0-1347871 | ||||||||||||||||||
| 123 | ) | - | ||||||||||||||||||
| 124 | goto never executed: memerr;goto memerr;never executed: goto memerr; | 0 | ||||||||||||||||||
| 125 | } executed 1347871 times by 2 tests: end of blockExecuted by:
| 1347871 | ||||||||||||||||||
| 126 | - | |||||||||||||||||||
| 127 | if (asn1_do_lock(pval, 0, it) < 0
| 0-1659988 | ||||||||||||||||||
| 128 | if (!embed
| 0 | ||||||||||||||||||
| 129 | CRYPTO_free(*pval, __FILE__, 129); | - | ||||||||||||||||||
| 130 | *pval = | - | ||||||||||||||||||
| 131 | ((void *)0) | - | ||||||||||||||||||
| 132 | ; | - | ||||||||||||||||||
| 133 | } never executed: end of block | 0 | ||||||||||||||||||
| 134 | goto never executed: memerr;goto memerr;never executed: goto memerr; | 0 | ||||||||||||||||||
| 135 | } | - | ||||||||||||||||||
| 136 | asn1_enc_init(pval, it); | - | ||||||||||||||||||
| 137 | for (i = 0, tt = it->templates; i < it->tcount
| 1659988-4864787 | ||||||||||||||||||
| 138 | pseqval = asn1_get_field_ptr(pval, tt); | - | ||||||||||||||||||
| 139 | if (!asn1_template_new(pseqval, tt)
| 0-4864787 | ||||||||||||||||||
| 140 | goto never executed: memerr2;goto memerr2;never executed: goto memerr2; | 0 | ||||||||||||||||||
| 141 | } executed 4864787 times by 2 tests: end of blockExecuted by:
| 4864787 | ||||||||||||||||||
| 142 | if (asn1_cb
| 0-1394355 | ||||||||||||||||||
| 143 | ((void *)0)
| 0-265633 | ||||||||||||||||||
| 144 | )
| 0-265633 | ||||||||||||||||||
| 145 | goto never executed: auxerr2;goto auxerr2;never executed: goto auxerr2; | 0 | ||||||||||||||||||
| 146 | break; executed 1659988 times by 2 tests: break;Executed by:
| 1659988 | ||||||||||||||||||
| 147 | } | - | ||||||||||||||||||
| 148 | - | |||||||||||||||||||
| 149 | - | |||||||||||||||||||
| 150 | - | |||||||||||||||||||
| 151 | return executed 4476847 times by 2 tests: 1;return 1;Executed by:
executed 4476847 times by 2 tests: return 1;Executed by:
| 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: 0;return 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: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 170 | - | |||||||||||||||||||
| 171 | } | - | ||||||||||||||||||
| 172 | - | |||||||||||||||||||
| 173 | static 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: 0x4:case 0x4:never executed: case 0x4: | 0 | ||||||||||||||||||
| 180 | ef = it->funcs; | - | ||||||||||||||||||
| 181 | if (ef
| 0 | ||||||||||||||||||
| 182 | ef->asn1_ex_clear(pval, it); never executed: ef->asn1_ex_clear(pval, it); | 0 | ||||||||||||||||||
| 183 | else | - | ||||||||||||||||||
| 184 | * never executed: pval = *pval = ((void *)0) ;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: 0x0:case 0x0:Executed by:
executed 1252222 times by 1 test: case 0x0:Executed by:
| 1252222 | ||||||||||||||||||
| 190 | if (it->templates
| 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:
| 1252222 | ||||||||||||||||||
| 194 | break; executed 1252222 times by 1 test: break;Executed by:
| 1252222 | ||||||||||||||||||
| 195 | - | |||||||||||||||||||
| 196 | case executed 67411 times by 1 test: 0x5:case 0x5:Executed by:
executed 67411 times by 1 test: case 0x5:Executed by:
| 67411 | ||||||||||||||||||
| 197 | asn1_primitive_clear(pval, it); | - | ||||||||||||||||||
| 198 | break; executed 67411 times by 1 test: break;Executed by:
| 67411 | ||||||||||||||||||
| 199 | - | |||||||||||||||||||
| 200 | case executed 75605 times by 1 test: 0x2:case 0x2:Executed by:
executed 75605 times by 1 test: case 0x2:Executed by:
| 75605 | ||||||||||||||||||
| 201 | case executed 52755 times by 1 test: 0x1:case 0x1:Executed by:
executed 52755 times by 1 test: case 0x1:Executed by:
| 52755 | ||||||||||||||||||
| 202 | case executed 2962 times by 1 test: 0x6:case 0x6:Executed by:
executed 2962 times by 1 test: case 0x6:Executed by:
| 2962 | ||||||||||||||||||
| 203 | *pval = | - | ||||||||||||||||||
| 204 | ((void *)0) | - | ||||||||||||||||||
| 205 | ; | - | ||||||||||||||||||
| 206 | break; executed 131322 times by 1 test: break;Executed by:
| 131322 | ||||||||||||||||||
| 207 | } | - | ||||||||||||||||||
| 208 | } executed 1450955 times by 1 test: end of blockExecuted by:
| 1450955 | ||||||||||||||||||
| 209 | - | |||||||||||||||||||
| 210 | static 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
| 772994-4091794 | ||||||||||||||||||
| 217 | tval = (ASN1_VALUE *)pval; | - | ||||||||||||||||||
| 218 | pval = &tval; | - | ||||||||||||||||||
| 219 | } executed 772994 times by 1 test: end of blockExecuted by:
| 772994 | ||||||||||||||||||
| 220 | if (tt->flags & (0x1)
| 1745970-3118818 | ||||||||||||||||||
| 221 | asn1_template_clear(pval, tt); | - | ||||||||||||||||||
| 222 | return executed 1745970 times by 1 test: 1;return 1;Executed by:
executed 1745970 times by 1 test: return 1;Executed by:
| 1745970 | ||||||||||||||||||
| 223 | } | - | ||||||||||||||||||
| 224 | - | |||||||||||||||||||
| 225 | - | |||||||||||||||||||
| 226 | if (tt->flags & (0x3<<8)
| 48005-3070813 | ||||||||||||||||||
| 227 | *pval = | - | ||||||||||||||||||
| 228 | ((void *)0) | - | ||||||||||||||||||
| 229 | ; | - | ||||||||||||||||||
| 230 | return executed 48005 times by 1 test: 1;return 1;Executed by:
executed 48005 times by 1 test: return 1;Executed by:
| 48005 | ||||||||||||||||||
| 231 | } | - | ||||||||||||||||||
| 232 | - | |||||||||||||||||||
| 233 | - | |||||||||||||||||||
| 234 | - | |||||||||||||||||||
| 235 | - | |||||||||||||||||||
| 236 | - | |||||||||||||||||||
| 237 | if (tt->flags & (0x3 << 1)
| 67078-3003735 | ||||||||||||||||||
| 238 | struct stack_st_ASN1_VALUE *skval; | - | ||||||||||||||||||
| 239 | skval = sk_ASN1_VALUE_new_null(); | - | ||||||||||||||||||
| 240 | if (!skval
| 0-67078 | ||||||||||||||||||
| 241 | ERR_put_error(13,(133),((1|64)),__FILE__,231); | - | ||||||||||||||||||
| 242 | ret = 0; | - | ||||||||||||||||||
| 243 | goto never executed: done;goto done;never executed: goto done; | 0 | ||||||||||||||||||
| 244 | } | - | ||||||||||||||||||
| 245 | *pval = (ASN1_VALUE *)skval; | - | ||||||||||||||||||
| 246 | ret = 1; | - | ||||||||||||||||||
| 247 | goto executed 67078 times by 1 test: done;goto done;Executed by:
executed 67078 times by 1 test: goto done;Executed by:
| 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:
| 3003735 | ||||||||||||||||||
| 252 | - | |||||||||||||||||||
| 253 | - | |||||||||||||||||||
| 254 | - | |||||||||||||||||||
| 255 | return executed 3070813 times by 2 tests: ret;return ret;Executed by:
executed 3070813 times by 2 tests: return ret;Executed by:
| 3070813 | ||||||||||||||||||
| 256 | } | - | ||||||||||||||||||
| 257 | - | |||||||||||||||||||
| 258 | static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) | - | ||||||||||||||||||
| 259 | { | - | ||||||||||||||||||
| 260 | - | |||||||||||||||||||
| 261 | if (tt->flags & ((0x3<<8) | (0x3 << 1))
| 295015-1450955 | ||||||||||||||||||
| 262 | * executed 295015 times by 1 test: pval = *pval = ((void *)0) ;Executed by:
executed 295015 times by 1 test: *pval = ((void *)0) ;Executed by:
| 295015 | ||||||||||||||||||
| 263 | ((void *)0) executed 295015 times by 1 test: *pval = ((void *)0) ;Executed by:
| 295015 | ||||||||||||||||||
| 264 | ; executed 295015 times by 1 test: *pval = ((void *)0) ;Executed by:
| 295015 | ||||||||||||||||||
| 265 | else | - | ||||||||||||||||||
| 266 | asn1_item_clear(pval, (tt->item)); executed 1450955 times by 1 test: asn1_item_clear(pval, (tt->item));Executed by:
| 1450955 | ||||||||||||||||||
| 267 | } | - | ||||||||||||||||||
| 268 | - | |||||||||||||||||||
| 269 | - | |||||||||||||||||||
| 270 | - | |||||||||||||||||||
| 271 | - | |||||||||||||||||||
| 272 | - | |||||||||||||||||||
| 273 | - | |||||||||||||||||||
| 274 | static 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
| 0-2443994 | ||||||||||||||||||
| 282 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 283 | - | |||||||||||||||||||
| 284 | if (it->funcs
| 95502-2348492 | ||||||||||||||||||
| 285 | const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; | - | ||||||||||||||||||
| 286 | if (embed
| 41973-53529 | ||||||||||||||||||
| 287 | if (pf->prim_clear
| 0-41973 | ||||||||||||||||||
| 288 | pf->prim_clear(pval, it); | - | ||||||||||||||||||
| 289 | return executed 41973 times by 1 test: 1;return 1;Executed by:
executed 41973 times by 1 test: return 1;Executed by:
| 41973 | ||||||||||||||||||
| 290 | } | - | ||||||||||||||||||
| 291 | } never executed: else if (pf->prim_newend of block
| 0-53529 | ||||||||||||||||||
| 292 | return executed 53529 times by 2 tests: pf->prim_new(pval, it);return pf->prim_new(pval, it);Executed by:
executed 53529 times by 2 tests: return pf->prim_new(pval, it);Executed by:
| 53529 | ||||||||||||||||||
| 293 | } | - | ||||||||||||||||||
| 294 | } never executed: end of block | 0 | ||||||||||||||||||
| 295 | - | |||||||||||||||||||
| 296 | if (it->itype == 0x5
| 427413-1921079 | ||||||||||||||||||
| 297 | utype = -1; executed 427413 times by 1 test: utype = -1;Executed by:
| 427413 | ||||||||||||||||||
| 298 | else | - | ||||||||||||||||||
| 299 | utype = it->utype; executed 1921079 times by 2 tests: utype = it->utype;Executed by:
| 1921079 | ||||||||||||||||||
| 300 | switch (utype) { | - | ||||||||||||||||||
| 301 | case executed 933921 times by 1 test: 6:case 6:Executed by:
executed 933921 times by 1 test: case 6:Executed by:
| 933921 | ||||||||||||||||||
| 302 | *pval = (ASN1_VALUE *)OBJ_nid2obj(0); | - | ||||||||||||||||||
| 303 | return executed 933921 times by 1 test: 1;return 1;Executed by:
executed 933921 times by 1 test: return 1;Executed by:
| 933921 | ||||||||||||||||||
| 304 | - | |||||||||||||||||||
| 305 | case executed 232 times by 1 test: 1:case 1:Executed by:
executed 232 times by 1 test: case 1:Executed by:
| 232 | ||||||||||||||||||
| 306 | *(ASN1_BOOLEAN *)pval = it->size; | - | ||||||||||||||||||
| 307 | return executed 232 times by 1 test: 1;return 1;Executed by:
executed 232 times by 1 test: return 1;Executed by:
| 232 | ||||||||||||||||||
| 308 | - | |||||||||||||||||||
| 309 | case executed 2 times by 1 test: 5:case 5:Executed by:
executed 2 times by 1 test: case 5:Executed by:
| 2 | ||||||||||||||||||
| 310 | *pval = (ASN1_VALUE *)1; | - | ||||||||||||||||||
| 311 | return executed 2 times by 1 test: 1;return 1;Executed by:
executed 2 times by 1 test: return 1;Executed by:
| 2 | ||||||||||||||||||
| 312 | - | |||||||||||||||||||
| 313 | case executed 237207 times by 1 test: -4:case -4:Executed by:
executed 237207 times by 1 test: case -4:Executed by:
| 237207 | ||||||||||||||||||
| 314 | if ((
| 0-237207 | ||||||||||||||||||
| 315 | ((void *)0)
| 0-237207 | ||||||||||||||||||
| 316 | ) { | - | ||||||||||||||||||
| 317 | ERR_put_error(13,(119),((1|64)),__FILE__,303); | - | ||||||||||||||||||
| 318 | return never executed: 0;return 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:
| 237207 | ||||||||||||||||||
| 326 | - | |||||||||||||||||||
| 327 | default executed 1177130 times by 2 tests: :default:Executed by:
executed 1177130 times by 2 tests: default:Executed by:
| 1177130 | ||||||||||||||||||
| 328 | if (embed
| 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: else {end of blockExecuted by:
| 373108 | ||||||||||||||||||
| 334 | str = ASN1_STRING_type_new(utype); | - | ||||||||||||||||||
| 335 | *pval = (ASN1_VALUE *)str; | - | ||||||||||||||||||
| 336 | } executed 804022 times by 2 tests: end of blockExecuted by:
| 804022 | ||||||||||||||||||
| 337 | if (it->itype == 0x5
| 0-749717 | ||||||||||||||||||
| 338 | str->flags |= 0x040; executed 427413 times by 1 test: str->flags |= 0x040;Executed by:
| 427413 | ||||||||||||||||||
| 339 | break; executed 1177130 times by 2 tests: break;Executed by:
| 1177130 | ||||||||||||||||||
| 340 | } | - | ||||||||||||||||||
| 341 | if (*
| 0-1414337 | ||||||||||||||||||
| 342 | return executed 1414337 times by 2 tests: 1;return 1;Executed by:
executed 1414337 times by 2 tests: return 1;Executed by:
| 1414337 | ||||||||||||||||||
| 343 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 344 | } | - | ||||||||||||||||||
| 345 | - | |||||||||||||||||||
| 346 | static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) | - | ||||||||||||||||||
| 347 | { | - | ||||||||||||||||||
| 348 | int utype; | - | ||||||||||||||||||
| 349 | if (it
| 0-1319633 | ||||||||||||||||||
| 350 | const ASN1_PRIMITIVE_FUNCS *pf = it->funcs; | - | ||||||||||||||||||
| 351 | if (pf->prim_clear
| 5145-39856 | ||||||||||||||||||
| 352 | pf->prim_clear(pval, it); executed 39856 times by 1 test: pf->prim_clear(pval, it);Executed by:
| 39856 | ||||||||||||||||||
| 353 | else | - | ||||||||||||||||||
| 354 | * executed 5145 times by 1 test: pval = *pval = ((void *)0) ;Executed by:
executed 5145 times by 1 test: *pval = ((void *)0) ;Executed by:
| 5145 | ||||||||||||||||||
| 355 | ((void *)0) executed 5145 times by 1 test: *pval = ((void *)0) ;Executed by:
| 5145 | ||||||||||||||||||
| 356 | ; executed 5145 times by 1 test: *pval = ((void *)0) ;Executed by:
| 5145 | ||||||||||||||||||
| 357 | return; executed 45001 times by 1 test: return;Executed by:
| 45001 | ||||||||||||||||||
| 358 | } | - | ||||||||||||||||||
| 359 | if (!it
| 0-1274632 | ||||||||||||||||||
| 360 | utype = -1; executed 67411 times by 1 test: utype = -1;Executed by:
| 67411 | ||||||||||||||||||
| 361 | else | - | ||||||||||||||||||
| 362 | utype = it->utype; executed 1207221 times by 1 test: utype = it->utype;Executed by:
| 1207221 | ||||||||||||||||||
| 363 | if (utype == 1
| 367682-906950 | ||||||||||||||||||
| 364 | *( executed 367682 times by 1 test: ASN1_BOOLEAN *)pval = it->size;*(ASN1_BOOLEAN *)pval = it->size;Executed by:
executed 367682 times by 1 test: *(ASN1_BOOLEAN *)pval = it->size;Executed by:
| 367682 | ||||||||||||||||||
| 365 | else | - | ||||||||||||||||||
| 366 | * executed 906950 times by 1 test: pval = *pval = ((void *)0) ;Executed by:
executed 906950 times by 1 test: *pval = ((void *)0) ;Executed by:
| 906950 | ||||||||||||||||||
| 367 | ((void *)0) executed 906950 times by 1 test: *pval = ((void *)0) ;Executed by:
| 906950 | ||||||||||||||||||
| 368 | ; executed 906950 times by 1 test: *pval = ((void *)0) ;Executed by:
| 906950 | ||||||||||||||||||
| 369 | } | - | ||||||||||||||||||
| Switch to Source code | Preprocessed file |