| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/a_object.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp) | - | ||||||||||||||||||||||||
| 5 | { | - | ||||||||||||||||||||||||
| 6 | unsigned char *p, *allocated = | - | ||||||||||||||||||||||||
| 7 | ((void *)0) | - | ||||||||||||||||||||||||
| 8 | ; | - | ||||||||||||||||||||||||
| 9 | int objsize; | - | ||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | if ((
| 0 | ||||||||||||||||||||||||
| 12 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 13 | )
| 0 | ||||||||||||||||||||||||
| 14 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 15 | )
| 0 | ||||||||||||||||||||||||
| 16 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||
| 18 | objsize = ASN1_object_size(0, a->length, 6); | - | ||||||||||||||||||||||||
| 19 | if (pp ==
| 0 | ||||||||||||||||||||||||
| 20 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 21 | || objsize == -1
| 0 | ||||||||||||||||||||||||
| 22 | return never executed: objsize;return objsize;never executed: return objsize; | 0 | ||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||
| 24 | if (*
| 0 | ||||||||||||||||||||||||
| 25 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 26 | ) { | - | ||||||||||||||||||||||||
| 27 | if ((
| 0 | ||||||||||||||||||||||||
| 28 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 29 | ) { | - | ||||||||||||||||||||||||
| 30 | ERR_put_error(13,(143),((1|64)),__FILE__,35); | - | ||||||||||||||||||||||||
| 31 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 32 | } | - | ||||||||||||||||||||||||
| 33 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 34 | p = *pp; | - | ||||||||||||||||||||||||
| 35 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | ASN1_put_object(&p, 0, a->length, 6, 0x00); | - | ||||||||||||||||||||||||
| 38 | memcpy(p, a->data, a->length); | - | ||||||||||||||||||||||||
| 39 | - | |||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||
| 43 | - | |||||||||||||||||||||||||
| 44 | *pp = allocated !=
| 0 | ||||||||||||||||||||||||
| 45 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 46 | ? allocated : p + a->length; | - | ||||||||||||||||||||||||
| 47 | return never executed: objsize;return objsize;never executed: return objsize; | 0 | ||||||||||||||||||||||||
| 48 | } | - | ||||||||||||||||||||||||
| 49 | - | |||||||||||||||||||||||||
| 50 | int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) | - | ||||||||||||||||||||||||
| 51 | { | - | ||||||||||||||||||||||||
| 52 | int i, first, len = 0, c, use_bn; | - | ||||||||||||||||||||||||
| 53 | char ftmp[24], *tmp = ftmp; | - | ||||||||||||||||||||||||
| 54 | int tmpsize = sizeof(ftmp); | - | ||||||||||||||||||||||||
| 55 | const char *p; | - | ||||||||||||||||||||||||
| 56 | unsigned long l; | - | ||||||||||||||||||||||||
| 57 | BIGNUM *bl = | - | ||||||||||||||||||||||||
| 58 | ((void *)0) | - | ||||||||||||||||||||||||
| 59 | ; | - | ||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||
| 61 | if (num == 0
| 0-190 | ||||||||||||||||||||||||
| 62 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 63 | else if (num == -1
| 0-190 | ||||||||||||||||||||||||
| 64 | num = strlen(buf); executed 190 times by 1 test: num = strlen(buf);Executed by:
| 190 | ||||||||||||||||||||||||
| 65 | - | |||||||||||||||||||||||||
| 66 | p = buf; | - | ||||||||||||||||||||||||
| 67 | c = *(p++); | - | ||||||||||||||||||||||||
| 68 | num--; | - | ||||||||||||||||||||||||
| 69 | if ((
| 0-190 | ||||||||||||||||||||||||
| 70 | first = c - '0'; | - | ||||||||||||||||||||||||
| 71 | } executed 190 times by 1 test: else {end of blockExecuted by:
| 190 | ||||||||||||||||||||||||
| 72 | ERR_put_error(13,(100),(122),__FILE__,73); | - | ||||||||||||||||||||||||
| 73 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 74 | } | - | ||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | if (num <= 0
| 0-190 | ||||||||||||||||||||||||
| 77 | ERR_put_error(13,(100),(138),__FILE__,78); | - | ||||||||||||||||||||||||
| 78 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 79 | } | - | ||||||||||||||||||||||||
| 80 | c = *(p++); | - | ||||||||||||||||||||||||
| 81 | num--; | - | ||||||||||||||||||||||||
| 82 | for (;;) { | - | ||||||||||||||||||||||||
| 83 | if (num <= 0
| 190-652 | ||||||||||||||||||||||||
| 84 | break; executed 190 times by 1 test: break;Executed by:
| 190 | ||||||||||||||||||||||||
| 85 | if ((
| 0-652 | ||||||||||||||||||||||||
| 86 | ERR_put_error(13,(100),(131),__FILE__,87); | - | ||||||||||||||||||||||||
| 87 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 88 | } | - | ||||||||||||||||||||||||
| 89 | l = 0; | - | ||||||||||||||||||||||||
| 90 | use_bn = 0; | - | ||||||||||||||||||||||||
| 91 | for (;;) { | - | ||||||||||||||||||||||||
| 92 | if (num <= 0
| 190-1466 | ||||||||||||||||||||||||
| 93 | break; executed 190 times by 1 test: break;Executed by:
| 190 | ||||||||||||||||||||||||
| 94 | num--; | - | ||||||||||||||||||||||||
| 95 | c = *(p++); | - | ||||||||||||||||||||||||
| 96 | if ((
| 0-1466 | ||||||||||||||||||||||||
| 97 | break; executed 462 times by 1 test: break;Executed by:
| 462 | ||||||||||||||||||||||||
| 98 | if (!(ossl_ctype_check((c), 0x4))
| 0-1004 | ||||||||||||||||||||||||
| 99 | ERR_put_error(13,(100),(130),__FILE__,100); | - | ||||||||||||||||||||||||
| 100 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 101 | } | - | ||||||||||||||||||||||||
| 102 | if (!use_bn
| 0-1004 | ||||||||||||||||||||||||
| 103 | (0x7fffffffffffffffL * 2UL + 1UL)
| 0-1004 | ||||||||||||||||||||||||
| 104 | - 80) / 10L)
| 0-1004 | ||||||||||||||||||||||||
| 105 | use_bn = 1; | - | ||||||||||||||||||||||||
| 106 | if (bl ==
| 0 | ||||||||||||||||||||||||
| 107 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 108 | ) | - | ||||||||||||||||||||||||
| 109 | bl = BN_new(); never executed: bl = BN_new(); | 0 | ||||||||||||||||||||||||
| 110 | if (bl ==
| 0 | ||||||||||||||||||||||||
| 111 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 112 | || !BN_set_word(bl, l)
| 0 | ||||||||||||||||||||||||
| 113 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 114 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 115 | if (use_bn
| 0-1004 | ||||||||||||||||||||||||
| 116 | if (!BN_mul_word(bl, 10L)
| 0 | ||||||||||||||||||||||||
| 117 | || !BN_add_word(bl, c - '0')
| 0 | ||||||||||||||||||||||||
| 118 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 119 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
| 120 | l = l * 10L + (long)(c - '0'); executed 1004 times by 1 test: l = l * 10L + (long)(c - '0');Executed by:
| 1004 | ||||||||||||||||||||||||
| 121 | } | - | ||||||||||||||||||||||||
| 122 | if (len == 0
| 190-462 | ||||||||||||||||||||||||
| 123 | if ((
| 0-102 | ||||||||||||||||||||||||
| 124 | ERR_put_error(13,(100),(147),__FILE__,120) | - | ||||||||||||||||||||||||
| 125 | ; | - | ||||||||||||||||||||||||
| 126 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 127 | } | - | ||||||||||||||||||||||||
| 128 | if (use_bn
| 0-190 | ||||||||||||||||||||||||
| 129 | if (!BN_add_word(bl, first * 40)
| 0 | ||||||||||||||||||||||||
| 130 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 131 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
| 132 | l += (long)first *40; executed 190 times by 1 test: l += (long)first *40;Executed by:
| 190 | ||||||||||||||||||||||||
| 133 | } | - | ||||||||||||||||||||||||
| 134 | i = 0; | - | ||||||||||||||||||||||||
| 135 | if (use_bn
| 0-652 | ||||||||||||||||||||||||
| 136 | int blsize; | - | ||||||||||||||||||||||||
| 137 | blsize = BN_num_bits(bl); | - | ||||||||||||||||||||||||
| 138 | blsize = (blsize + 6) / 7; | - | ||||||||||||||||||||||||
| 139 | if (blsize > tmpsize
| 0 | ||||||||||||||||||||||||
| 140 | if (tmp != ftmp
| 0 | ||||||||||||||||||||||||
| 141 | CRYPTO_free(tmp, __FILE__, 136); never executed: CRYPTO_free(tmp, __FILE__, 136); | 0 | ||||||||||||||||||||||||
| 142 | tmpsize = blsize + 32; | - | ||||||||||||||||||||||||
| 143 | tmp = CRYPTO_malloc(tmpsize, __FILE__, 138); | - | ||||||||||||||||||||||||
| 144 | if (tmp ==
| 0 | ||||||||||||||||||||||||
| 145 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 146 | ) | - | ||||||||||||||||||||||||
| 147 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 148 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 149 | while (blsize--
| 0 | ||||||||||||||||||||||||
| 150 | unsigned long t = BN_div_word(bl, 0x80L); | - | ||||||||||||||||||||||||
| 151 | if (t == (unsigned long)-1
| 0 | ||||||||||||||||||||||||
| 152 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 153 | tmp[i++] = (unsigned char)t; | - | ||||||||||||||||||||||||
| 154 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 155 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||
| 157 | for (;;) { | - | ||||||||||||||||||||||||
| 158 | tmp[i++] = (unsigned char)l & 0x7f; | - | ||||||||||||||||||||||||
| 159 | l >>= 7L; | - | ||||||||||||||||||||||||
| 160 | if (l == 0L
| 176-652 | ||||||||||||||||||||||||
| 161 | break; executed 652 times by 1 test: break;Executed by:
| 652 | ||||||||||||||||||||||||
| 162 | } executed 176 times by 1 test: end of blockExecuted by:
| 176 | ||||||||||||||||||||||||
| 163 | - | |||||||||||||||||||||||||
| 164 | } executed 652 times by 1 test: end of blockExecuted by:
| 652 | ||||||||||||||||||||||||
| 165 | if (out !=
| 326 | ||||||||||||||||||||||||
| 166 | ((void *)0)
| 326 | ||||||||||||||||||||||||
| 167 | ) { | - | ||||||||||||||||||||||||
| 168 | if (len + i > olen
| 0-326 | ||||||||||||||||||||||||
| 169 | ERR_put_error(13,(100),(107),__FILE__,160); | - | ||||||||||||||||||||||||
| 170 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 171 | } | - | ||||||||||||||||||||||||
| 172 | while (--
| 88-326 | ||||||||||||||||||||||||
| 173 | out[len++] = tmp[i] | 0x80; executed 88 times by 1 test: out[len++] = tmp[i] | 0x80;Executed by:
| 88 | ||||||||||||||||||||||||
| 174 | out[len++] = tmp[0]; | - | ||||||||||||||||||||||||
| 175 | } executed 326 times by 1 test: elseend of blockExecuted by:
| 326 | ||||||||||||||||||||||||
| 176 | len += i; executed 326 times by 1 test: len += i;Executed by:
| 326 | ||||||||||||||||||||||||
| 177 | } | - | ||||||||||||||||||||||||
| 178 | if (tmp != ftmp
| 0-190 | ||||||||||||||||||||||||
| 179 | CRYPTO_free(tmp, __FILE__, 170); never executed: CRYPTO_free(tmp, __FILE__, 170); | 0 | ||||||||||||||||||||||||
| 180 | BN_free(bl); | - | ||||||||||||||||||||||||
| 181 | return executed 190 times by 1 test: len;return len;Executed by:
executed 190 times by 1 test: return len;Executed by:
| 190 | ||||||||||||||||||||||||
| 182 | err: | - | ||||||||||||||||||||||||
| 183 | if (tmp != ftmp
| 0 | ||||||||||||||||||||||||
| 184 | CRYPTO_free(tmp, __FILE__, 175); never executed: CRYPTO_free(tmp, __FILE__, 175); | 0 | ||||||||||||||||||||||||
| 185 | BN_free(bl); | - | ||||||||||||||||||||||||
| 186 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 187 | } | - | ||||||||||||||||||||||||
| 188 | - | |||||||||||||||||||||||||
| 189 | int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a) | - | ||||||||||||||||||||||||
| 190 | { | - | ||||||||||||||||||||||||
| 191 | return executed 347467 times by 1 test: OBJ_obj2txt(buf, buf_len, a, 0);return OBJ_obj2txt(buf, buf_len, a, 0);Executed by:
executed 347467 times by 1 test: return OBJ_obj2txt(buf, buf_len, a, 0);Executed by:
| 347467 | ||||||||||||||||||||||||
| 192 | } | - | ||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||
| 194 | int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a) | - | ||||||||||||||||||||||||
| 195 | { | - | ||||||||||||||||||||||||
| 196 | char buf[80], *p = buf; | - | ||||||||||||||||||||||||
| 197 | int i; | - | ||||||||||||||||||||||||
| 198 | - | |||||||||||||||||||||||||
| 199 | if ((
| 0-333081 | ||||||||||||||||||||||||
| 200 | ((void *)0)
| 0-333081 | ||||||||||||||||||||||||
| 201 | )
| 0-333081 | ||||||||||||||||||||||||
| 202 | ((void *)0)
| 0-333081 | ||||||||||||||||||||||||
| 203 | )
| 0-333081 | ||||||||||||||||||||||||
| 204 | return never executed: BIO_write(bp, "NULL", 4);return BIO_write(bp, "NULL", 4);never executed: return BIO_write(bp, "NULL", 4); | 0 | ||||||||||||||||||||||||
| 205 | i = i2t_ASN1_OBJECT(buf, sizeof(buf), a); | - | ||||||||||||||||||||||||
| 206 | if (i > (int)(sizeof(buf) - 1)
| 1540-331541 | ||||||||||||||||||||||||
| 207 | if ((
| 0-1540 | ||||||||||||||||||||||||
| 208 | ((void *)0)
| 0-1540 | ||||||||||||||||||||||||
| 209 | ) { | - | ||||||||||||||||||||||||
| 210 | ERR_put_error(13,(126),((1|64)),__FILE__,195); | - | ||||||||||||||||||||||||
| 211 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 212 | } | - | ||||||||||||||||||||||||
| 213 | i2t_ASN1_OBJECT(p, i + 1, a); | - | ||||||||||||||||||||||||
| 214 | } executed 1540 times by 1 test: end of blockExecuted by:
| 1540 | ||||||||||||||||||||||||
| 215 | if (i <= 0
| 0-333081 | ||||||||||||||||||||||||
| 216 | i = BIO_write(bp, "<INVALID>", 9); | - | ||||||||||||||||||||||||
| 217 | i += BIO_dump(bp, (const char *)a->data, a->length); | - | ||||||||||||||||||||||||
| 218 | return never executed: i;return i;never executed: return i; | 0 | ||||||||||||||||||||||||
| 219 | } | - | ||||||||||||||||||||||||
| 220 | BIO_write(bp, p, i); | - | ||||||||||||||||||||||||
| 221 | if (p != buf
| 1540-331541 | ||||||||||||||||||||||||
| 222 | CRYPTO_free(p, __FILE__, 207); executed 1540 times by 1 test: CRYPTO_free(p, __FILE__, 207);Executed by:
| 1540 | ||||||||||||||||||||||||
| 223 | return executed 333081 times by 1 test: i;return i;Executed by:
executed 333081 times by 1 test: return i;Executed by:
| 333081 | ||||||||||||||||||||||||
| 224 | } | - | ||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, | - | ||||||||||||||||||||||||
| 227 | long length) | - | ||||||||||||||||||||||||
| 228 | { | - | ||||||||||||||||||||||||
| 229 | const unsigned char *p; | - | ||||||||||||||||||||||||
| 230 | long len; | - | ||||||||||||||||||||||||
| 231 | int tag, xclass; | - | ||||||||||||||||||||||||
| 232 | int inf, i; | - | ||||||||||||||||||||||||
| 233 | ASN1_OBJECT *ret = | - | ||||||||||||||||||||||||
| 234 | ((void *)0) | - | ||||||||||||||||||||||||
| 235 | ; | - | ||||||||||||||||||||||||
| 236 | p = *pp; | - | ||||||||||||||||||||||||
| 237 | inf = ASN1_get_object(&p, &len, &tag, &xclass, length); | - | ||||||||||||||||||||||||
| 238 | if (inf & 0x80
| 609-231476 | ||||||||||||||||||||||||
| 239 | i = 102; | - | ||||||||||||||||||||||||
| 240 | goto executed 609 times by 1 test: err;goto err;Executed by:
executed 609 times by 1 test: goto err;Executed by:
| 609 | ||||||||||||||||||||||||
| 241 | } | - | ||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||
| 243 | if (tag != 6
| 0-231476 | ||||||||||||||||||||||||
| 244 | i = 116; | - | ||||||||||||||||||||||||
| 245 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 246 | } | - | ||||||||||||||||||||||||
| 247 | ret = c2i_ASN1_OBJECT(a, &p, len); | - | ||||||||||||||||||||||||
| 248 | if (ret
| 8374-223102 | ||||||||||||||||||||||||
| 249 | * executed 223102 times by 1 test: pp = p;*pp = p;Executed by:
executed 223102 times by 1 test: *pp = p;Executed by:
| 223102 | ||||||||||||||||||||||||
| 250 | return executed 231476 times by 1 test: ret;return ret;Executed by:
executed 231476 times by 1 test: return ret;Executed by:
| 231476 | ||||||||||||||||||||||||
| 251 | err: | - | ||||||||||||||||||||||||
| 252 | ERR_put_error(13,(147),(i),__FILE__,235); | - | ||||||||||||||||||||||||
| 253 | return executed 609 times by 1 test: return ((void *)0) ;Executed by:
executed 609 times by 1 test: return ((void *)0) ;Executed by:
| 609 | ||||||||||||||||||||||||
| 254 | ((void *)0) executed 609 times by 1 test: return ((void *)0) ;Executed by:
| 609 | ||||||||||||||||||||||||
| 255 | ; executed 609 times by 1 test: return ((void *)0) ;Executed by:
| 609 | ||||||||||||||||||||||||
| 256 | } | - | ||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||
| 258 | ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, | - | ||||||||||||||||||||||||
| 259 | long len) | - | ||||||||||||||||||||||||
| 260 | { | - | ||||||||||||||||||||||||
| 261 | ASN1_OBJECT *ret = | - | ||||||||||||||||||||||||
| 262 | ((void *)0) | - | ||||||||||||||||||||||||
| 263 | , tobj; | - | ||||||||||||||||||||||||
| 264 | const unsigned char *p; | - | ||||||||||||||||||||||||
| 265 | unsigned char *data; | - | ||||||||||||||||||||||||
| 266 | int i, length; | - | ||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||
| 272 | - | |||||||||||||||||||||||||
| 273 | if (len <= 0
| 0-896178 | ||||||||||||||||||||||||
| 274 | ((void *)0)
| 0-896178 | ||||||||||||||||||||||||
| 275 | || (
| 0-896178 | ||||||||||||||||||||||||
| 276 | ((void *)0)
| 0-896178 | ||||||||||||||||||||||||
| 277 | || | - | ||||||||||||||||||||||||
| 278 | p[len - 1] & 0x80
| 8788-887390 | ||||||||||||||||||||||||
| 279 | ERR_put_error(13,(196),(216),__FILE__,254); | - | ||||||||||||||||||||||||
| 280 | return executed 10184 times by 1 test: return ((void *)0) ;Executed by:
executed 10184 times by 1 test: return ((void *)0) ;Executed by:
| 10184 | ||||||||||||||||||||||||
| 281 | ((void *)0) executed 10184 times by 1 test: return ((void *)0) ;Executed by:
| 10184 | ||||||||||||||||||||||||
| 282 | ; executed 10184 times by 1 test: return ((void *)0) ;Executed by:
| 10184 | ||||||||||||||||||||||||
| 283 | } | - | ||||||||||||||||||||||||
| 284 | - | |||||||||||||||||||||||||
| 285 | length = (int)len; | - | ||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | - | |||||||||||||||||||||||||
| 288 | - | |||||||||||||||||||||||||
| 289 | - | |||||||||||||||||||||||||
| 290 | tobj.nid = 0; | - | ||||||||||||||||||||||||
| 291 | tobj.data = p; | - | ||||||||||||||||||||||||
| 292 | tobj.length = length; | - | ||||||||||||||||||||||||
| 293 | tobj.flags = 0; | - | ||||||||||||||||||||||||
| 294 | i = OBJ_obj2nid(&tobj); | - | ||||||||||||||||||||||||
| 295 | if (i != 0
| 310293-577097 | ||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||
| 299 | - | |||||||||||||||||||||||||
| 300 | - | |||||||||||||||||||||||||
| 301 | ret = OBJ_nid2obj(i); | - | ||||||||||||||||||||||||
| 302 | if (a
| 0-577097 | ||||||||||||||||||||||||
| 303 | ASN1_OBJECT_free(*a); | - | ||||||||||||||||||||||||
| 304 | *a = ret; | - | ||||||||||||||||||||||||
| 305 | } executed 577097 times by 1 test: end of blockExecuted by:
| 577097 | ||||||||||||||||||||||||
| 306 | *pp += len; | - | ||||||||||||||||||||||||
| 307 | return executed 577097 times by 1 test: ret;return ret;Executed by:
executed 577097 times by 1 test: return ret;Executed by:
| 577097 | ||||||||||||||||||||||||
| 308 | } | - | ||||||||||||||||||||||||
| 309 | for (i = 0; i < length
| 307734-914259 | ||||||||||||||||||||||||
| 310 | if (*
| 1005-859666 | ||||||||||||||||||||||||
| 311 | ERR_put_error(13,(196),(216),__FILE__,284); | - | ||||||||||||||||||||||||
| 312 | return executed 2559 times by 1 test: return ((void *)0) ;Executed by:
executed 2559 times by 1 test: return ((void *)0) ;Executed by:
| 2559 | ||||||||||||||||||||||||
| 313 | ((void *)0) executed 2559 times by 1 test: return ((void *)0) ;Executed by:
| 2559 | ||||||||||||||||||||||||
| 314 | ; executed 2559 times by 1 test: return ((void *)0) ;Executed by:
| 2559 | ||||||||||||||||||||||||
| 315 | } | - | ||||||||||||||||||||||||
| 316 | } executed 911700 times by 1 test: end of blockExecuted by:
| 911700 | ||||||||||||||||||||||||
| 317 | - | |||||||||||||||||||||||||
| 318 | - | |||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | if ((
| 95-307639 | ||||||||||||||||||||||||
| 323 | ((void *)0)
| 95-307639 | ||||||||||||||||||||||||
| 324 | )
| 95-307639 | ||||||||||||||||||||||||
| 325 | ((void *)0)
| 93181-214458 | ||||||||||||||||||||||||
| 326 | )
| 93181-214458 | ||||||||||||||||||||||||
| 327 | !((*a)->flags & 0x01)
| 2864-211594 | ||||||||||||||||||||||||
| 328 | if ((
| 0-304870 | ||||||||||||||||||||||||
| 329 | ((void *)0)
| 0-304870 | ||||||||||||||||||||||||
| 330 | ) | - | ||||||||||||||||||||||||
| 331 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 332 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 333 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 334 | } executed 304870 times by 1 test: elseend of blockExecuted by:
| 304870 | ||||||||||||||||||||||||
| 335 | ret = (*a); executed 2864 times by 1 test: ret = (*a);Executed by:
| 2864 | ||||||||||||||||||||||||
| 336 | - | |||||||||||||||||||||||||
| 337 | p = *pp; | - | ||||||||||||||||||||||||
| 338 | - | |||||||||||||||||||||||||
| 339 | data = (unsigned char *)ret->data; | - | ||||||||||||||||||||||||
| 340 | ret->data = | - | ||||||||||||||||||||||||
| 341 | ((void *)0) | - | ||||||||||||||||||||||||
| 342 | ; | - | ||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||
| 344 | if ((
| 2864-304870 | ||||||||||||||||||||||||
| 345 | ((void *)0)
| 2864-304870 | ||||||||||||||||||||||||
| 346 | )
| 815-304870 | ||||||||||||||||||||||||
| 347 | ret->length = 0; | - | ||||||||||||||||||||||||
| 348 | CRYPTO_free(data, __FILE__, 307); | - | ||||||||||||||||||||||||
| 349 | data = CRYPTO_malloc(length, __FILE__, 308); | - | ||||||||||||||||||||||||
| 350 | if (data ==
| 0-305685 | ||||||||||||||||||||||||
| 351 | ((void *)0)
| 0-305685 | ||||||||||||||||||||||||
| 352 | ) { | - | ||||||||||||||||||||||||
| 353 | i = (1|64); | - | ||||||||||||||||||||||||
| 354 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||
| 355 | } | - | ||||||||||||||||||||||||
| 356 | ret->flags |= 0x08; | - | ||||||||||||||||||||||||
| 357 | } executed 305685 times by 1 test: end of blockExecuted by:
| 305685 | ||||||||||||||||||||||||
| 358 | memcpy(data, p, length); | - | ||||||||||||||||||||||||
| 359 | - | |||||||||||||||||||||||||
| 360 | ret->data = data; | - | ||||||||||||||||||||||||
| 361 | ret->length = length; | - | ||||||||||||||||||||||||
| 362 | ret->sn = | - | ||||||||||||||||||||||||
| 363 | ((void *)0) | - | ||||||||||||||||||||||||
| 364 | ; | - | ||||||||||||||||||||||||
| 365 | ret->ln = | - | ||||||||||||||||||||||||
| 366 | ((void *)0) | - | ||||||||||||||||||||||||
| 367 | ; | - | ||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||
| 369 | p += length; | - | ||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||
| 371 | if (a !=
| 95-307639 | ||||||||||||||||||||||||
| 372 | ((void *)0)
| 95-307639 | ||||||||||||||||||||||||
| 373 | ) | - | ||||||||||||||||||||||||
| 374 | (* executed 307639 times by 1 test: a) = ret;(*a) = ret;Executed by:
executed 307639 times by 1 test: (*a) = ret;Executed by:
| 307639 | ||||||||||||||||||||||||
| 375 | *pp = p; | - | ||||||||||||||||||||||||
| 376 | return executed 307734 times by 1 test: ret;return ret;Executed by:
executed 307734 times by 1 test: return ret;Executed by:
| 307734 | ||||||||||||||||||||||||
| 377 | err: | - | ||||||||||||||||||||||||
| 378 | ERR_put_error(13,(196),(i),__FILE__,329); | - | ||||||||||||||||||||||||
| 379 | if ((
| 0 | ||||||||||||||||||||||||
| 380 | ((void *)0)
| 0 | ||||||||||||||||||||||||
| 381 | )
| 0 | ||||||||||||||||||||||||
| 382 | ASN1_OBJECT_free(ret); never executed: ASN1_OBJECT_free(ret); | 0 | ||||||||||||||||||||||||
| 383 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 384 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 385 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 386 | } | - | ||||||||||||||||||||||||
| 387 | - | |||||||||||||||||||||||||
| 388 | ASN1_OBJECT *ASN1_OBJECT_new(void) | - | ||||||||||||||||||||||||
| 389 | { | - | ||||||||||||||||||||||||
| 390 | ASN1_OBJECT *ret; | - | ||||||||||||||||||||||||
| 391 | - | |||||||||||||||||||||||||
| 392 | ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 339); | - | ||||||||||||||||||||||||
| 393 | if (ret ==
| 0-357727 | ||||||||||||||||||||||||
| 394 | ((void *)0)
| 0-357727 | ||||||||||||||||||||||||
| 395 | ) { | - | ||||||||||||||||||||||||
| 396 | ERR_put_error(13,(123),((1|64)),__FILE__,341); | - | ||||||||||||||||||||||||
| 397 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 398 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 399 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 400 | } | - | ||||||||||||||||||||||||
| 401 | ret->flags = 0x01; | - | ||||||||||||||||||||||||
| 402 | return executed 357727 times by 1 test: ret;return ret;Executed by:
executed 357727 times by 1 test: return ret;Executed by:
| 357727 | ||||||||||||||||||||||||
| 403 | } | - | ||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||
| 405 | void ASN1_OBJECT_free(ASN1_OBJECT *a) | - | ||||||||||||||||||||||||
| 406 | { | - | ||||||||||||||||||||||||
| 407 | if (a ==
| 397533-1603245 | ||||||||||||||||||||||||
| 408 | ((void *)0)
| 397533-1603245 | ||||||||||||||||||||||||
| 409 | ) | - | ||||||||||||||||||||||||
| 410 | return; executed 397533 times by 1 test: return;Executed by:
| 397533 | ||||||||||||||||||||||||
| 411 | if (a->flags & 0x04
| 52857-1550388 | ||||||||||||||||||||||||
| 412 | - | |||||||||||||||||||||||||
| 413 | - | |||||||||||||||||||||||||
| 414 | - | |||||||||||||||||||||||||
| 415 | CRYPTO_free((void*)a->sn, __FILE__, 356); | - | ||||||||||||||||||||||||
| 416 | CRYPTO_free((void*)a->ln, __FILE__, 357); | - | ||||||||||||||||||||||||
| 417 | - | |||||||||||||||||||||||||
| 418 | a->sn = a->ln = | - | ||||||||||||||||||||||||
| 419 | ((void *)0) | - | ||||||||||||||||||||||||
| 420 | ; | - | ||||||||||||||||||||||||
| 421 | } executed 52857 times by 1 test: end of blockExecuted by:
| 52857 | ||||||||||||||||||||||||
| 422 | if (a->flags & 0x08
| 357727-1245518 | ||||||||||||||||||||||||
| 423 | CRYPTO_free((void*)a->data, __FILE__, 362); | - | ||||||||||||||||||||||||
| 424 | a->data = | - | ||||||||||||||||||||||||
| 425 | ((void *)0) | - | ||||||||||||||||||||||||
| 426 | ; | - | ||||||||||||||||||||||||
| 427 | a->length = 0; | - | ||||||||||||||||||||||||
| 428 | } executed 357727 times by 1 test: end of blockExecuted by:
| 357727 | ||||||||||||||||||||||||
| 429 | if (a->flags & 0x01
| 357727-1245518 | ||||||||||||||||||||||||
| 430 | CRYPTO_free(a, __FILE__, 367); executed 357727 times by 1 test: CRYPTO_free(a, __FILE__, 367);Executed by:
| 357727 | ||||||||||||||||||||||||
| 431 | } executed 1603245 times by 1 test: end of blockExecuted by:
| 1603245 | ||||||||||||||||||||||||
| 432 | - | |||||||||||||||||||||||||
| 433 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, | - | ||||||||||||||||||||||||
| 434 | const char *sn, const char *ln) | - | ||||||||||||||||||||||||
| 435 | { | - | ||||||||||||||||||||||||
| 436 | ASN1_OBJECT o; | - | ||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||
| 438 | o.sn = sn; | - | ||||||||||||||||||||||||
| 439 | o.ln = ln; | - | ||||||||||||||||||||||||
| 440 | o.data = data; | - | ||||||||||||||||||||||||
| 441 | o.nid = nid; | - | ||||||||||||||||||||||||
| 442 | o.length = len; | - | ||||||||||||||||||||||||
| 443 | o.flags = 0x01 | 0x04 | | - | ||||||||||||||||||||||||
| 444 | 0x08; | - | ||||||||||||||||||||||||
| 445 | return never executed: OBJ_dup(&o);return OBJ_dup(&o);never executed: return OBJ_dup(&o); | 0 | ||||||||||||||||||||||||
| 446 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |