OpenCoverage

x509_obj.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x509_obj.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)-
3{-
4 const X509_NAME_ENTRY *ne;-
5 int i;-
6 int n, lold, l, l1, l2, num, j, type;-
7 const char *s;-
8 char *p;-
9 unsigned char *q;-
10 BUF_MEM *b = -
11 ((void *)0)-
12 ;-
13 static const char hex[17] = "0123456789ABCDEF";-
14 int gs_doit[4];-
15 char tmp_buf[80];-
16-
17-
18-
19-
20 if (buf ==
buf == ((void *)0)Description
TRUEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 471 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
471-5798
21 ((void *)0)
buf == ((void *)0)Description
TRUEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 471 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
471-5798
22 ) {-
23 if ((
(b = BUF_MEM_n...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
b = BUF_MEM_new()) ==
(b = BUF_MEM_n...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5798
24 ((void *)0)
(b = BUF_MEM_n...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5798
25 )-
26 goto
never executed: goto err;
err;
never executed: goto err;
0
27 if (!BUF_MEM_grow(b, 200)
!BUF_MEM_grow(b, 200)Description
TRUEnever evaluated
FALSEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5798
28 goto
never executed: goto err;
err;
never executed: goto err;
0
29 b->data[0] = '\0';-
30 len = 200;-
31 }
executed 5798 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (len == 0
len == 0Description
TRUEnever evaluated
FALSEevaluated 471 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5798
32 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
33 ((void *)0)
never executed: return ((void *)0) ;
0
34 ;
never executed: return ((void *)0) ;
0
35 }-
36 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6269 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6269
37 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 6269 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6269
38 ) {-
39 if (b
bDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
40 buf = b->data;-
41 CRYPTO_free(b, __FILE__, 53);-
42 }
never executed: end of block
0
43 -
44 __builtin_strncpy (-
45 buf-
46 , -
47 "NO X509_NAME"-
48 , -
49 len-
50 )-
51 ;-
52 buf[len - 1] = '\0';-
53 return
never executed: return buf;
buf;
never executed: return buf;
0
54 }-
55-
56 len--;-
57 l = 0;-
58 for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries)
i < sk_X509_NA...um(a->entries)Description
TRUEevaluated 13855 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6266 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
6266-13855
59 ne = sk_X509_NAME_ENTRY_value(a->entries, i);-
60 n = OBJ_obj2nid(ne->object);-
61 if ((
(n == 0)Description
TRUEevaluated 8779 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5076 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n == 0)
(n == 0)Description
TRUEevaluated 8779 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5076 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| ((
((s = OBJ_nid2... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5076 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
s = OBJ_nid2sn(n)) ==
((s = OBJ_nid2... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5076 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8779
62 ((void *)0)
((s = OBJ_nid2... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5076 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5076
63 )
((s = OBJ_nid2... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 5076 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5076
64 i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object);-
65 s = tmp_buf;-
66 }
executed 8779 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8779
67 l1 = strlen(s);-
68-
69 type = ne->value->type;-
70 num = ne->value->length;-
71 if (num > (1024 * 1024)
num > (1024 * 1024)Description
TRUEnever evaluated
FALSEevaluated 13855 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-13855
72 ERR_put_error(11,(116),(134),__FILE__,74);-
73 goto
never executed: goto end;
end;
never executed: goto end;
0
74 }-
75 q = ne->value->data;-
76 if ((
(type == 27)Description
TRUEnever evaluated
FALSEevaluated 13855 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
type == 27)
(type == 27)Description
TRUEnever evaluated
FALSEevaluated 13855 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& ((
((num % 4) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
num % 4) == 0)
((num % 4) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-13855
77 gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0;-
78 for (j = 0; j < num
j < numDescription
TRUEnever evaluated
FALSEnever evaluated
; j++)
0
79 if (q[j] != 0
q[j] != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
80 gs_doit[j & 3] = 1;
never executed: gs_doit[j & 3] = 1;
0
81-
82 if (gs_doit[0] | gs_doit[1] | gs_doit[2]
gs_doit[0] | g...] | gs_doit[2]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
83 gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
never executed: gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
0
84 else {-
85 gs_doit[0] = gs_doit[1] = gs_doit[2] = 0;-
86 gs_doit[3] = 1;-
87 }
never executed: end of block
0
88 } else-
89 gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
executed 13855 times by 1 test: gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
Executed by:
  • libcrypto.so.1.1
13855
90-
91 for (l2 = j = 0; j < num
j < numDescription
TRUEevaluated 81218 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13855 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
13855-81218
92 if (!gs_doit[j & 3]
!gs_doit[j & 3]Description
TRUEnever evaluated
FALSEevaluated 81218 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-81218
93 continue;
never executed: continue;
0
94 l2++;-
95-
96 if ((
(q[j] < ' ')Description
TRUEevaluated 8900 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 72318 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
q[j] < ' ')
(q[j] < ' ')Description
TRUEevaluated 8900 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 72318 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(q[j] > '~')Description
TRUEevaluated 13285 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 59033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
q[j] > '~')
(q[j] > '~')Description
TRUEevaluated 13285 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 59033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8900-72318
97 l2 += 3;
executed 22185 times by 1 test: l2 += 3;
Executed by:
  • libcrypto.so.1.1
22185
98-
99-
100-
101-
102-
103 }
executed 81218 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
81218
104-
105 lold = l;-
106 l += 1 + l1 + 1 + l2;-
107 if (l > (1024 * 1024)
l > (1024 * 1024)Description
TRUEnever evaluated
FALSEevaluated 13855 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-13855
108 ERR_put_error(11,(116),(134),__FILE__,123);-
109 goto
never executed: goto end;
end;
never executed: goto end;
0
110 }-
111 if (b !=
b != ((void *)0)Description
TRUEevaluated 13377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 478 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
478-13377
112 ((void *)0)
b != ((void *)0)Description
TRUEevaluated 13377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 478 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
478-13377
113 ) {-
114 if (!BUF_MEM_grow(b, l + 1)
!BUF_MEM_grow(b, l + 1)Description
TRUEnever evaluated
FALSEevaluated 13377 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-13377
115 goto
never executed: goto err;
err;
never executed: goto err;
0
116 p = &(b->data[lold]);-
117 }
executed 13377 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (l > len
l > lenDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 475 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3-13377
118 break;
executed 3 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
3
119 } else-
120 p = &(buf[lold]);
executed 475 times by 1 test: p = &(buf[lold]);
Executed by:
  • libcrypto.so.1.1
475
121 *(p++) = '/';-
122 memcpy(p, s, (unsigned int)l1);-
123 p += l1;-
124 *(p++) = '=';-
125-
126-
127 q = ne->value->data;-
128-
129-
130 for (j = 0; j < num
j < numDescription
TRUEevaluated 81106 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13852 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
13852-81106
131 if (!gs_doit[j & 3]
!gs_doit[j & 3]Description
TRUEnever evaluated
FALSEevaluated 81106 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-81106
132 continue;
never executed: continue;
0
133-
134 n = q[j];-
135 if ((
(n < ' ')Description
TRUEevaluated 8855 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 72251 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n < ' ')
(n < ' ')Description
TRUEevaluated 8855 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 72251 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(n > '~')Description
TRUEevaluated 13274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 58977 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n > '~')
(n > '~')Description
TRUEevaluated 13274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 58977 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8855-72251
136 *(p++) = '\\';-
137 *(p++) = 'x';-
138 *(p++) = hex[(n >> 4) & 0x0f];-
139 *(p++) = hex[n & 0x0f];-
140 }
executed 22129 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
22129
141 *(
executed 58977 times by 1 test: *(p++) = n;
Executed by:
  • libcrypto.so.1.1
p++) = n;
executed 58977 times by 1 test: *(p++) = n;
Executed by:
  • libcrypto.so.1.1
58977
142 }-
143 *p = '\0';-
144 }
executed 13852 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
13852
145 if (b !=
b != ((void *)0)Description
TRUEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 471 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
471-5798
146 ((void *)0)
b != ((void *)0)Description
TRUEevaluated 5798 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 471 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
471-5798
147 ) {-
148 p = b->data;-
149 CRYPTO_free(b, __FILE__, 170);-
150 }
executed 5798 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
5798
151 p = buf;
executed 471 times by 1 test: p = buf;
Executed by:
  • libcrypto.so.1.1
471
152 if (i == 0
i == 0Description
TRUEevaluated 4242 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2027 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2027-4242
153 *
executed 4242 times by 1 test: *p = '\0';
Executed by:
  • libcrypto.so.1.1
p = '\0';
executed 4242 times by 1 test: *p = '\0';
Executed by:
  • libcrypto.so.1.1
4242
154 return
executed 6269 times by 1 test: return p;
Executed by:
  • libcrypto.so.1.1
p;
executed 6269 times by 1 test: return p;
Executed by:
  • libcrypto.so.1.1
6269
155 err:-
156 ERR_put_error(11,(116),((1|64)),__FILE__,177);-
157 end:
code before this statement never executed: end:
0
158 BUF_MEM_free(b);-
159 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
160 ((void *)0)
never executed: return ((void *)0) ;
0
161 ;
never executed: return ((void *)0) ;
0
162}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2