OpenCoverage

x_req.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/asn1/x_req.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2static int-
3rinf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)-
4{-
5 X509_REQ_INFO *rinf = (X509_REQ_INFO *)*pval;-
6-
7 if (operation == 1
operation == 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
) {
2-6
8 rinf->attributes = ((struct stack_st_X509_ATTRIBUTE *)sk_new_null());-
9 if (!rinf->attributes
!rinf->attributesDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
)
0-2
10 return
never executed: return 0;
0;
never executed: return 0;
0
11 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.44.0.1
2
12 return
executed 8 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.1
1;
executed 8 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.1
8
13}-
14-
15static const ASN1_AUX X509_REQ_INFO_aux = {-
16 .flags = 2,-
17 .asn1_cb = rinf_cb,-
18 .enc_offset = -
19 __builtin_offsetof (-
20 X509_REQ_INFO-
21 , -
22 enc-
23 )-
24 ,-
25};-
26static const ASN1_TEMPLATE X509_REQ_INFO_seq_tt[] = {-
27 {-
28 .offset = -
29 __builtin_offsetof (-
30 X509_REQ_INFO-
31 , -
32 version-
33 )-
34 ,-
35 .field_name = "version",-
36 .item = &ASN1_INTEGER_it,-
37 },-
38 {-
39 .offset = -
40 __builtin_offsetof (-
41 X509_REQ_INFO-
42 , -
43 subject-
44 )-
45 ,-
46 .field_name = "subject",-
47 .item = &X509_NAME_it,-
48 },-
49 {-
50 .offset = -
51 __builtin_offsetof (-
52 X509_REQ_INFO-
53 , -
54 pubkey-
55 )-
56 ,-
57 .field_name = "pubkey",-
58 .item = &X509_PUBKEY_it,-
59 },-
60-
61-
62-
63 {-
64 .flags = (0x1 << 3)|(0x2<<6) | (0x1 << 1) | (0x1),-
65 .offset = -
66 __builtin_offsetof (-
67 X509_REQ_INFO-
68 , -
69 attributes-
70 )-
71 ,-
72 .field_name = "attributes",-
73 .item = &X509_ATTRIBUTE_it,-
74 },-
75};-
76-
77const ASN1_ITEM X509_REQ_INFO_it = {-
78 .itype = 0x1,-
79 .utype = 16,-
80 .templates = X509_REQ_INFO_seq_tt,-
81 .tcount = sizeof(X509_REQ_INFO_seq_tt) / sizeof(ASN1_TEMPLATE),-
82 .funcs = &X509_REQ_INFO_aux,-
83 .size = sizeof(X509_REQ_INFO),-
84 .sname = "X509_REQ_INFO",-
85};-
86-
87-
88X509_REQ_INFO *-
89d2i_X509_REQ_INFO(X509_REQ_INFO **a, const unsigned char **in, long len)-
90{-
91 return
never executed: return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_INFO_it);
(X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
never executed: return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_INFO_it);
0
92 &X509_REQ_INFO_it);
never executed: return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_INFO_it);
0
93}-
94-
95int-
96i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **out)-
97{-
98 return
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_INFO_it);
ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_INFO_it);
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_INFO_it);
0
99}-
100-
101X509_REQ_INFO *-
102X509_REQ_INFO_new(void)-
103{-
104 return
never executed: return (X509_REQ_INFO *)ASN1_item_new(&X509_REQ_INFO_it);
(X509_REQ_INFO *)ASN1_item_new(&X509_REQ_INFO_it);
never executed: return (X509_REQ_INFO *)ASN1_item_new(&X509_REQ_INFO_it);
0
105}-
106-
107void-
108X509_REQ_INFO_free(X509_REQ_INFO *a)-
109{-
110 ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_INFO_it);-
111}
executed 1 time by 1 test: end of block
Executed by:
  • freenull
1
112-
113static const ASN1_AUX X509_REQ_aux = {-
114 .app_data = -
115 ((void *)0)-
116 ,-
117 .flags = 1,-
118 .ref_offset = -
119 __builtin_offsetof (-
120 X509_REQ-
121 , -
122 references-
123 )-
124 ,-
125 .ref_lock = 7,-
126};-
127static const ASN1_TEMPLATE X509_REQ_seq_tt[] = {-
128 {-
129 .offset = -
130 __builtin_offsetof (-
131 X509_REQ-
132 , -
133 req_info-
134 )-
135 ,-
136 .field_name = "req_info",-
137 .item = &X509_REQ_INFO_it,-
138 },-
139 {-
140 .offset = -
141 __builtin_offsetof (-
142 X509_REQ-
143 , -
144 sig_alg-
145 )-
146 ,-
147 .field_name = "sig_alg",-
148 .item = &X509_ALGOR_it,-
149 },-
150 {-
151 .offset = -
152 __builtin_offsetof (-
153 X509_REQ-
154 , -
155 signature-
156 )-
157 ,-
158 .field_name = "signature",-
159 .item = &ASN1_BIT_STRING_it,-
160 },-
161};-
162-
163const ASN1_ITEM X509_REQ_it = {-
164 .itype = 0x1,-
165 .utype = 16,-
166 .templates = X509_REQ_seq_tt,-
167 .tcount = sizeof(X509_REQ_seq_tt) / sizeof(ASN1_TEMPLATE),-
168 .funcs = &X509_REQ_aux,-
169 .size = sizeof(X509_REQ),-
170 .sname = "X509_REQ",-
171};-
172-
173-
174X509_REQ *-
175d2i_X509_REQ(X509_REQ **a, const unsigned char **in, long len)-
176{-
177 return
never executed: return (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_it);
(X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
never executed: return (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_it);
0
178 &X509_REQ_it);
never executed: return (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_it);
0
179}-
180-
181int-
182i2d_X509_REQ(X509_REQ *a, unsigned char **out)-
183{-
184 return
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_it);
ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_it);
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_it);
0
185}-
186-
187X509_REQ *-
188X509_REQ_new(void)-
189{-
190 return
executed 2 times by 1 test: return (X509_REQ *)ASN1_item_new(&X509_REQ_it);
Executed by:
  • libcrypto.so.44.0.1
(X509_REQ *)ASN1_item_new(&X509_REQ_it);
executed 2 times by 1 test: return (X509_REQ *)ASN1_item_new(&X509_REQ_it);
Executed by:
  • libcrypto.so.44.0.1
2
191}-
192-
193void-
194X509_REQ_free(X509_REQ *a)-
195{-
196 ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_it);-
197}
executed 9 times by 2 tests: end of block
Executed by:
  • freenull
  • libcrypto.so.44.0.1
9
198-
199X509_REQ *-
200X509_REQ_dup(X509_REQ *x)-
201{-
202 return
never executed: return ASN1_item_dup(&X509_REQ_it, x);
ASN1_item_dup(&X509_REQ_it, x);
never executed: return ASN1_item_dup(&X509_REQ_it, x);
0
203}-
204-
205int-
206X509_REQ_get_signature_nid(const X509_REQ *req)-
207{-
208 return
never executed: return OBJ_obj2nid(req->sig_alg->algorithm);
OBJ_obj2nid(req->sig_alg->algorithm);
never executed: return OBJ_obj2nid(req->sig_alg->algorithm);
0
209}-
210-
211void-
212X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,-
213 const X509_ALGOR **palg)-
214{-
215 if (psig !=
psig != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
216 ((void *)0)
psig != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
217 )-
218 *
never executed: *psig = req->signature;
psig = req->signature;
never executed: *psig = req->signature;
0
219 if (palg !=
palg != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
220 ((void *)0)
palg != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
221 )-
222 *
never executed: *palg = req->sig_alg;
palg = req->sig_alg;
never executed: *palg = req->sig_alg;
0
223}
never executed: end of block
0
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2