| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/tasn_enc.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, | - | ||||||||||||||||||||||||
| 3 | const ASN1_ITEM *it, int tag, int aclass); | - | ||||||||||||||||||||||||
| 4 | static int asn1_set_seq_out(struct stack_st_ASN1_VALUE *sk, unsigned char **out, | - | ||||||||||||||||||||||||
| 5 | int skcontlen, const ASN1_ITEM *item, | - | ||||||||||||||||||||||||
| 6 | int do_sort, int iclass); | - | ||||||||||||||||||||||||
| 7 | static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, | - | ||||||||||||||||||||||||
| 8 | const ASN1_TEMPLATE *tt, int tag, int aclass); | - | ||||||||||||||||||||||||
| 9 | static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out, | - | ||||||||||||||||||||||||
| 10 | const ASN1_ITEM *it, int flags); | - | ||||||||||||||||||||||||
| 11 | static int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, | - | ||||||||||||||||||||||||
| 12 | const ASN1_ITEM *it); | - | ||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, | - | ||||||||||||||||||||||||
| 20 | const ASN1_ITEM *it) | - | ||||||||||||||||||||||||
| 21 | { | - | ||||||||||||||||||||||||
| 22 | return executed 180 times by 1 test: asn1_item_flags_i2d(val, out, it, (0x1<<11));return asn1_item_flags_i2d(val, out, it, (0x1<<11));Executed by:
executed 180 times by 1 test: return asn1_item_flags_i2d(val, out, it, (0x1<<11));Executed by:
| 180 | ||||||||||||||||||||||||
| 23 | } | - | ||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||
| 25 | int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it) | - | ||||||||||||||||||||||||
| 26 | { | - | ||||||||||||||||||||||||
| 27 | return executed 137929 times by 2 tests: asn1_item_flags_i2d(val, out, it, 0);return asn1_item_flags_i2d(val, out, it, 0);Executed by:
executed 137929 times by 2 tests: return asn1_item_flags_i2d(val, out, it, 0);Executed by:
| 137929 | ||||||||||||||||||||||||
| 28 | } | - | ||||||||||||||||||||||||
| 29 | static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out, | - | ||||||||||||||||||||||||
| 30 | const ASN1_ITEM *it, int flags) | - | ||||||||||||||||||||||||
| 31 | { | - | ||||||||||||||||||||||||
| 32 | if (out
| 10797-121463 | ||||||||||||||||||||||||
| 33 | unsigned char *p, *buf; | - | ||||||||||||||||||||||||
| 34 | int len; | - | ||||||||||||||||||||||||
| 35 | - | |||||||||||||||||||||||||
| 36 | len = ASN1_item_ex_i2d(&val, | - | ||||||||||||||||||||||||
| 37 | ((void *)0) | - | ||||||||||||||||||||||||
| 38 | , it, -1, flags); | - | ||||||||||||||||||||||||
| 39 | if (len <= 0
| 10-110656 | ||||||||||||||||||||||||
| 40 | return executed 10 times by 1 test: len;return len;Executed by:
executed 10 times by 1 test: return len;Executed by:
| 10 | ||||||||||||||||||||||||
| 41 | if ((
| 0-110656 | ||||||||||||||||||||||||
| 42 | ((void *)0)
| 0-110656 | ||||||||||||||||||||||||
| 43 | ) { | - | ||||||||||||||||||||||||
| 44 | ERR_put_error(13,(118),((1|64)),__FILE__,65); | - | ||||||||||||||||||||||||
| 45 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 46 | } | - | ||||||||||||||||||||||||
| 47 | p = buf; | - | ||||||||||||||||||||||||
| 48 | ASN1_item_ex_i2d(&val, &p, it, -1, flags); | - | ||||||||||||||||||||||||
| 49 | *out = buf; | - | ||||||||||||||||||||||||
| 50 | return executed 110656 times by 1 test: len;return len;Executed by:
executed 110656 times by 1 test: return len;Executed by:
| 110656 | ||||||||||||||||||||||||
| 51 | } | - | ||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||
| 53 | return executed 27443 times by 2 tests: ASN1_item_ex_i2d(&val, out, it, -1, flags);return ASN1_item_ex_i2d(&val, out, it, -1, flags);Executed by:
executed 27443 times by 2 tests: return ASN1_item_ex_i2d(&val, out, it, -1, flags);Executed by:
| 27443 | ||||||||||||||||||||||||
| 54 | } | - | ||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||
| 61 | int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, | - | ||||||||||||||||||||||||
| 62 | const ASN1_ITEM *it, int tag, int aclass) | - | ||||||||||||||||||||||||
| 63 | { | - | ||||||||||||||||||||||||
| 64 | const ASN1_TEMPLATE *tt = | - | ||||||||||||||||||||||||
| 65 | ((void *)0) | - | ||||||||||||||||||||||||
| 66 | ; | - | ||||||||||||||||||||||||
| 67 | int i, seqcontlen, seqlen, ndef = 1; | - | ||||||||||||||||||||||||
| 68 | const ASN1_EXTERN_FUNCS *ef; | - | ||||||||||||||||||||||||
| 69 | const ASN1_AUX *aux = it->funcs; | - | ||||||||||||||||||||||||
| 70 | ASN1_aux_cb *asn1_cb = 0; | - | ||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | if ((
| 37110-2978213 | ||||||||||||||||||||||||
| 73 | return executed 37110 times by 1 test: 0;return 0;Executed by:
executed 37110 times by 1 test: return 0;Executed by:
| 37110 | ||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||
| 75 | if (aux
| 86999-4210617 | ||||||||||||||||||||||||
| 76 | asn1_cb = aux->asn1_cb; executed 591504 times by 2 tests: asn1_cb = aux->asn1_cb;Executed by:
| 591504 | ||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||
| 78 | switch (it->itype) { | - | ||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | case executed 2978213 times by 2 tests: 0x0:case 0x0:Executed by:
executed 2978213 times by 2 tests: case 0x0:Executed by:
| 2978213 | ||||||||||||||||||||||||
| 81 | if (it->templates
| 233184-2745029 | ||||||||||||||||||||||||
| 82 | return executed 233184 times by 1 test: asn1_template_ex_i2d(pval, out, it->templates,return asn1_template_ex_i2d(pval, out, it->templates, tag, aclass);Executed by:
executed 233184 times by 1 test: return asn1_template_ex_i2d(pval, out, it->templates, tag, aclass);Executed by:
| 233184 | ||||||||||||||||||||||||
| 83 | tag, aclass); executed 233184 times by 1 test: return asn1_template_ex_i2d(pval, out, it->templates, tag, aclass);Executed by:
| 233184 | ||||||||||||||||||||||||
| 84 | return executed 2745029 times by 2 tests: asn1_i2d_ex_primitive(pval, out, it, tag, aclass);return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);Executed by:
executed 2745029 times by 2 tests: return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);Executed by:
| 2745029 | ||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||
| 86 | case executed 592012 times by 1 test: 0x5:case 0x5:Executed by:
executed 592012 times by 1 test: case 0x5:Executed by:
| 592012 | ||||||||||||||||||||||||
| 87 | return executed 592012 times by 1 test: asn1_i2d_ex_primitive(pval, out, it, -1, aclass);return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);Executed by:
executed 592012 times by 1 test: return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);Executed by:
| 592012 | ||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||
| 89 | case executed 77111 times by 1 test: 0x2:case 0x2:Executed by:
executed 77111 times by 1 test: case 0x2:Executed by:
| 77111 | ||||||||||||||||||||||||
| 90 | if (asn1_cb
| 0-45270 | ||||||||||||||||||||||||
| 91 | ((void *)0)
| 0-31841 | ||||||||||||||||||||||||
| 92 | )
| 0-31841 | ||||||||||||||||||||||||
| 93 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 94 | i = asn1_get_choice_selector(pval, it); | - | ||||||||||||||||||||||||
| 95 | if ((
| 0-77111 | ||||||||||||||||||||||||
| 96 | ASN1_VALUE **pchval; | - | ||||||||||||||||||||||||
| 97 | const ASN1_TEMPLATE *chtt; | - | ||||||||||||||||||||||||
| 98 | chtt = it->templates + i; | - | ||||||||||||||||||||||||
| 99 | pchval = asn1_get_field_ptr(pval, chtt); | - | ||||||||||||||||||||||||
| 100 | return executed 77111 times by 1 test: asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);Executed by:
executed 77111 times by 1 test: return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);Executed by:
| 77111 | ||||||||||||||||||||||||
| 101 | } | - | ||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||
| 103 | if (asn1_cb
| 0 | ||||||||||||||||||||||||
| 104 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 105 | )
| 0 | ||||||||||||||||||||||||
| 106 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 107 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||
| 109 | case executed 32353 times by 1 test: 0x4:case 0x4:Executed by:
executed 32353 times by 1 test: case 0x4:Executed by:
| 32353 | ||||||||||||||||||||||||
| 110 | - | |||||||||||||||||||||||||
| 111 | ef = it->funcs; | - | ||||||||||||||||||||||||
| 112 | return executed 32353 times by 1 test: ef->asn1_ex_i2d(pval, out, it, tag, aclass);return ef->asn1_ex_i2d(pval, out, it, tag, aclass);Executed by:
executed 32353 times by 1 test: return ef->asn1_ex_i2d(pval, out, it, tag, aclass);Executed by:
| 32353 | ||||||||||||||||||||||||
| 113 | - | |||||||||||||||||||||||||
| 114 | case executed 6848 times by 1 test: 0x6:case 0x6:Executed by:
executed 6848 times by 1 test: case 0x6:Executed by:
| 6848 | ||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||
| 116 | if (aclass & (0x1<<11)
| 972-5876 | ||||||||||||||||||||||||
| 117 | ndef = 2; executed 972 times by 1 test: ndef = 2;Executed by:
| 972 | ||||||||||||||||||||||||
| 118 | - | |||||||||||||||||||||||||
| 119 | - | |||||||||||||||||||||||||
| 120 | case executed 1202583 times by 2 tests: 0x1:case 0x1:Executed by:
executed 1202583 times by 2 tests: case 0x1:Executed by:
code before this statement executed 6848 times by 1 test: case 0x1:Executed by:
| 6848-1202583 | ||||||||||||||||||||||||
| 121 | i = asn1_enc_restore(&seqcontlen, out, pval, it); | - | ||||||||||||||||||||||||
| 122 | - | |||||||||||||||||||||||||
| 123 | if (i < 0
| 0-1209431 | ||||||||||||||||||||||||
| 124 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||
| 126 | if (i > 0
| 163825-1045606 | ||||||||||||||||||||||||
| 127 | return executed 163825 times by 1 test: seqcontlen;return seqcontlen;Executed by:
executed 163825 times by 1 test: return seqcontlen;Executed by:
| 163825 | ||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||
| 129 | seqcontlen = 0; | - | ||||||||||||||||||||||||
| 130 | - | |||||||||||||||||||||||||
| 131 | if (tag == -1
| 33474-1012132 | ||||||||||||||||||||||||
| 132 | tag = 16; | - | ||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||
| 134 | aclass = (aclass & ~(0x3<<6)) | - | ||||||||||||||||||||||||
| 135 | | 0x00; | - | ||||||||||||||||||||||||
| 136 | } executed 1012132 times by 2 tests: end of blockExecuted by:
| 1012132 | ||||||||||||||||||||||||
| 137 | if (asn1_cb
| 0-883184 | ||||||||||||||||||||||||
| 138 | ((void *)0)
| 0-162422 | ||||||||||||||||||||||||
| 139 | )
| 0-162422 | ||||||||||||||||||||||||
| 140 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||
| 142 | for (i = 0, tt = it->templates; i < it->tcount
| 1045606-2578593 | ||||||||||||||||||||||||
| 143 | const ASN1_TEMPLATE *seqtt; | - | ||||||||||||||||||||||||
| 144 | ASN1_VALUE **pseqval; | - | ||||||||||||||||||||||||
| 145 | int tmplen; | - | ||||||||||||||||||||||||
| 146 | seqtt = asn1_do_adb(pval, tt, 1); | - | ||||||||||||||||||||||||
| 147 | if (!seqtt
| 0-2578593 | ||||||||||||||||||||||||
| 148 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 149 | pseqval = asn1_get_field_ptr(pval, seqtt); | - | ||||||||||||||||||||||||
| 150 | tmplen = asn1_template_ex_i2d(pseqval, | - | ||||||||||||||||||||||||
| 151 | ((void *)0) | - | ||||||||||||||||||||||||
| 152 | , seqtt, -1, aclass); | - | ||||||||||||||||||||||||
| 153 | if (tmplen == -1
| 0-2578593 | ||||||||||||||||||||||||
| 154 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 155 | seqcontlen += tmplen; | - | ||||||||||||||||||||||||
| 156 | } executed 2578593 times by 2 tests: end of blockExecuted by:
| 2578593 | ||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||
| 158 | seqlen = ASN1_object_size(ndef, seqcontlen, tag); | - | ||||||||||||||||||||||||
| 159 | if (!out
| 0-700744 | ||||||||||||||||||||||||
| 160 | return executed 700744 times by 1 test: seqlen;return seqlen;Executed by:
executed 700744 times by 1 test: return seqlen;Executed by:
| 700744 | ||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||
| 162 | ASN1_put_object(out, ndef, seqcontlen, tag, aclass); | - | ||||||||||||||||||||||||
| 163 | for (i = 0, tt = it->templates; i < it->tcount
| 344862-873704 | ||||||||||||||||||||||||
| 164 | const ASN1_TEMPLATE *seqtt; | - | ||||||||||||||||||||||||
| 165 | ASN1_VALUE **pseqval; | - | ||||||||||||||||||||||||
| 166 | seqtt = asn1_do_adb(pval, tt, 1); | - | ||||||||||||||||||||||||
| 167 | if (!seqtt
| 0-873704 | ||||||||||||||||||||||||
| 168 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 169 | pseqval = asn1_get_field_ptr(pval, seqtt); | - | ||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||
| 171 | asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass); | - | ||||||||||||||||||||||||
| 172 | } executed 873704 times by 2 tests: end of blockExecuted by:
| 873704 | ||||||||||||||||||||||||
| 173 | if (ndef == 2
| 266-344596 | ||||||||||||||||||||||||
| 174 | ASN1_put_eoc(out); executed 266 times by 1 test: ASN1_put_eoc(out);Executed by:
| 266 | ||||||||||||||||||||||||
| 175 | if (asn1_cb
| 0-270437 | ||||||||||||||||||||||||
| 176 | ((void *)0)
| 0-74425 | ||||||||||||||||||||||||
| 177 | )
| 0-74425 | ||||||||||||||||||||||||
| 178 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 179 | return executed 344862 times by 2 tests: seqlen;return seqlen;Executed by:
executed 344862 times by 2 tests: return seqlen;Executed by:
| 344862 | ||||||||||||||||||||||||
| 180 | - | |||||||||||||||||||||||||
| 181 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 182 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||
| 184 | } | - | ||||||||||||||||||||||||
| 185 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 186 | } | - | ||||||||||||||||||||||||
| 187 | - | |||||||||||||||||||||||||
| 188 | static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, | - | ||||||||||||||||||||||||
| 189 | const ASN1_TEMPLATE *tt, int tag, int iclass) | - | ||||||||||||||||||||||||
| 190 | { | - | ||||||||||||||||||||||||
| 191 | int i, ret, flags, ttag, tclass, ndef; | - | ||||||||||||||||||||||||
| 192 | ASN1_VALUE *tval; | - | ||||||||||||||||||||||||
| 193 | flags = tt->flags; | - | ||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||
| 196 | - | |||||||||||||||||||||||||
| 197 | - | |||||||||||||||||||||||||
| 198 | - | |||||||||||||||||||||||||
| 199 | if (flags & (0x1 << 12)
| 721182-3041410 | ||||||||||||||||||||||||
| 200 | tval = (ASN1_VALUE *)pval; | - | ||||||||||||||||||||||||
| 201 | pval = &tval; | - | ||||||||||||||||||||||||
| 202 | } executed 721182 times by 1 test: end of blockExecuted by:
| 721182 | ||||||||||||||||||||||||
| 203 | - | |||||||||||||||||||||||||
| 204 | - | |||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||
| 207 | - | |||||||||||||||||||||||||
| 208 | - | |||||||||||||||||||||||||
| 209 | - | |||||||||||||||||||||||||
| 210 | if (flags & (0x3 << 3)
| 367177-3395415 | ||||||||||||||||||||||||
| 211 | - | |||||||||||||||||||||||||
| 212 | if (tag != -1
| 0-367177 | ||||||||||||||||||||||||
| 213 | - | |||||||||||||||||||||||||
| 214 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||
| 216 | ttag = tt->tag; | - | ||||||||||||||||||||||||
| 217 | tclass = flags & (0x3<<6); | - | ||||||||||||||||||||||||
| 218 | } executed 367177 times by 1 test: else if (tag != -1end of blockExecuted by:
| 0-3395415 | ||||||||||||||||||||||||
| 219 | - | |||||||||||||||||||||||||
| 220 | ttag = tag; | - | ||||||||||||||||||||||||
| 221 | tclass = iclass & (0x3<<6); | - | ||||||||||||||||||||||||
| 222 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 223 | ttag = -1; | - | ||||||||||||||||||||||||
| 224 | tclass = 0; | - | ||||||||||||||||||||||||
| 225 | } executed 3395415 times by 2 tests: end of blockExecuted by:
| 3395415 | ||||||||||||||||||||||||
| 226 | - | |||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||
| 228 | - | |||||||||||||||||||||||||
| 229 | iclass &= ~(0x3<<6); | - | ||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||
| 231 | - | |||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||
| 233 | - | |||||||||||||||||||||||||
| 234 | - | |||||||||||||||||||||||||
| 235 | - | |||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||
| 237 | if ((
| 474-3759696 | ||||||||||||||||||||||||
| 238 | ndef = 2; executed 474 times by 1 test: ndef = 2;Executed by:
| 474 | ||||||||||||||||||||||||
| 239 | else | - | ||||||||||||||||||||||||
| 240 | ndef = 1; executed 3762118 times by 2 tests: ndef = 1;Executed by:
| 3762118 | ||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||
| 242 | if (flags & (0x3 << 1)
| 298804-3463788 | ||||||||||||||||||||||||
| 243 | - | |||||||||||||||||||||||||
| 244 | struct stack_st_ASN1_VALUE *sk = (struct stack_st_ASN1_VALUE *)*pval; | - | ||||||||||||||||||||||||
| 245 | int isset, sktag, skaclass; | - | ||||||||||||||||||||||||
| 246 | int skcontlen, sklen; | - | ||||||||||||||||||||||||
| 247 | ASN1_VALUE *skitem; | - | ||||||||||||||||||||||||
| 248 | - | |||||||||||||||||||||||||
| 249 | if (!*pval
| 23239-275565 | ||||||||||||||||||||||||
| 250 | return executed 23239 times by 1 test: 0;return 0;Executed by:
executed 23239 times by 1 test: return 0;Executed by:
| 23239 | ||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||
| 252 | if (flags & (0x1 << 1)
| 31044-244521 | ||||||||||||||||||||||||
| 253 | isset = 1; | - | ||||||||||||||||||||||||
| 254 | - | |||||||||||||||||||||||||
| 255 | if (flags & (0x2 << 1)
| 210-244311 | ||||||||||||||||||||||||
| 256 | isset = 2; executed 210 times by 1 test: isset = 2;Executed by:
| 210 | ||||||||||||||||||||||||
| 257 | } executed 244521 times by 1 test: elseend of blockExecuted by:
| 244521 | ||||||||||||||||||||||||
| 258 | isset = 0; executed 31044 times by 1 test: isset = 0;Executed by:
| 31044 | ||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||
| 264 | if ((
| 116-266338 | ||||||||||||||||||||||||
| 265 | sktag = ttag; | - | ||||||||||||||||||||||||
| 266 | skaclass = tclass; | - | ||||||||||||||||||||||||
| 267 | } executed 9111 times by 1 test: else {end of blockExecuted by:
| 9111 | ||||||||||||||||||||||||
| 268 | skaclass = 0x00; | - | ||||||||||||||||||||||||
| 269 | if (isset
| 27024-239430 | ||||||||||||||||||||||||
| 270 | sktag = 17; executed 239430 times by 1 test: sktag = 17;Executed by:
| 239430 | ||||||||||||||||||||||||
| 271 | else | - | ||||||||||||||||||||||||
| 272 | sktag = 16; executed 27024 times by 1 test: sktag = 16;Executed by:
| 27024 | ||||||||||||||||||||||||
| 273 | } | - | ||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||
| 276 | skcontlen = 0; | - | ||||||||||||||||||||||||
| 277 | for (i = 0; i < sk_ASN1_VALUE_num(sk)
| 275565-780284 | ||||||||||||||||||||||||
| 278 | int tmplen; | - | ||||||||||||||||||||||||
| 279 | skitem = sk_ASN1_VALUE_value(sk, i); | - | ||||||||||||||||||||||||
| 280 | tmplen = ASN1_item_ex_i2d(&skitem, | - | ||||||||||||||||||||||||
| 281 | ((void *)0) | - | ||||||||||||||||||||||||
| 282 | , (tt->item), | - | ||||||||||||||||||||||||
| 283 | -1, iclass); | - | ||||||||||||||||||||||||
| 284 | if (tmplen == -1
| 0-780284 | ||||||||||||||||||||||||
| 285 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 286 | skcontlen += tmplen; | - | ||||||||||||||||||||||||
| 287 | } executed 780284 times by 1 test: end of blockExecuted by:
| 780284 | ||||||||||||||||||||||||
| 288 | sklen = ASN1_object_size(ndef, skcontlen, sktag); | - | ||||||||||||||||||||||||
| 289 | if (sklen == -1
| 0-275565 | ||||||||||||||||||||||||
| 290 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||
| 292 | if (flags & (0x2 << 3)
| 116-275449 | ||||||||||||||||||||||||
| 293 | ret = ASN1_object_size(ndef, sklen, ttag); executed 116 times by 1 test: ret = ASN1_object_size(ndef, sklen, ttag);Executed by:
| 116 | ||||||||||||||||||||||||
| 294 | else | - | ||||||||||||||||||||||||
| 295 | ret = sklen; executed 275449 times by 1 test: ret = sklen;Executed by:
| 275449 | ||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||
| 297 | if (!out
| 0-162969 | ||||||||||||||||||||||||
| 298 | return executed 162969 times by 1 test: ret;return ret;Executed by:
executed 162969 times by 1 test: return ret;Executed by:
| 162969 | ||||||||||||||||||||||||
| 299 | - | |||||||||||||||||||||||||
| 300 | - | |||||||||||||||||||||||||
| 301 | - | |||||||||||||||||||||||||
| 302 | if (flags & (0x2 << 3)
| 35-112561 | ||||||||||||||||||||||||
| 303 | ASN1_put_object(out, ndef, sklen, ttag, tclass); executed 35 times by 1 test: ASN1_put_object(out, ndef, sklen, ttag, tclass);Executed by:
| 35 | ||||||||||||||||||||||||
| 304 | - | |||||||||||||||||||||||||
| 305 | ASN1_put_object(out, ndef, skcontlen, sktag, skaclass); | - | ||||||||||||||||||||||||
| 306 | - | |||||||||||||||||||||||||
| 307 | asn1_set_seq_out(sk, out, skcontlen, (tt->item), | - | ||||||||||||||||||||||||
| 308 | isset, iclass); | - | ||||||||||||||||||||||||
| 309 | if (ndef == 2
| 0-112596 | ||||||||||||||||||||||||
| 310 | ASN1_put_eoc(out); | - | ||||||||||||||||||||||||
| 311 | if (flags & (0x2 << 3)
| 0 | ||||||||||||||||||||||||
| 312 | ASN1_put_eoc(out); never executed: ASN1_put_eoc(out); | 0 | ||||||||||||||||||||||||
| 313 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||
| 315 | return executed 112596 times by 1 test: ret;return ret;Executed by:
executed 112596 times by 1 test: return ret;Executed by:
| 112596 | ||||||||||||||||||||||||
| 316 | } | - | ||||||||||||||||||||||||
| 317 | - | |||||||||||||||||||||||||
| 318 | if (flags & (0x2 << 3)
| 234511-3229277 | ||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||
| 321 | i = ASN1_item_ex_i2d(pval, | - | ||||||||||||||||||||||||
| 322 | ((void *)0) | - | ||||||||||||||||||||||||
| 323 | , (tt->item), -1, iclass); | - | ||||||||||||||||||||||||
| 324 | if (!i
| 66575-167936 | ||||||||||||||||||||||||
| 325 | return executed 167936 times by 1 test: 0;return 0;Executed by:
executed 167936 times by 1 test: return 0;Executed by:
| 167936 | ||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | ret = ASN1_object_size(ndef, i, ttag); | - | ||||||||||||||||||||||||
| 328 | if (out
| 0-46990 | ||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||
| 330 | ASN1_put_object(out, ndef, i, ttag, tclass); | - | ||||||||||||||||||||||||
| 331 | ASN1_item_ex_i2d(pval, out, (tt->item), -1, iclass); | - | ||||||||||||||||||||||||
| 332 | if (ndef == 2
| 124-19461 | ||||||||||||||||||||||||
| 333 | ASN1_put_eoc(out); executed 124 times by 1 test: ASN1_put_eoc(out);Executed by:
| 124 | ||||||||||||||||||||||||
| 334 | } executed 19585 times by 1 test: end of blockExecuted by:
| 19585 | ||||||||||||||||||||||||
| 335 | return executed 66575 times by 1 test: ret;return ret;Executed by:
executed 66575 times by 1 test: return ret;Executed by:
| 66575 | ||||||||||||||||||||||||
| 336 | } | - | ||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||
| 338 | - | |||||||||||||||||||||||||
| 339 | return executed 3229277 times by 2 tests: ASN1_item_ex_i2d(pval, out, (tt->item),return ASN1_item_ex_i2d(pval, out, (tt->item), ttag, tclass | iclass);Executed by:
executed 3229277 times by 2 tests: return ASN1_item_ex_i2d(pval, out, (tt->item), ttag, tclass | iclass);Executed by:
| 3229277 | ||||||||||||||||||||||||
| 340 | ttag, tclass | iclass); executed 3229277 times by 2 tests: return ASN1_item_ex_i2d(pval, out, (tt->item), ttag, tclass | iclass);Executed by:
| 3229277 | ||||||||||||||||||||||||
| 341 | - | |||||||||||||||||||||||||
| 342 | } | - | ||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||
| 346 | typedef struct { | - | ||||||||||||||||||||||||
| 347 | unsigned char *data; | - | ||||||||||||||||||||||||
| 348 | int length; | - | ||||||||||||||||||||||||
| 349 | ASN1_VALUE *field; | - | ||||||||||||||||||||||||
| 350 | } DER_ENC; | - | ||||||||||||||||||||||||
| 351 | - | |||||||||||||||||||||||||
| 352 | static int der_cmp(const void *a, const void *b) | - | ||||||||||||||||||||||||
| 353 | { | - | ||||||||||||||||||||||||
| 354 | const DER_ENC *d1 = a, *d2 = b; | - | ||||||||||||||||||||||||
| 355 | int cmplen, i; | - | ||||||||||||||||||||||||
| 356 | cmplen = (
| 18274-340247 | ||||||||||||||||||||||||
| 357 | i = memcmp(d1->data, d2->data, cmplen); | - | ||||||||||||||||||||||||
| 358 | if (i
| 179115-179406 | ||||||||||||||||||||||||
| 359 | return executed 179406 times by 1 test: i;return i;Executed by:
executed 179406 times by 1 test: return i;Executed by:
| 179406 | ||||||||||||||||||||||||
| 360 | return executed 179115 times by 1 test: d1->length - d2->length;return d1->length - d2->length;Executed by:
executed 179115 times by 1 test: return d1->length - d2->length;Executed by:
| 179115 | ||||||||||||||||||||||||
| 361 | } | - | ||||||||||||||||||||||||
| 362 | - | |||||||||||||||||||||||||
| 363 | - | |||||||||||||||||||||||||
| 364 | - | |||||||||||||||||||||||||
| 365 | static int asn1_set_seq_out(struct stack_st_ASN1_VALUE *sk, unsigned char **out, | - | ||||||||||||||||||||||||
| 366 | int skcontlen, const ASN1_ITEM *item, | - | ||||||||||||||||||||||||
| 367 | int do_sort, int iclass) | - | ||||||||||||||||||||||||
| 368 | { | - | ||||||||||||||||||||||||
| 369 | int i; | - | ||||||||||||||||||||||||
| 370 | ASN1_VALUE *skitem; | - | ||||||||||||||||||||||||
| 371 | unsigned char *tmpdat = | - | ||||||||||||||||||||||||
| 372 | ((void *)0) | - | ||||||||||||||||||||||||
| 373 | , *p = | - | ||||||||||||||||||||||||
| 374 | ((void *)0) | - | ||||||||||||||||||||||||
| 375 | ; | - | ||||||||||||||||||||||||
| 376 | DER_ENC *derlst = | - | ||||||||||||||||||||||||
| 377 | ((void *)0) | - | ||||||||||||||||||||||||
| 378 | , *tder; | - | ||||||||||||||||||||||||
| 379 | if (do_sort
| 10188-102408 | ||||||||||||||||||||||||
| 380 | - | |||||||||||||||||||||||||
| 381 | if (sk_ASN1_VALUE_num(sk) < 2
| 4402-98006 | ||||||||||||||||||||||||
| 382 | do_sort = 0; executed 98006 times by 1 test: do_sort = 0;Executed by:
| 98006 | ||||||||||||||||||||||||
| 383 | else { | - | ||||||||||||||||||||||||
| 384 | derlst = CRYPTO_malloc(sk_ASN1_VALUE_num(sk) * sizeof(*derlst), | - | ||||||||||||||||||||||||
| 385 | __FILE__ | - | ||||||||||||||||||||||||
| 386 | , | - | ||||||||||||||||||||||||
| 387 | 384 | - | ||||||||||||||||||||||||
| 388 | ) | - | ||||||||||||||||||||||||
| 389 | ; | - | ||||||||||||||||||||||||
| 390 | if (derlst ==
| 0-4402 | ||||||||||||||||||||||||
| 391 | ((void *)0)
| 0-4402 | ||||||||||||||||||||||||
| 392 | ) | - | ||||||||||||||||||||||||
| 393 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 394 | tmpdat = CRYPTO_malloc(skcontlen, __FILE__, 387); | - | ||||||||||||||||||||||||
| 395 | if (tmpdat ==
| 0-4402 | ||||||||||||||||||||||||
| 396 | ((void *)0)
| 0-4402 | ||||||||||||||||||||||||
| 397 | ) { | - | ||||||||||||||||||||||||
| 398 | CRYPTO_free(derlst, __FILE__, 389); | - | ||||||||||||||||||||||||
| 399 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 400 | } | - | ||||||||||||||||||||||||
| 401 | } executed 4402 times by 1 test: end of blockExecuted by:
| 4402 | ||||||||||||||||||||||||
| 402 | } | - | ||||||||||||||||||||||||
| 403 | - | |||||||||||||||||||||||||
| 404 | if (!do_sort
| 4402-108194 | ||||||||||||||||||||||||
| 405 | for (i = 0; i < sk_ASN1_VALUE_num(sk)
| 108194-173283 | ||||||||||||||||||||||||
| 406 | skitem = sk_ASN1_VALUE_value(sk, i); | - | ||||||||||||||||||||||||
| 407 | ASN1_item_ex_i2d(&skitem, out, item, -1, iclass); | - | ||||||||||||||||||||||||
| 408 | } executed 173283 times by 1 test: end of blockExecuted by:
| 173283 | ||||||||||||||||||||||||
| 409 | return executed 108194 times by 1 test: 1;return 1;Executed by:
executed 108194 times by 1 test: return 1;Executed by:
| 108194 | ||||||||||||||||||||||||
| 410 | } | - | ||||||||||||||||||||||||
| 411 | p = tmpdat; | - | ||||||||||||||||||||||||
| 412 | - | |||||||||||||||||||||||||
| 413 | - | |||||||||||||||||||||||||
| 414 | for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk)
| 4402-80947 | ||||||||||||||||||||||||
| 415 | skitem = sk_ASN1_VALUE_value(sk, i); | - | ||||||||||||||||||||||||
| 416 | tder->data = p; | - | ||||||||||||||||||||||||
| 417 | tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass); | - | ||||||||||||||||||||||||
| 418 | tder->field = skitem; | - | ||||||||||||||||||||||||
| 419 | } executed 80947 times by 1 test: end of blockExecuted by:
| 80947 | ||||||||||||||||||||||||
| 420 | - | |||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||
| 422 | qsort(derlst, sk_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp); | - | ||||||||||||||||||||||||
| 423 | - | |||||||||||||||||||||||||
| 424 | p = *out; | - | ||||||||||||||||||||||||
| 425 | for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk)
| 4402-80947 | ||||||||||||||||||||||||
| 426 | memcpy(p, tder->data, tder->length); | - | ||||||||||||||||||||||||
| 427 | p += tder->length; | - | ||||||||||||||||||||||||
| 428 | } executed 80947 times by 1 test: end of blockExecuted by:
| 80947 | ||||||||||||||||||||||||
| 429 | *out = p; | - | ||||||||||||||||||||||||
| 430 | - | |||||||||||||||||||||||||
| 431 | if (do_sort == 2
| 83-4319 | ||||||||||||||||||||||||
| 432 | for (i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk)
| 83-783 | ||||||||||||||||||||||||
| 433 | ( executed 783 times by 1 test: void)sk_ASN1_VALUE_set(sk, i, tder->field);(void)sk_ASN1_VALUE_set(sk, i, tder->field);Executed by:
executed 783 times by 1 test: (void)sk_ASN1_VALUE_set(sk, i, tder->field);Executed by:
| 783 | ||||||||||||||||||||||||
| 434 | } executed 83 times by 1 test: end of blockExecuted by:
| 83 | ||||||||||||||||||||||||
| 435 | CRYPTO_free(derlst, __FILE__, 426); | - | ||||||||||||||||||||||||
| 436 | CRYPTO_free(tmpdat, __FILE__, 427); | - | ||||||||||||||||||||||||
| 437 | return executed 4402 times by 1 test: 1;return 1;Executed by:
executed 4402 times by 1 test: return 1;Executed by:
| 4402 | ||||||||||||||||||||||||
| 438 | } | - | ||||||||||||||||||||||||
| 439 | - | |||||||||||||||||||||||||
| 440 | static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, | - | ||||||||||||||||||||||||
| 441 | const ASN1_ITEM *it, int tag, int aclass) | - | ||||||||||||||||||||||||
| 442 | { | - | ||||||||||||||||||||||||
| 443 | int len; | - | ||||||||||||||||||||||||
| 444 | int utype; | - | ||||||||||||||||||||||||
| 445 | int usetag; | - | ||||||||||||||||||||||||
| 446 | int ndef = 0; | - | ||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||
| 448 | utype = it->utype; | - | ||||||||||||||||||||||||
| 449 | - | |||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||
| 451 | - | |||||||||||||||||||||||||
| 452 | - | |||||||||||||||||||||||||
| 453 | - | |||||||||||||||||||||||||
| 454 | len = asn1_ex_i2c(pval, | - | ||||||||||||||||||||||||
| 455 | ((void *)0) | - | ||||||||||||||||||||||||
| 456 | , &utype, it); | - | ||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||
| 459 | - | |||||||||||||||||||||||||
| 460 | - | |||||||||||||||||||||||||
| 461 | - | |||||||||||||||||||||||||
| 462 | - | |||||||||||||||||||||||||
| 463 | if ((
| 8940-3270707 | ||||||||||||||||||||||||
| 464 | (
| 59936-3201831 | ||||||||||||||||||||||||
| 465 | usetag = 0; executed 135210 times by 1 test: usetag = 0;Executed by:
| 135210 | ||||||||||||||||||||||||
| 466 | else | - | ||||||||||||||||||||||||
| 467 | usetag = 1; executed 3201831 times by 2 tests: usetag = 1;Executed by:
| 3201831 | ||||||||||||||||||||||||
| 468 | - | |||||||||||||||||||||||||
| 469 | - | |||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||
| 471 | if (len == -1
| 388204-2948837 | ||||||||||||||||||||||||
| 472 | return executed 388204 times by 1 test: 0;return 0;Executed by:
executed 388204 times by 1 test: return 0;Executed by:
| 388204 | ||||||||||||||||||||||||
| 473 | - | |||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||
| 475 | if (len == -2
| 570-2948267 | ||||||||||||||||||||||||
| 476 | ndef = 2; | - | ||||||||||||||||||||||||
| 477 | len = 0; | - | ||||||||||||||||||||||||
| 478 | } executed 570 times by 1 test: end of blockExecuted by:
| 570 | ||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||
| 480 | - | |||||||||||||||||||||||||
| 481 | if (tag == -1
| 27694-2921143 | ||||||||||||||||||||||||
| 482 | tag = utype; executed 2921143 times by 2 tests: tag = utype;Executed by:
| 2921143 | ||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||
| 484 | - | |||||||||||||||||||||||||
| 485 | if (out
| 694848-2253989 | ||||||||||||||||||||||||
| 486 | if (usetag
| 33749-661099 | ||||||||||||||||||||||||
| 487 | ASN1_put_object(out, ndef, len, tag, aclass); executed 661099 times by 2 tests: ASN1_put_object(out, ndef, len, tag, aclass);Executed by:
| 661099 | ||||||||||||||||||||||||
| 488 | asn1_ex_i2c(pval, *out, &utype, it); | - | ||||||||||||||||||||||||
| 489 | if (ndef
| 90-694758 | ||||||||||||||||||||||||
| 490 | ASN1_put_eoc(out); executed 90 times by 1 test: ASN1_put_eoc(out);Executed by:
| 90 | ||||||||||||||||||||||||
| 491 | else | - | ||||||||||||||||||||||||
| 492 | * executed 694758 times by 2 tests: out += len;*out += len;Executed by:
executed 694758 times by 2 tests: *out += len;Executed by:
| 694758 | ||||||||||||||||||||||||
| 493 | } | - | ||||||||||||||||||||||||
| 494 | - | |||||||||||||||||||||||||
| 495 | if (usetag
| 135210-2813627 | ||||||||||||||||||||||||
| 496 | return executed 2813627 times by 2 tests: ASN1_object_size(ndef, len, tag);return ASN1_object_size(ndef, len, tag);Executed by:
executed 2813627 times by 2 tests: return ASN1_object_size(ndef, len, tag);Executed by:
| 2813627 | ||||||||||||||||||||||||
| 497 | return executed 135210 times by 1 test: len;return len;Executed by:
executed 135210 times by 1 test: return len;Executed by:
| 135210 | ||||||||||||||||||||||||
| 498 | } | - | ||||||||||||||||||||||||
| 499 | - | |||||||||||||||||||||||||
| 500 | - | |||||||||||||||||||||||||
| 501 | - | |||||||||||||||||||||||||
| 502 | static int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, | - | ||||||||||||||||||||||||
| 503 | const ASN1_ITEM *it) | - | ||||||||||||||||||||||||
| 504 | { | - | ||||||||||||||||||||||||
| 505 | ASN1_BOOLEAN *tbool = | - | ||||||||||||||||||||||||
| 506 | ((void *)0) | - | ||||||||||||||||||||||||
| 507 | ; | - | ||||||||||||||||||||||||
| 508 | ASN1_STRING *strtmp; | - | ||||||||||||||||||||||||
| 509 | ASN1_OBJECT *otmp; | - | ||||||||||||||||||||||||
| 510 | int utype; | - | ||||||||||||||||||||||||
| 511 | const unsigned char *cont; | - | ||||||||||||||||||||||||
| 512 | unsigned char c; | - | ||||||||||||||||||||||||
| 513 | int len; | - | ||||||||||||||||||||||||
| 514 | const ASN1_PRIMITIVE_FUNCS *pf; | - | ||||||||||||||||||||||||
| 515 | pf = it->funcs; | - | ||||||||||||||||||||||||
| 516 | if (pf
| 0-3690084 | ||||||||||||||||||||||||
| 517 | return executed 341805 times by 2 tests: pf->prim_i2c(pval, cout, putype, it);return pf->prim_i2c(pval, cout, putype, it);Executed by:
executed 341805 times by 2 tests: return pf->prim_i2c(pval, cout, putype, it);Executed by:
| 341805 | ||||||||||||||||||||||||
| 518 | - | |||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||
| 520 | if ((
| 739541-2950543 | ||||||||||||||||||||||||
| 521 | || (
| 91366-2859177 | ||||||||||||||||||||||||
| 522 | if (!*pval
| 248951-3349767 | ||||||||||||||||||||||||
| 523 | return executed 248951 times by 1 test: -1;return -1;Executed by:
executed 248951 times by 1 test: return -1;Executed by:
| 248951 | ||||||||||||||||||||||||
| 524 | } executed 3349767 times by 2 tests: end of blockExecuted by:
| 3349767 | ||||||||||||||||||||||||
| 525 | - | |||||||||||||||||||||||||
| 526 | if (it->itype == 0x5
| 739541-2701592 | ||||||||||||||||||||||||
| 527 | - | |||||||||||||||||||||||||
| 528 | strtmp = (ASN1_STRING *)*pval; | - | ||||||||||||||||||||||||
| 529 | utype = strtmp->type; | - | ||||||||||||||||||||||||
| 530 | *putype = utype; | - | ||||||||||||||||||||||||
| 531 | } executed 739541 times by 1 test: else if (it->utype == -4end of blockExecuted by:
| 714522-1987070 | ||||||||||||||||||||||||
| 532 | - | |||||||||||||||||||||||||
| 533 | ASN1_TYPE *typ; | - | ||||||||||||||||||||||||
| 534 | typ = (ASN1_TYPE *)*pval; | - | ||||||||||||||||||||||||
| 535 | utype = typ->type; | - | ||||||||||||||||||||||||
| 536 | *putype = utype; | - | ||||||||||||||||||||||||
| 537 | pval = &typ->value.asn1_value; | - | ||||||||||||||||||||||||
| 538 | } executed 714522 times by 1 test: elseend of blockExecuted by:
| 714522 | ||||||||||||||||||||||||
| 539 | utype = *putype; executed 1987070 times by 2 tests: utype = *putype;Executed by:
| 1987070 | ||||||||||||||||||||||||
| 540 | - | |||||||||||||||||||||||||
| 541 | switch (utype) { | - | ||||||||||||||||||||||||
| 542 | case executed 1389267 times by 1 test: 6:case 6:Executed by:
executed 1389267 times by 1 test: case 6:Executed by:
| 1389267 | ||||||||||||||||||||||||
| 543 | otmp = (ASN1_OBJECT *)*pval; | - | ||||||||||||||||||||||||
| 544 | cont = otmp->data; | - | ||||||||||||||||||||||||
| 545 | len = otmp->length; | - | ||||||||||||||||||||||||
| 546 | if (cont ==
| 0-1389267 | ||||||||||||||||||||||||
| 547 | ((void *)0)
| 0-1389267 | ||||||||||||||||||||||||
| 548 | || len == 0
| 0-1389267 | ||||||||||||||||||||||||
| 549 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 550 | break; executed 1389267 times by 1 test: break;Executed by:
| 1389267 | ||||||||||||||||||||||||
| 551 | - | |||||||||||||||||||||||||
| 552 | case executed 181560 times by 1 test: 5:case 5:Executed by:
executed 181560 times by 1 test: case 5:Executed by:
| 181560 | ||||||||||||||||||||||||
| 553 | cont = | - | ||||||||||||||||||||||||
| 554 | ((void *)0) | - | ||||||||||||||||||||||||
| 555 | ; | - | ||||||||||||||||||||||||
| 556 | len = 0; | - | ||||||||||||||||||||||||
| 557 | break; executed 181560 times by 1 test: break;Executed by:
| 181560 | ||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||
| 559 | case executed 96883 times by 1 test: 1:case 1:Executed by:
executed 96883 times by 1 test: case 1:Executed by:
| 96883 | ||||||||||||||||||||||||
| 560 | tbool = (ASN1_BOOLEAN *)pval; | - | ||||||||||||||||||||||||
| 561 | if (*
| 14420-82463 | ||||||||||||||||||||||||
| 562 | return executed 82463 times by 1 test: -1;return -1;Executed by:
executed 82463 times by 1 test: return -1;Executed by:
| 82463 | ||||||||||||||||||||||||
| 563 | if (it->utype != -4
| 5517-8903 | ||||||||||||||||||||||||
| 564 | - | |||||||||||||||||||||||||
| 565 | - | |||||||||||||||||||||||||
| 566 | - | |||||||||||||||||||||||||
| 567 | if (*
| 1-4555 | ||||||||||||||||||||||||
| 568 | return executed 1 time by 1 test: -1;return -1;Executed by:
executed 1 time by 1 test: return -1;Executed by:
| 1 | ||||||||||||||||||||||||
| 569 | if (!*tbool
| 1839-4554 | ||||||||||||||||||||||||
| 570 | return executed 1839 times by 1 test: -1;return -1;Executed by:
executed 1839 times by 1 test: return -1;Executed by:
| 1839 | ||||||||||||||||||||||||
| 571 | } executed 7063 times by 1 test: end of blockExecuted by:
| 7063 | ||||||||||||||||||||||||
| 572 | c = (unsigned char)*tbool; | - | ||||||||||||||||||||||||
| 573 | cont = &c; | - | ||||||||||||||||||||||||
| 574 | len = 1; | - | ||||||||||||||||||||||||
| 575 | break; executed 12580 times by 1 test: break;Executed by:
| 12580 | ||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||
| 577 | case executed 309577 times by 1 test: 3:case 3:Executed by:
executed 309577 times by 1 test: case 3:Executed by:
| 309577 | ||||||||||||||||||||||||
| 578 | return executed 309577 times by 1 test: i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
executed 309577 times by 1 test: return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 309577 | ||||||||||||||||||||||||
| 579 | cout ? &cout : executed 309577 times by 1 test: return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 309577 | ||||||||||||||||||||||||
| 580 | ((void *)0) executed 309577 times by 1 test: return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 309577 | ||||||||||||||||||||||||
| 581 | ); executed 309577 times by 1 test: return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 309577 | ||||||||||||||||||||||||
| 582 | - | |||||||||||||||||||||||||
| 583 | case executed 116344 times by 1 test: 2:case 2:Executed by:
executed 116344 times by 1 test: case 2:Executed by:
| 116344 | ||||||||||||||||||||||||
| 584 | case executed 10863 times by 1 test: 10:case 10:Executed by:
executed 10863 times by 1 test: case 10:Executed by:
| 10863 | ||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||
| 586 | - | |||||||||||||||||||||||||
| 587 | - | |||||||||||||||||||||||||
| 588 | return executed 127207 times by 1 test: i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : ((void *)0) );Executed by:
executed 127207 times by 1 test: return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 127207 | ||||||||||||||||||||||||
| 589 | ((void *)0) executed 127207 times by 1 test: return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 127207 | ||||||||||||||||||||||||
| 590 | ); executed 127207 times by 1 test: return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 127207 | ||||||||||||||||||||||||
| 591 | - | |||||||||||||||||||||||||
| 592 | case executed 240812 times by 2 tests: 4:case 4:Executed by:
executed 240812 times by 2 tests: case 4:Executed by:
| 240812 | ||||||||||||||||||||||||
| 593 | case executed 41879 times by 1 test: 18:case 18:Executed by:
executed 41879 times by 1 test: case 18:Executed by:
| 41879 | ||||||||||||||||||||||||
| 594 | case executed 11684 times by 1 test: 19:case 19:Executed by:
executed 11684 times by 1 test: case 19:Executed by:
| 11684 | ||||||||||||||||||||||||
| 595 | case executed 76427 times by 1 test: 20:case 20:Executed by:
executed 76427 times by 1 test: case 20:Executed by:
| 76427 | ||||||||||||||||||||||||
| 596 | case executed 460 times by 1 test: 21:case 21:Executed by:
executed 460 times by 1 test: case 21:Executed by:
| 460 | ||||||||||||||||||||||||
| 597 | case executed 11918 times by 1 test: 22:case 22:Executed by:
executed 11918 times by 1 test: case 22:Executed by:
| 11918 | ||||||||||||||||||||||||
| 598 | case executed 4171 times by 1 test: 23:case 23:Executed by:
executed 4171 times by 1 test: case 23:Executed by:
| 4171 | ||||||||||||||||||||||||
| 599 | case executed 11892 times by 1 test: 24:case 24:Executed by:
executed 11892 times by 1 test: case 24:Executed by:
| 11892 | ||||||||||||||||||||||||
| 600 | case executed 6952 times by 1 test: 25:case 25:Executed by:
executed 6952 times by 1 test: case 25:Executed by:
| 6952 | ||||||||||||||||||||||||
| 601 | case executed 8334 times by 1 test: 26:case 26:Executed by:
executed 8334 times by 1 test: case 26:Executed by:
| 8334 | ||||||||||||||||||||||||
| 602 | case executed 7780 times by 1 test: 27:case 27:Executed by:
executed 7780 times by 1 test: case 27:Executed by:
| 7780 | ||||||||||||||||||||||||
| 603 | case executed 51715 times by 1 test: 28:case 28:Executed by:
executed 51715 times by 1 test: case 28:Executed by:
| 51715 | ||||||||||||||||||||||||
| 604 | case executed 31457 times by 1 test: 30:case 30:Executed by:
executed 31457 times by 1 test: case 30:Executed by:
| 31457 | ||||||||||||||||||||||||
| 605 | case executed 530827 times by 1 test: 12:case 12:Executed by:
executed 530827 times by 1 test: case 12:Executed by:
| 530827 | ||||||||||||||||||||||||
| 606 | case executed 85325 times by 1 test: 16:case 16:Executed by:
executed 85325 times by 1 test: case 16:Executed by:
| 85325 | ||||||||||||||||||||||||
| 607 | case executed 10772 times by 1 test: 17:case 17:Executed by:
executed 10772 times by 1 test: case 17:Executed by:
| 10772 | ||||||||||||||||||||||||
| 608 | default executed 204234 times by 1 test: :default:Executed by:
executed 204234 times by 1 test: default:Executed by:
| 204234 | ||||||||||||||||||||||||
| 609 | - | |||||||||||||||||||||||||
| 610 | strtmp = (ASN1_STRING *)*pval; | - | ||||||||||||||||||||||||
| 611 | - | |||||||||||||||||||||||||
| 612 | if ((
| 852-1335787 | ||||||||||||||||||||||||
| 613 | && (
| 192-660 | ||||||||||||||||||||||||
| 614 | if (cout
| 90-570 | ||||||||||||||||||||||||
| 615 | strtmp->data = cout; | - | ||||||||||||||||||||||||
| 616 | strtmp->length = 0; | - | ||||||||||||||||||||||||
| 617 | } executed 90 times by 1 test: end of blockExecuted by:
| 90 | ||||||||||||||||||||||||
| 618 | - | |||||||||||||||||||||||||
| 619 | return executed 660 times by 1 test: -2;return -2;Executed by:
executed 660 times by 1 test: return -2;Executed by:
| 660 | ||||||||||||||||||||||||
| 620 | } | - | ||||||||||||||||||||||||
| 621 | cont = strtmp->data; | - | ||||||||||||||||||||||||
| 622 | len = strtmp->length; | - | ||||||||||||||||||||||||
| 623 | - | |||||||||||||||||||||||||
| 624 | break; executed 1335979 times by 2 tests: break;Executed by:
| 1335979 | ||||||||||||||||||||||||
| 625 | - | |||||||||||||||||||||||||
| 626 | } | - | ||||||||||||||||||||||||
| 627 | if (cout
| 103868-2370881 | ||||||||||||||||||||||||
| 628 | memcpy(cout, cont, len); executed 444637 times by 2 tests: memcpy(cout, cont, len);Executed by:
| 444637 | ||||||||||||||||||||||||
| 629 | return executed 2919386 times by 2 tests: len;return len;Executed by:
executed 2919386 times by 2 tests: return len;Executed by:
| 2919386 | ||||||||||||||||||||||||
| 630 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |