Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/a_print.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||
2 | int ASN1_PRINTABLE_type(const unsigned char *s, int len) | - | ||||||||||||||||||||||||||||||||||||
3 | { | - | ||||||||||||||||||||||||||||||||||||
4 | int c; | - | ||||||||||||||||||||||||||||||||||||
5 | int ia5 = 0; | - | ||||||||||||||||||||||||||||||||||||
6 | int t61 = 0; | - | ||||||||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||||||||
8 | if (len <= 0
| 0-2 | ||||||||||||||||||||||||||||||||||||
9 | len = -1; never executed: len = -1; | 0 | ||||||||||||||||||||||||||||||||||||
10 | if (s ==
| 0-2 | ||||||||||||||||||||||||||||||||||||
11 | ((void *)0)
| 0-2 | ||||||||||||||||||||||||||||||||||||
12 | ) | - | ||||||||||||||||||||||||||||||||||||
13 | return never executed: 19;return 19; never executed: return 19; | 0 | ||||||||||||||||||||||||||||||||||||
14 | - | |||||||||||||||||||||||||||||||||||||
15 | while ((*
| 0-4 | ||||||||||||||||||||||||||||||||||||
16 | c = *(s++); | - | ||||||||||||||||||||||||||||||||||||
17 | if (!(ossl_ctype_check((c), 0x800))
| 0-4 | ||||||||||||||||||||||||||||||||||||
18 | ia5 = 1; never executed: ia5 = 1; | 0 | ||||||||||||||||||||||||||||||||||||
19 | if (!(((c) & ~127) == 0)
| 0-4 | ||||||||||||||||||||||||||||||||||||
20 | t61 = 1; never executed: t61 = 1; | 0 | ||||||||||||||||||||||||||||||||||||
21 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
22 | if (t61
| 0-2 | ||||||||||||||||||||||||||||||||||||
23 | return never executed: 20;return 20; never executed: return 20; | 0 | ||||||||||||||||||||||||||||||||||||
24 | if (ia5
| 0-2 | ||||||||||||||||||||||||||||||||||||
25 | return never executed: 22;return 22; never executed: return 22; | 0 | ||||||||||||||||||||||||||||||||||||
26 | return executed 2 times by 1 test: 19;return 19; Executed by:
executed 2 times by 1 test: return 19; Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
27 | } | - | ||||||||||||||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||||||||||||||
29 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) | - | ||||||||||||||||||||||||||||||||||||
30 | { | - | ||||||||||||||||||||||||||||||||||||
31 | int i; | - | ||||||||||||||||||||||||||||||||||||
32 | unsigned char *p; | - | ||||||||||||||||||||||||||||||||||||
33 | - | |||||||||||||||||||||||||||||||||||||
34 | if (s->type != 28
| 0 | ||||||||||||||||||||||||||||||||||||
35 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
36 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
37 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
38 | p = s->data; | - | ||||||||||||||||||||||||||||||||||||
39 | for (i = 0; i < s->length
| 0 | ||||||||||||||||||||||||||||||||||||
40 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
41 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
42 | else | - | ||||||||||||||||||||||||||||||||||||
43 | p += 4; never executed: p += 4; | 0 | ||||||||||||||||||||||||||||||||||||
44 | } | - | ||||||||||||||||||||||||||||||||||||
45 | if (i < s->length
| 0 | ||||||||||||||||||||||||||||||||||||
46 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
47 | p = s->data; | - | ||||||||||||||||||||||||||||||||||||
48 | for (i = 3; i < s->length
| 0 | ||||||||||||||||||||||||||||||||||||
49 | *(p++) = s->data[i]; | - | ||||||||||||||||||||||||||||||||||||
50 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
51 | *(p) = '\0'; | - | ||||||||||||||||||||||||||||||||||||
52 | s->length /= 4; | - | ||||||||||||||||||||||||||||||||||||
53 | s->type = ASN1_PRINTABLE_type(s->data, s->length); | - | ||||||||||||||||||||||||||||||||||||
54 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||
55 | } | - | ||||||||||||||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||||||||||||||
57 | int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v) | - | ||||||||||||||||||||||||||||||||||||
58 | { | - | ||||||||||||||||||||||||||||||||||||
59 | int i, n; | - | ||||||||||||||||||||||||||||||||||||
60 | char buf[80]; | - | ||||||||||||||||||||||||||||||||||||
61 | const char *p; | - | ||||||||||||||||||||||||||||||||||||
62 | - | |||||||||||||||||||||||||||||||||||||
63 | if (v ==
| 0-60274 | ||||||||||||||||||||||||||||||||||||
64 | ((void *)0)
| 0-60274 | ||||||||||||||||||||||||||||||||||||
65 | ) | - | ||||||||||||||||||||||||||||||||||||
66 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
67 | n = 0; | - | ||||||||||||||||||||||||||||||||||||
68 | p = (const char *)v->data; | - | ||||||||||||||||||||||||||||||||||||
69 | for (i = 0; i < v->length
| 60274-1095817 | ||||||||||||||||||||||||||||||||||||
70 | if ((
| 2635-1093182 | ||||||||||||||||||||||||||||||||||||
71 | (
| 7313-770147 | ||||||||||||||||||||||||||||||||||||
72 | buf[n] = '.'; executed 764767 times by 1 test: buf[n] = '.'; Executed by:
| 764767 | ||||||||||||||||||||||||||||||||||||
73 | else | - | ||||||||||||||||||||||||||||||||||||
74 | buf[n] = p[i]; executed 331050 times by 1 test: buf[n] = p[i]; Executed by:
| 331050 | ||||||||||||||||||||||||||||||||||||
75 | n++; | - | ||||||||||||||||||||||||||||||||||||
76 | if (n >= 80
| 3476-1092341 | ||||||||||||||||||||||||||||||||||||
77 | if (BIO_write(bp, buf, n) <= 0
| 0-3476 | ||||||||||||||||||||||||||||||||||||
78 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
79 | n = 0; | - | ||||||||||||||||||||||||||||||||||||
80 | } executed 3476 times by 1 test: end of block Executed by:
| 3476 | ||||||||||||||||||||||||||||||||||||
81 | } executed 1095817 times by 1 test: end of block Executed by:
| 1095817 | ||||||||||||||||||||||||||||||||||||
82 | if (n > 0
| 8139-52135 | ||||||||||||||||||||||||||||||||||||
83 | if (BIO_write(bp, buf, n) <= 0
| 0-52135 | ||||||||||||||||||||||||||||||||||||
84 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
85 | return executed 60274 times by 1 test: 1;return 1; Executed by:
executed 60274 times by 1 test: return 1; Executed by:
| 60274 | ||||||||||||||||||||||||||||||||||||
86 | } | - | ||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |