| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/asn1/tasn_enc.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, | - | ||||||||||||||||||||||||
| 4 | const ASN1_ITEM *it, int tag, int aclass); | - | ||||||||||||||||||||||||
| 5 | static int asn1_set_seq_out(struct stack_st_ASN1_VALUE *sk, unsigned char **out, | - | ||||||||||||||||||||||||
| 6 | int skcontlen, const ASN1_ITEM *item, 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 | int | - | ||||||||||||||||||||||||
| 19 | ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it) | - | ||||||||||||||||||||||||
| 20 | { | - | ||||||||||||||||||||||||
| 21 | return never executed: asn1_item_flags_i2d(val, out, it, (0x1<<11));return asn1_item_flags_i2d(val, out, it, (0x1<<11));never executed: return asn1_item_flags_i2d(val, out, it, (0x1<<11)); | 0 | ||||||||||||||||||||||||
| 22 | } | - | ||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||
| 24 | int | - | ||||||||||||||||||||||||
| 25 | ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it) | - | ||||||||||||||||||||||||
| 26 | { | - | ||||||||||||||||||||||||
| 27 | return executed 1585 times by 12 tests: asn1_item_flags_i2d(val, out, it, 0);return asn1_item_flags_i2d(val, out, it, 0);Executed by:
executed 1585 times by 12 tests: return asn1_item_flags_i2d(val, out, it, 0);Executed by:
| 1585 | ||||||||||||||||||||||||
| 28 | } | - | ||||||||||||||||||||||||
| 29 | static int | - | ||||||||||||||||||||||||
| 30 | asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it, | - | ||||||||||||||||||||||||
| 31 | int flags) | - | ||||||||||||||||||||||||
| 32 | { | - | ||||||||||||||||||||||||
| 33 | if (out
| 193-1392 | ||||||||||||||||||||||||
| 34 | unsigned char *p, *buf; | - | ||||||||||||||||||||||||
| 35 | int len; | - | ||||||||||||||||||||||||
| 36 | len = ASN1_item_ex_i2d(&val, | - | ||||||||||||||||||||||||
| 37 | ((void *)0) | - | ||||||||||||||||||||||||
| 38 | , it, -1, flags); | - | ||||||||||||||||||||||||
| 39 | if (len <= 0
| 0-1047 | ||||||||||||||||||||||||
| 40 | return never executed: len;return len;never executed: return len; | 0 | ||||||||||||||||||||||||
| 41 | buf = malloc(len); | - | ||||||||||||||||||||||||
| 42 | if (!buf
| 0-1047 | ||||||||||||||||||||||||
| 43 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 44 | p = buf; | - | ||||||||||||||||||||||||
| 45 | ASN1_item_ex_i2d(&val, &p, it, -1, flags); | - | ||||||||||||||||||||||||
| 46 | *out = buf; | - | ||||||||||||||||||||||||
| 47 | return executed 1047 times by 11 tests: len;return len;Executed by:
executed 1047 times by 11 tests: return len;Executed by:
| 1047 | ||||||||||||||||||||||||
| 48 | } | - | ||||||||||||||||||||||||
| 49 | - | |||||||||||||||||||||||||
| 50 | return executed 538 times by 8 tests: ASN1_item_ex_i2d(&val, out, it, -1, flags);return ASN1_item_ex_i2d(&val, out, it, -1, flags);Executed by:
executed 538 times by 8 tests: return ASN1_item_ex_i2d(&val, out, it, -1, flags);Executed by:
| 538 | ||||||||||||||||||||||||
| 51 | } | - | ||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||
| 53 | - | |||||||||||||||||||||||||
| 54 | - | |||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||
| 58 | int | - | ||||||||||||||||||||||||
| 59 | ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, | - | ||||||||||||||||||||||||
| 60 | int tag, int aclass) | - | ||||||||||||||||||||||||
| 61 | { | - | ||||||||||||||||||||||||
| 62 | const ASN1_TEMPLATE *tt = | - | ||||||||||||||||||||||||
| 63 | ((void *)0) | - | ||||||||||||||||||||||||
| 64 | ; | - | ||||||||||||||||||||||||
| 65 | int i, seqcontlen, seqlen, ndef = 1; | - | ||||||||||||||||||||||||
| 66 | const ASN1_EXTERN_FUNCS *ef; | - | ||||||||||||||||||||||||
| 67 | const ASN1_AUX *aux = it->funcs; | - | ||||||||||||||||||||||||
| 68 | ASN1_aux_cb *asn1_cb = | - | ||||||||||||||||||||||||
| 69 | ((void *)0) | - | ||||||||||||||||||||||||
| 70 | ; | - | ||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | if ((
| 0-22209 | ||||||||||||||||||||||||
| 73 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||
| 75 | if (aux
| 1230-34226 | ||||||||||||||||||||||||
| 76 | asn1_cb = aux->asn1_cb; executed 5545 times by 8 tests: asn1_cb = aux->asn1_cb;Executed by:
| 5545 | ||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||
| 78 | switch (it->itype) { | - | ||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | case executed 22209 times by 13 tests: 0x0:case 0x0:Executed by:
executed 22209 times by 13 tests: case 0x0:Executed by:
| 22209 | ||||||||||||||||||||||||
| 81 | if (it->templates
| 3877-18332 | ||||||||||||||||||||||||
| 82 | return executed 3877 times by 9 tests: asn1_template_ex_i2d(pval, out, it->templates,return asn1_template_ex_i2d(pval, out, it->templates, tag, aclass);Executed by:
executed 3877 times by 9 tests: return asn1_template_ex_i2d(pval, out, it->templates, tag, aclass);Executed by:
| 3877 | ||||||||||||||||||||||||
| 83 | tag, aclass); executed 3877 times by 9 tests: return asn1_template_ex_i2d(pval, out, it->templates, tag, aclass);Executed by:
| 3877 | ||||||||||||||||||||||||
| 84 | return executed 18332 times by 12 tests: asn1_i2d_ex_primitive(pval, out, it, tag, aclass);return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);Executed by:
executed 18332 times by 12 tests: return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);Executed by:
| 18332 | ||||||||||||||||||||||||
| 85 | break; dead code: break; | - | ||||||||||||||||||||||||
| 86 | - | |||||||||||||||||||||||||
| 87 | case executed 7652 times by 8 tests: 0x5:case 0x5:Executed by:
executed 7652 times by 8 tests: case 0x5:Executed by:
| 7652 | ||||||||||||||||||||||||
| 88 | return executed 7652 times by 8 tests: asn1_i2d_ex_primitive(pval, out, it, -1, aclass);return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);Executed by:
executed 7652 times by 8 tests: return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);Executed by:
| 7652 | ||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||
| 90 | case executed 212 times by 3 tests: 0x2:case 0x2:Executed by:
executed 212 times by 3 tests: case 0x2:Executed by:
| 212 | ||||||||||||||||||||||||
| 91 | if (asn1_cb
| 0-208 | ||||||||||||||||||||||||
| 92 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||
| 93 | )
| 0-4 | ||||||||||||||||||||||||
| 94 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 95 | i = asn1_get_choice_selector(pval, it); | - | ||||||||||||||||||||||||
| 96 | if ((
| 0-212 | ||||||||||||||||||||||||
| 97 | ASN1_VALUE **pchval; | - | ||||||||||||||||||||||||
| 98 | const ASN1_TEMPLATE *chtt; | - | ||||||||||||||||||||||||
| 99 | chtt = it->templates + i; | - | ||||||||||||||||||||||||
| 100 | pchval = asn1_get_field_ptr(pval, chtt); | - | ||||||||||||||||||||||||
| 101 | return executed 212 times by 3 tests: asn1_template_ex_i2d(pchval, out, chtt,return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);Executed by:
executed 212 times by 3 tests: return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);Executed by:
| 212 | ||||||||||||||||||||||||
| 102 | -1, aclass); executed 212 times by 3 tests: return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);Executed by:
| 212 | ||||||||||||||||||||||||
| 103 | } | - | ||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||
| 105 | if (asn1_cb
| 0 | ||||||||||||||||||||||||
| 106 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 107 | )
| 0 | ||||||||||||||||||||||||
| 108 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 109 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 110 | - | |||||||||||||||||||||||||
| 111 | case executed 116 times by 3 tests: 0x4:case 0x4:Executed by:
executed 116 times by 3 tests: case 0x4:Executed by:
| 116 | ||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | ef = it->funcs; | - | ||||||||||||||||||||||||
| 114 | return executed 116 times by 3 tests: ef->asn1_ex_i2d(pval, out, it, tag, aclass);return ef->asn1_ex_i2d(pval, out, it, tag, aclass);Executed by:
executed 116 times by 3 tests: return ef->asn1_ex_i2d(pval, out, it, tag, aclass);Executed by:
| 116 | ||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||
| 116 | case executed 33 times by 1 test: 0x6:case 0x6:Executed by:
executed 33 times by 1 test: case 0x6:Executed by:
| 33 | ||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||
| 118 | if (aclass & (0x1<<11)
| 0-33 | ||||||||||||||||||||||||
| 119 | ndef = 2; never executed: ndef = 2; | 0 | ||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||
| 122 | case executed 10779 times by 11 tests: 0x1:case 0x1:Executed by:
executed 10779 times by 11 tests: case 0x1:Executed by:
code before this statement executed 33 times by 1 test: case 0x1:Executed by:
| 33-10779 | ||||||||||||||||||||||||
| 123 | i = asn1_enc_restore(&seqcontlen, out, pval, it); | - | ||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||
| 125 | if (i < 0
| 0-10812 | ||||||||||||||||||||||||
| 126 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||
| 128 | if (i > 0
| 1104-9708 | ||||||||||||||||||||||||
| 129 | return executed 1104 times by 6 tests: seqcontlen;return seqcontlen;Executed by:
executed 1104 times by 6 tests: return seqcontlen;Executed by:
| 1104 | ||||||||||||||||||||||||
| 130 | - | |||||||||||||||||||||||||
| 131 | seqcontlen = 0; | - | ||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||
| 133 | if (tag == -1
| 0-9708 | ||||||||||||||||||||||||
| 134 | tag = 16; | - | ||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||
| 136 | aclass = (aclass & ~(0x3<<6)) | | - | ||||||||||||||||||||||||
| 137 | 0x00; | - | ||||||||||||||||||||||||
| 138 | } executed 9708 times by 11 tests: end of blockExecuted by:
| 9708 | ||||||||||||||||||||||||
| 139 | if (asn1_cb
| 0-8712 | ||||||||||||||||||||||||
| 140 | ((void *)0)
| 0-996 | ||||||||||||||||||||||||
| 141 | )
| 0-996 | ||||||||||||||||||||||||
| 142 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 143 | - | |||||||||||||||||||||||||
| 144 | for (i = 0, tt = it->templates; i < it->tcount
| 9708-20563 | ||||||||||||||||||||||||
| 145 | const ASN1_TEMPLATE *seqtt; | - | ||||||||||||||||||||||||
| 146 | ASN1_VALUE **pseqval; | - | ||||||||||||||||||||||||
| 147 | seqtt = asn1_do_adb(pval, tt, 1); | - | ||||||||||||||||||||||||
| 148 | if (!seqtt
| 0-20563 | ||||||||||||||||||||||||
| 149 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 150 | pseqval = asn1_get_field_ptr(pval, seqtt); | - | ||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | seqcontlen += asn1_template_ex_i2d(pseqval, | - | ||||||||||||||||||||||||
| 153 | ((void *)0) | - | ||||||||||||||||||||||||
| 154 | , seqtt, | - | ||||||||||||||||||||||||
| 155 | -1, aclass); | - | ||||||||||||||||||||||||
| 156 | } executed 20563 times by 11 tests: end of blockExecuted by:
| 20563 | ||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||
| 158 | seqlen = ASN1_object_size(ndef, seqcontlen, tag); | - | ||||||||||||||||||||||||
| 159 | if (!out
| 3676-6032 | ||||||||||||||||||||||||
| 160 | return executed 6032 times by 11 tests: seqlen;return seqlen;Executed by:
executed 6032 times by 11 tests: return seqlen;Executed by:
| 6032 | ||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||
| 162 | ASN1_put_object(out, ndef, seqcontlen, tag, aclass); | - | ||||||||||||||||||||||||
| 163 | for (i = 0, tt = it->templates; i < it->tcount
| 3676-7877 | ||||||||||||||||||||||||
| 164 | const ASN1_TEMPLATE *seqtt; | - | ||||||||||||||||||||||||
| 165 | ASN1_VALUE **pseqval; | - | ||||||||||||||||||||||||
| 166 | seqtt = asn1_do_adb(pval, tt, 1); | - | ||||||||||||||||||||||||
| 167 | if (!seqtt
| 0-7877 | ||||||||||||||||||||||||
| 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 7877 times by 11 tests: end of blockExecuted by:
| 7877 | ||||||||||||||||||||||||
| 173 | if (ndef == 2
| 0-3676 | ||||||||||||||||||||||||
| 174 | ASN1_put_eoc(out); never executed: ASN1_put_eoc(out); | 0 | ||||||||||||||||||||||||
| 175 | if (asn1_cb
| 0-3195 | ||||||||||||||||||||||||
| 176 | ((void *)0)
| 0-481 | ||||||||||||||||||||||||
| 177 | )
| 0-481 | ||||||||||||||||||||||||
| 178 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 179 | return executed 3676 times by 11 tests: seqlen;return seqlen;Executed by:
executed 3676 times by 11 tests: return seqlen;Executed by:
| 3676 | ||||||||||||||||||||||||
| 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 | int | - | ||||||||||||||||||||||||
| 189 | ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, | - | ||||||||||||||||||||||||
| 190 | const ASN1_TEMPLATE *tt) | - | ||||||||||||||||||||||||
| 191 | { | - | ||||||||||||||||||||||||
| 192 | return never executed: asn1_template_ex_i2d(pval, out, tt, -1, 0);return asn1_template_ex_i2d(pval, out, tt, -1, 0);never executed: return asn1_template_ex_i2d(pval, out, tt, -1, 0); | 0 | ||||||||||||||||||||||||
| 193 | } | - | ||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||
| 195 | static int | - | ||||||||||||||||||||||||
| 196 | asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, | - | ||||||||||||||||||||||||
| 197 | const ASN1_TEMPLATE *tt, int tag, int iclass) | - | ||||||||||||||||||||||||
| 198 | { | - | ||||||||||||||||||||||||
| 199 | int i, ret, flags, ttag, tclass, ndef; | - | ||||||||||||||||||||||||
| 200 | flags = tt->flags; | - | ||||||||||||||||||||||||
| 201 | - | |||||||||||||||||||||||||
| 202 | - | |||||||||||||||||||||||||
| 203 | - | |||||||||||||||||||||||||
| 204 | - | |||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||
| 207 | if (flags & (0x3 << 3)
| 210-32319 | ||||||||||||||||||||||||
| 208 | - | |||||||||||||||||||||||||
| 209 | if (tag != -1
| 0-210 | ||||||||||||||||||||||||
| 210 | - | |||||||||||||||||||||||||
| 211 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 212 | - | |||||||||||||||||||||||||
| 213 | ttag = tt->tag; | - | ||||||||||||||||||||||||
| 214 | tclass = flags & (0x3<<6); | - | ||||||||||||||||||||||||
| 215 | } executed 210 times by 3 tests: else if (tag != -1end of blockExecuted by:
| 0-32319 | ||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | ttag = tag; | - | ||||||||||||||||||||||||
| 218 | tclass = iclass & (0x3<<6); | - | ||||||||||||||||||||||||
| 219 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 220 | ttag = -1; | - | ||||||||||||||||||||||||
| 221 | tclass = 0; | - | ||||||||||||||||||||||||
| 222 | } executed 32319 times by 12 tests: end of blockExecuted by:
| 32319 | ||||||||||||||||||||||||
| 223 | - | |||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | iclass &= ~(0x3<<6); | - | ||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||
| 228 | - | |||||||||||||||||||||||||
| 229 | - | |||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||
| 231 | - | |||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||
| 233 | - | |||||||||||||||||||||||||
| 234 | if ((
| 0-32508 | ||||||||||||||||||||||||
| 235 | ndef = 2; never executed: ndef = 2; | 0 | ||||||||||||||||||||||||
| 236 | else | - | ||||||||||||||||||||||||
| 237 | ndef = 1; executed 32529 times by 12 tests: ndef = 1;Executed by:
| 32529 | ||||||||||||||||||||||||
| 238 | - | |||||||||||||||||||||||||
| 239 | if (flags & (0x3 << 1)
| 4103-28426 | ||||||||||||||||||||||||
| 240 | - | |||||||||||||||||||||||||
| 241 | struct stack_st_ASN1_VALUE *sk = (struct stack_st_ASN1_VALUE *)*pval; | - | ||||||||||||||||||||||||
| 242 | int isset, sktag, skaclass; | - | ||||||||||||||||||||||||
| 243 | int skcontlen, sklen; | - | ||||||||||||||||||||||||
| 244 | ASN1_VALUE *skitem; | - | ||||||||||||||||||||||||
| 245 | - | |||||||||||||||||||||||||
| 246 | if (!*pval
| 51-4052 | ||||||||||||||||||||||||
| 247 | return executed 51 times by 4 tests: 0;return 0;Executed by:
executed 51 times by 4 tests: return 0;Executed by:
| 51 | ||||||||||||||||||||||||
| 248 | - | |||||||||||||||||||||||||
| 249 | if (flags & (0x1 << 1)
| 112-3940 | ||||||||||||||||||||||||
| 250 | isset = 1; | - | ||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||
| 252 | if (flags & (0x2 << 1)
| 4-3936 | ||||||||||||||||||||||||
| 253 | isset = 2; executed 4 times by 1 test: isset = 2;Executed by:
| 4 | ||||||||||||||||||||||||
| 254 | } executed 3940 times by 8 tests: elseend of blockExecuted by:
| 3940 | ||||||||||||||||||||||||
| 255 | isset = 0; executed 112 times by 3 tests: isset = 0;Executed by:
| 112 | ||||||||||||||||||||||||
| 256 | - | |||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||
| 260 | if ((
| 0-4024 | ||||||||||||||||||||||||
| 261 | sktag = ttag; | - | ||||||||||||||||||||||||
| 262 | skaclass = tclass; | - | ||||||||||||||||||||||||
| 263 | } executed 28 times by 1 test: else {end of blockExecuted by:
| 28 | ||||||||||||||||||||||||
| 264 | skaclass = 0x00; | - | ||||||||||||||||||||||||
| 265 | if (isset
| 84-3940 | ||||||||||||||||||||||||
| 266 | sktag = 17; executed 3940 times by 8 tests: sktag = 17;Executed by:
| 3940 | ||||||||||||||||||||||||
| 267 | else | - | ||||||||||||||||||||||||
| 268 | sktag = 16; executed 84 times by 3 tests: sktag = 16;Executed by:
| 84 | ||||||||||||||||||||||||
| 269 | } | - | ||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||
| 272 | skcontlen = 0; | - | ||||||||||||||||||||||||
| 273 | for (i = 0; i < sk_num(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)))
| 4052-4201 | ||||||||||||||||||||||||
| 274 | skitem = ((ASN1_VALUE *)sk_value(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)), (i))); | - | ||||||||||||||||||||||||
| 275 | skcontlen += ASN1_item_ex_i2d(&skitem, | - | ||||||||||||||||||||||||
| 276 | ((void *)0) | - | ||||||||||||||||||||||||
| 277 | , | - | ||||||||||||||||||||||||
| 278 | tt->item, -1, iclass); | - | ||||||||||||||||||||||||
| 279 | } executed 4201 times by 8 tests: end of blockExecuted by:
| 4201 | ||||||||||||||||||||||||
| 280 | sklen = ASN1_object_size(ndef, skcontlen, sktag); | - | ||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||
| 282 | if (flags & (0x2 << 3)
| 0-4052 | ||||||||||||||||||||||||
| 283 | ret = ASN1_object_size(ndef, sklen, ttag); never executed: ret = ASN1_object_size(ndef, sklen, ttag); | 0 | ||||||||||||||||||||||||
| 284 | else | - | ||||||||||||||||||||||||
| 285 | ret = sklen; executed 4052 times by 8 tests: ret = sklen;Executed by:
| 4052 | ||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | if (!out
| 1950-2102 | ||||||||||||||||||||||||
| 288 | return executed 2102 times by 8 tests: ret;return ret;Executed by:
executed 2102 times by 8 tests: return ret;Executed by:
| 2102 | ||||||||||||||||||||||||
| 289 | - | |||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||
| 292 | if (flags & (0x2 << 3)
| 0-1950 | ||||||||||||||||||||||||
| 293 | ASN1_put_object(out, ndef, sklen, ttag, tclass); never executed: ASN1_put_object(out, ndef, sklen, ttag, tclass); | 0 | ||||||||||||||||||||||||
| 294 | - | |||||||||||||||||||||||||
| 295 | ASN1_put_object(out, ndef, skcontlen, sktag, skaclass); | - | ||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||
| 297 | asn1_set_seq_out(sk, out, skcontlen, tt->item, | - | ||||||||||||||||||||||||
| 298 | isset, iclass); | - | ||||||||||||||||||||||||
| 299 | if (ndef == 2
| 0-1950 | ||||||||||||||||||||||||
| 300 | ASN1_put_eoc(out); | - | ||||||||||||||||||||||||
| 301 | if (flags & (0x2 << 3)
| 0 | ||||||||||||||||||||||||
| 302 | ASN1_put_eoc(out); never executed: ASN1_put_eoc(out); | 0 | ||||||||||||||||||||||||
| 303 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 304 | - | |||||||||||||||||||||||||
| 305 | return executed 1950 times by 8 tests: ret;return ret;Executed by:
executed 1950 times by 8 tests: return ret;Executed by:
| 1950 | ||||||||||||||||||||||||
| 306 | } | - | ||||||||||||||||||||||||
| 307 | - | |||||||||||||||||||||||||
| 308 | if (flags & (0x2 << 3)
| 35-28391 | ||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | i = ASN1_item_ex_i2d(pval, | - | ||||||||||||||||||||||||
| 312 | ((void *)0) | - | ||||||||||||||||||||||||
| 313 | , tt->item, | - | ||||||||||||||||||||||||
| 314 | -1, iclass); | - | ||||||||||||||||||||||||
| 315 | if (!i
| 15-20 | ||||||||||||||||||||||||
| 316 | return executed 20 times by 2 tests: 0;return 0;Executed by:
executed 20 times by 2 tests: return 0;Executed by:
| 20 | ||||||||||||||||||||||||
| 317 | - | |||||||||||||||||||||||||
| 318 | ret = ASN1_object_size(ndef, i, ttag); | - | ||||||||||||||||||||||||
| 319 | if (out
| 4-11 | ||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||
| 321 | ASN1_put_object(out, ndef, i, ttag, tclass); | - | ||||||||||||||||||||||||
| 322 | ASN1_item_ex_i2d(pval, out, tt->item, | - | ||||||||||||||||||||||||
| 323 | -1, iclass); | - | ||||||||||||||||||||||||
| 324 | if (ndef == 2
| 0-4 | ||||||||||||||||||||||||
| 325 | ASN1_put_eoc(out); never executed: ASN1_put_eoc(out); | 0 | ||||||||||||||||||||||||
| 326 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 327 | return executed 15 times by 1 test: ret;return ret;Executed by:
executed 15 times by 1 test: return ret;Executed by:
| 15 | ||||||||||||||||||||||||
| 328 | } | - | ||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||
| 331 | return executed 28391 times by 11 tests: ASN1_item_ex_i2d(pval, out, tt->item,return ASN1_item_ex_i2d(pval, out, tt->item, ttag, tclass | iclass);Executed by:
executed 28391 times by 11 tests: return ASN1_item_ex_i2d(pval, out, tt->item, ttag, tclass | iclass);Executed by:
| 28391 | ||||||||||||||||||||||||
| 332 | ttag, tclass | iclass); executed 28391 times by 11 tests: return ASN1_item_ex_i2d(pval, out, tt->item, ttag, tclass | iclass);Executed by:
| 28391 | ||||||||||||||||||||||||
| 333 | } | - | ||||||||||||||||||||||||
| 334 | - | |||||||||||||||||||||||||
| 335 | - | |||||||||||||||||||||||||
| 336 | - | |||||||||||||||||||||||||
| 337 | typedef struct { | - | ||||||||||||||||||||||||
| 338 | unsigned char *data; | - | ||||||||||||||||||||||||
| 339 | int length; | - | ||||||||||||||||||||||||
| 340 | ASN1_VALUE *field; | - | ||||||||||||||||||||||||
| 341 | } DER_ENC; | - | ||||||||||||||||||||||||
| 342 | - | |||||||||||||||||||||||||
| 343 | static int | - | ||||||||||||||||||||||||
| 344 | der_cmp(const void *a, const void *b) | - | ||||||||||||||||||||||||
| 345 | { | - | ||||||||||||||||||||||||
| 346 | const DER_ENC *d1 = a, *d2 = b; | - | ||||||||||||||||||||||||
| 347 | int cmplen, i; | - | ||||||||||||||||||||||||
| 348 | - | |||||||||||||||||||||||||
| 349 | cmplen = (
| 4-6 | ||||||||||||||||||||||||
| 350 | i = memcmp(d1->data, d2->data, cmplen); | - | ||||||||||||||||||||||||
| 351 | if (i
| 0-10 | ||||||||||||||||||||||||
| 352 | return executed 10 times by 1 test: i;return i;Executed by:
executed 10 times by 1 test: return i;Executed by:
| 10 | ||||||||||||||||||||||||
| 353 | return never executed: d1->length - d2->length;return d1->length - d2->length;never executed: return d1->length - d2->length; | 0 | ||||||||||||||||||||||||
| 354 | } | - | ||||||||||||||||||||||||
| 355 | - | |||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||
| 358 | static int | - | ||||||||||||||||||||||||
| 359 | asn1_set_seq_out(struct stack_st_ASN1_VALUE *sk, unsigned char **out, int skcontlen, | - | ||||||||||||||||||||||||
| 360 | const ASN1_ITEM *item, int do_sort, int iclass) | - | ||||||||||||||||||||||||
| 361 | { | - | ||||||||||||||||||||||||
| 362 | int i; | - | ||||||||||||||||||||||||
| 363 | ASN1_VALUE *skitem; | - | ||||||||||||||||||||||||
| 364 | unsigned char *tmpdat = | - | ||||||||||||||||||||||||
| 365 | ((void *)0) | - | ||||||||||||||||||||||||
| 366 | , *p = | - | ||||||||||||||||||||||||
| 367 | ((void *)0) | - | ||||||||||||||||||||||||
| 368 | ; | - | ||||||||||||||||||||||||
| 369 | DER_ENC *derlst = | - | ||||||||||||||||||||||||
| 370 | ((void *)0) | - | ||||||||||||||||||||||||
| 371 | , *tder; | - | ||||||||||||||||||||||||
| 372 | - | |||||||||||||||||||||||||
| 373 | if (do_sort
| 48-1902 | ||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||
| 375 | if (sk_num(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0))) < 2
| 2-1900 | ||||||||||||||||||||||||
| 376 | do_sort = 0; executed 1900 times by 8 tests: do_sort = 0;Executed by:
| 1900 | ||||||||||||||||||||||||
| 377 | else { | - | ||||||||||||||||||||||||
| 378 | derlst = reallocarray( | - | ||||||||||||||||||||||||
| 379 | ((void *)0) | - | ||||||||||||||||||||||||
| 380 | , sk_num(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0))), | - | ||||||||||||||||||||||||
| 381 | sizeof(*derlst)); | - | ||||||||||||||||||||||||
| 382 | tmpdat = malloc(skcontlen); | - | ||||||||||||||||||||||||
| 383 | if (!derlst
| 0-2 | ||||||||||||||||||||||||
| 384 | free(derlst); | - | ||||||||||||||||||||||||
| 385 | free(tmpdat); | - | ||||||||||||||||||||||||
| 386 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 387 | } | - | ||||||||||||||||||||||||
| 388 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 389 | } | - | ||||||||||||||||||||||||
| 390 | - | |||||||||||||||||||||||||
| 391 | if (!do_sort
| 2-1948 | ||||||||||||||||||||||||
| 392 | for (i = 0; i < sk_num(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)))
| 1948-2000 | ||||||||||||||||||||||||
| 393 | skitem = ((ASN1_VALUE *)sk_value(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)), (i))); | - | ||||||||||||||||||||||||
| 394 | ASN1_item_ex_i2d(&skitem, out, item, -1, iclass); | - | ||||||||||||||||||||||||
| 395 | } executed 2000 times by 8 tests: end of blockExecuted by:
| 2000 | ||||||||||||||||||||||||
| 396 | return executed 1948 times by 8 tests: 1;return 1;Executed by:
executed 1948 times by 8 tests: return 1;Executed by:
| 1948 | ||||||||||||||||||||||||
| 397 | } | - | ||||||||||||||||||||||||
| 398 | p = tmpdat; | - | ||||||||||||||||||||||||
| 399 | - | |||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||
| 401 | for (i = 0, tder = derlst; i < sk_num(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)))
| 2-8 | ||||||||||||||||||||||||
| 402 | skitem = ((ASN1_VALUE *)sk_value(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)), (i))); | - | ||||||||||||||||||||||||
| 403 | tder->data = p; | - | ||||||||||||||||||||||||
| 404 | tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass); | - | ||||||||||||||||||||||||
| 405 | tder->field = skitem; | - | ||||||||||||||||||||||||
| 406 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||
| 408 | - | |||||||||||||||||||||||||
| 409 | qsort(derlst, sk_num(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0))), sizeof(*derlst), der_cmp); | - | ||||||||||||||||||||||||
| 410 | - | |||||||||||||||||||||||||
| 411 | p = *out; | - | ||||||||||||||||||||||||
| 412 | for (i = 0, tder = derlst; i < sk_num(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)))
| 2-8 | ||||||||||||||||||||||||
| 413 | memcpy(p, tder->data, tder->length); | - | ||||||||||||||||||||||||
| 414 | p += tder->length; | - | ||||||||||||||||||||||||
| 415 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 416 | *out = p; | - | ||||||||||||||||||||||||
| 417 | - | |||||||||||||||||||||||||
| 418 | if (do_sort == 2
| 0-2 | ||||||||||||||||||||||||
| 419 | for (i = 0, tder = derlst; i < sk_num(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)))
| 2-8 | ||||||||||||||||||||||||
| 420 | ( executed 8 times by 1 test: void)sk_set(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)), (i), ((void*) (1 ? (tder->field) : (ASN1_VALUE*)0)));(void)sk_set(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)), (i), ((void*) (1 ? (tder->field) : (ASN1_VALUE*)0)));Executed by:
executed 8 times by 1 test: (void)sk_set(((_STACK*) (1 ? (sk) : (struct stack_st_ASN1_VALUE*)0)), (i), ((void*) (1 ? (tder->field) : (ASN1_VALUE*)0)));Executed by:
| 8 | ||||||||||||||||||||||||
| 421 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 422 | free(derlst); | - | ||||||||||||||||||||||||
| 423 | free(tmpdat); | - | ||||||||||||||||||||||||
| 424 | return executed 2 times by 1 test: 1;return 1;Executed by:
executed 2 times by 1 test: return 1;Executed by:
| 2 | ||||||||||||||||||||||||
| 425 | } | - | ||||||||||||||||||||||||
| 426 | - | |||||||||||||||||||||||||
| 427 | static int | - | ||||||||||||||||||||||||
| 428 | asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, | - | ||||||||||||||||||||||||
| 429 | const ASN1_ITEM *it, int tag, int aclass) | - | ||||||||||||||||||||||||
| 430 | { | - | ||||||||||||||||||||||||
| 431 | int len; | - | ||||||||||||||||||||||||
| 432 | int utype; | - | ||||||||||||||||||||||||
| 433 | int usetag; | - | ||||||||||||||||||||||||
| 434 | int ndef = 0; | - | ||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||
| 436 | utype = it->utype; | - | ||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||
| 438 | - | |||||||||||||||||||||||||
| 439 | - | |||||||||||||||||||||||||
| 440 | - | |||||||||||||||||||||||||
| 441 | - | |||||||||||||||||||||||||
| 442 | len = asn1_ex_i2c(pval, | - | ||||||||||||||||||||||||
| 443 | ((void *)0) | - | ||||||||||||||||||||||||
| 444 | , &utype, it); | - | ||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||
| 446 | - | |||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||
| 448 | - | |||||||||||||||||||||||||
| 449 | - | |||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||
| 451 | - | |||||||||||||||||||||||||
| 452 | if ((
| 0-25929 | ||||||||||||||||||||||||
| 453 | (
| 0-25929 | ||||||||||||||||||||||||
| 454 | usetag = 0; executed 55 times by 2 tests: usetag = 0;Executed by:
| 55 | ||||||||||||||||||||||||
| 455 | else | - | ||||||||||||||||||||||||
| 456 | usetag = 1; executed 25929 times by 12 tests: usetag = 1;Executed by:
| 25929 | ||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||
| 459 | if (len == -1
| 515-25469 | ||||||||||||||||||||||||
| 460 | return executed 515 times by 3 tests: 0;return 0;Executed by:
executed 515 times by 3 tests: return 0;Executed by:
| 515 | ||||||||||||||||||||||||
| 461 | - | |||||||||||||||||||||||||
| 462 | - | |||||||||||||||||||||||||
| 463 | if (len == -2
| 0-25469 | ||||||||||||||||||||||||
| 464 | ndef = 2; | - | ||||||||||||||||||||||||
| 465 | len = 0; | - | ||||||||||||||||||||||||
| 466 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 467 | - | |||||||||||||||||||||||||
| 468 | - | |||||||||||||||||||||||||
| 469 | if (tag == -1
| 78-25391 | ||||||||||||||||||||||||
| 470 | tag = utype; executed 25391 times by 12 tests: tag = utype;Executed by:
| 25391 | ||||||||||||||||||||||||
| 471 | - | |||||||||||||||||||||||||
| 472 | - | |||||||||||||||||||||||||
| 473 | if (out
| 6910-18559 | ||||||||||||||||||||||||
| 474 | if (usetag
| 9-6901 | ||||||||||||||||||||||||
| 475 | ASN1_put_object(out, ndef, len, tag, aclass); executed 6901 times by 12 tests: ASN1_put_object(out, ndef, len, tag, aclass);Executed by:
| 6901 | ||||||||||||||||||||||||
| 476 | asn1_ex_i2c(pval, *out, &utype, it); | - | ||||||||||||||||||||||||
| 477 | if (ndef
| 0-6910 | ||||||||||||||||||||||||
| 478 | ASN1_put_eoc(out); never executed: ASN1_put_eoc(out); | 0 | ||||||||||||||||||||||||
| 479 | else | - | ||||||||||||||||||||||||
| 480 | * executed 6910 times by 12 tests: out += len;*out += len;Executed by:
executed 6910 times by 12 tests: *out += len;Executed by:
| 6910 | ||||||||||||||||||||||||
| 481 | } | - | ||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||
| 483 | if (usetag
| 55-25414 | ||||||||||||||||||||||||
| 484 | return executed 25414 times by 12 tests: ASN1_object_size(ndef, len, tag);return ASN1_object_size(ndef, len, tag);Executed by:
executed 25414 times by 12 tests: return ASN1_object_size(ndef, len, tag);Executed by:
| 25414 | ||||||||||||||||||||||||
| 485 | return executed 55 times by 2 tests: len;return len;Executed by:
executed 55 times by 2 tests: return len;Executed by:
| 55 | ||||||||||||||||||||||||
| 486 | } | - | ||||||||||||||||||||||||
| 487 | - | |||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||
| 489 | - | |||||||||||||||||||||||||
| 490 | static int | - | ||||||||||||||||||||||||
| 491 | asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, | - | ||||||||||||||||||||||||
| 492 | const ASN1_ITEM *it) | - | ||||||||||||||||||||||||
| 493 | { | - | ||||||||||||||||||||||||
| 494 | ASN1_BOOLEAN *tbool = | - | ||||||||||||||||||||||||
| 495 | ((void *)0) | - | ||||||||||||||||||||||||
| 496 | ; | - | ||||||||||||||||||||||||
| 497 | ASN1_STRING *strtmp; | - | ||||||||||||||||||||||||
| 498 | ASN1_OBJECT *otmp; | - | ||||||||||||||||||||||||
| 499 | int utype; | - | ||||||||||||||||||||||||
| 500 | const unsigned char *cont; | - | ||||||||||||||||||||||||
| 501 | unsigned char c; | - | ||||||||||||||||||||||||
| 502 | int len; | - | ||||||||||||||||||||||||
| 503 | const ASN1_PRIMITIVE_FUNCS *pf; | - | ||||||||||||||||||||||||
| 504 | - | |||||||||||||||||||||||||
| 505 | pf = it->funcs; | - | ||||||||||||||||||||||||
| 506 | if (pf
| 0-26806 | ||||||||||||||||||||||||
| 507 | return executed 6088 times by 4 tests: pf->prim_i2c(pval, cout, putype, it);return pf->prim_i2c(pval, cout, putype, it);Executed by:
executed 6088 times by 4 tests: return pf->prim_i2c(pval, cout, putype, it);Executed by:
| 6088 | ||||||||||||||||||||||||
| 508 | - | |||||||||||||||||||||||||
| 509 | - | |||||||||||||||||||||||||
| 510 | if ((
| 9564-17242 | ||||||||||||||||||||||||
| 511 | (
| 0-17242 | ||||||||||||||||||||||||
| 512 | if (!*pval
| 137-26669 | ||||||||||||||||||||||||
| 513 | return executed 137 times by 2 tests: -1;return -1;Executed by:
executed 137 times by 2 tests: return -1;Executed by:
| 137 | ||||||||||||||||||||||||
| 514 | } executed 26669 times by 11 tests: end of blockExecuted by:
| 26669 | ||||||||||||||||||||||||
| 515 | - | |||||||||||||||||||||||||
| 516 | if (it->itype == 0x5
| 9564-17105 | ||||||||||||||||||||||||
| 517 | - | |||||||||||||||||||||||||
| 518 | strtmp = (ASN1_STRING *)*pval; | - | ||||||||||||||||||||||||
| 519 | utype = strtmp->type; | - | ||||||||||||||||||||||||
| 520 | *putype = utype; | - | ||||||||||||||||||||||||
| 521 | } executed 9564 times by 8 tests: else if (it->utype == -4end of blockExecuted by:
| 2627-14478 | ||||||||||||||||||||||||
| 522 | - | |||||||||||||||||||||||||
| 523 | ASN1_TYPE *typ; | - | ||||||||||||||||||||||||
| 524 | typ = (ASN1_TYPE *)*pval; | - | ||||||||||||||||||||||||
| 525 | utype = typ->type; | - | ||||||||||||||||||||||||
| 526 | *putype = utype; | - | ||||||||||||||||||||||||
| 527 | pval = &typ->value.asn1_value; | - | ||||||||||||||||||||||||
| 528 | } executed 2627 times by 6 tests: elseend of blockExecuted by:
| 2627 | ||||||||||||||||||||||||
| 529 | utype = *putype; executed 14478 times by 11 tests: utype = *putype;Executed by:
| 14478 | ||||||||||||||||||||||||
| 530 | - | |||||||||||||||||||||||||
| 531 | switch (utype) { | - | ||||||||||||||||||||||||
| 532 | case executed 12313 times by 8 tests: 6:case 6:Executed by:
executed 12313 times by 8 tests: case 6:Executed by:
| 12313 | ||||||||||||||||||||||||
| 533 | otmp = (ASN1_OBJECT *)*pval; | - | ||||||||||||||||||||||||
| 534 | cont = otmp->data; | - | ||||||||||||||||||||||||
| 535 | len = otmp->length; | - | ||||||||||||||||||||||||
| 536 | break; executed 12313 times by 8 tests: break;Executed by:
| 12313 | ||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||
| 538 | case executed 2387 times by 6 tests: 5:case 5:Executed by:
executed 2387 times by 6 tests: case 5:Executed by:
| 2387 | ||||||||||||||||||||||||
| 539 | cont = | - | ||||||||||||||||||||||||
| 540 | ((void *)0) | - | ||||||||||||||||||||||||
| 541 | ; | - | ||||||||||||||||||||||||
| 542 | len = 0; | - | ||||||||||||||||||||||||
| 543 | break; executed 2387 times by 6 tests: break;Executed by:
| 2387 | ||||||||||||||||||||||||
| 544 | - | |||||||||||||||||||||||||
| 545 | case never executed: 1:case 1:never executed: case 1: | 0 | ||||||||||||||||||||||||
| 546 | tbool = (ASN1_BOOLEAN *)pval; | - | ||||||||||||||||||||||||
| 547 | if (*
| 0 | ||||||||||||||||||||||||
| 548 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 549 | if (it->utype != -4
| 0 | ||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||
| 551 | if (*
| 0 | ||||||||||||||||||||||||
| 552 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 553 | if (!*tbool
| 0 | ||||||||||||||||||||||||
| 554 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 555 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 556 | c = (unsigned char)*tbool; | - | ||||||||||||||||||||||||
| 557 | cont = &c; | - | ||||||||||||||||||||||||
| 558 | len = 1; | - | ||||||||||||||||||||||||
| 559 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 560 | - | |||||||||||||||||||||||||
| 561 | case executed 1306 times by 6 tests: 3:case 3:Executed by:
executed 1306 times by 6 tests: case 3:Executed by:
| 1306 | ||||||||||||||||||||||||
| 562 | return executed 1306 times by 6 tests: i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
executed 1306 times by 6 tests: return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 1306 | ||||||||||||||||||||||||
| 563 | cout ? &cout : executed 1306 times by 6 tests: return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 1306 | ||||||||||||||||||||||||
| 564 | ((void *)0) executed 1306 times by 6 tests: return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 1306 | ||||||||||||||||||||||||
| 565 | ); executed 1306 times by 6 tests: return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 1306 | ||||||||||||||||||||||||
| 566 | break; dead code: break; | - | ||||||||||||||||||||||||
| 567 | - | |||||||||||||||||||||||||
| 568 | case executed 206 times by 4 tests: 2:case 2:Executed by:
executed 206 times by 4 tests: case 2:Executed by:
| 206 | ||||||||||||||||||||||||
| 569 | case never executed: 10:case 10:never executed: case 10: | 0 | ||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||
| 572 | - | |||||||||||||||||||||||||
| 573 | return executed 206 times by 4 tests: i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval,return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : ((void *)0) );Executed by:
executed 206 times by 4 tests: return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 206 | ||||||||||||||||||||||||
| 574 | cout ? &cout : executed 206 times by 4 tests: return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 206 | ||||||||||||||||||||||||
| 575 | ((void *)0) executed 206 times by 4 tests: return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 206 | ||||||||||||||||||||||||
| 576 | ); executed 206 times by 4 tests: return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : ((void *)0) );Executed by:
| 206 | ||||||||||||||||||||||||
| 577 | break; dead code: break; | - | ||||||||||||||||||||||||
| 578 | - | |||||||||||||||||||||||||
| 579 | case executed 677 times by 7 tests: 4:case 4:Executed by:
executed 677 times by 7 tests: case 4:Executed by:
| 677 | ||||||||||||||||||||||||
| 580 | case never executed: 18:case 18:never executed: case 18: | 0 | ||||||||||||||||||||||||
| 581 | case executed 20 times by 1 test: 19:case 19:Executed by:
executed 20 times by 1 test: case 19:Executed by:
| 20 | ||||||||||||||||||||||||
| 582 | case never executed: 20:case 20:never executed: case 20: | 0 | ||||||||||||||||||||||||
| 583 | case never executed: 21:case 21:never executed: case 21: | 0 | ||||||||||||||||||||||||
| 584 | case executed 88 times by 1 test: 22:case 22:Executed by:
executed 88 times by 1 test: case 22:Executed by:
| 88 | ||||||||||||||||||||||||
| 585 | case executed 102 times by 3 tests: 23:case 23:Executed by:
executed 102 times by 3 tests: case 23:Executed by:
| 102 | ||||||||||||||||||||||||
| 586 | case executed 6 times by 1 test: 24:case 24:Executed by:
executed 6 times by 1 test: case 24:Executed by:
| 6 | ||||||||||||||||||||||||
| 587 | case never executed: 25:case 25:never executed: case 25: | 0 | ||||||||||||||||||||||||
| 588 | case never executed: 26:case 26:never executed: case 26: | 0 | ||||||||||||||||||||||||
| 589 | case never executed: 27:case 27:never executed: case 27: | 0 | ||||||||||||||||||||||||
| 590 | case never executed: 28:case 28:never executed: case 28: | 0 | ||||||||||||||||||||||||
| 591 | case never executed: 30:case 30:never executed: case 30: | 0 | ||||||||||||||||||||||||
| 592 | case executed 9500 times by 8 tests: 12:case 12:Executed by:
executed 9500 times by 8 tests: case 12:Executed by:
| 9500 | ||||||||||||||||||||||||
| 593 | case executed 64 times by 2 tests: 16:case 16:Executed by:
executed 64 times by 2 tests: case 16:Executed by:
| 64 | ||||||||||||||||||||||||
| 594 | case never executed: 17:case 17:never executed: case 17: | 0 | ||||||||||||||||||||||||
| 595 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 596 | - | |||||||||||||||||||||||||
| 597 | strtmp = (ASN1_STRING *)*pval; | - | ||||||||||||||||||||||||
| 598 | - | |||||||||||||||||||||||||
| 599 | if ((
| 15-10442 | ||||||||||||||||||||||||
| 600 | (
| 0-15 | ||||||||||||||||||||||||
| 601 | if (cout
| 0 | ||||||||||||||||||||||||
| 602 | strtmp->data = cout; | - | ||||||||||||||||||||||||
| 603 | strtmp->length = 0; | - | ||||||||||||||||||||||||
| 604 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 605 | - | |||||||||||||||||||||||||
| 606 | return never executed: -2;return -2;never executed: return -2; | 0 | ||||||||||||||||||||||||
| 607 | } | - | ||||||||||||||||||||||||
| 608 | cont = strtmp->data; | - | ||||||||||||||||||||||||
| 609 | len = strtmp->length; | - | ||||||||||||||||||||||||
| 610 | - | |||||||||||||||||||||||||
| 611 | break; executed 10457 times by 10 tests: break;Executed by:
| 10457 | ||||||||||||||||||||||||
| 612 | - | |||||||||||||||||||||||||
| 613 | } | - | ||||||||||||||||||||||||
| 614 | if (cout
| 469-20134 | ||||||||||||||||||||||||
| 615 | memcpy(cout, cont, len); executed 4554 times by 10 tests: memcpy(cout, cont, len);Executed by:
| 4554 | ||||||||||||||||||||||||
| 616 | return executed 25157 times by 10 tests: len;return len;Executed by:
executed 25157 times by 10 tests: return len;Executed by:
| 25157 | ||||||||||||||||||||||||
| 617 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |