diff options
Diffstat (limited to 'src/lib/libcrypto/man/CMS_signed_add1_attr.3')
-rw-r--r-- | src/lib/libcrypto/man/CMS_signed_add1_attr.3 | 360 |
1 files changed, 0 insertions, 360 deletions
diff --git a/src/lib/libcrypto/man/CMS_signed_add1_attr.3 b/src/lib/libcrypto/man/CMS_signed_add1_attr.3 deleted file mode 100644 index 1a50c0b9d1..0000000000 --- a/src/lib/libcrypto/man/CMS_signed_add1_attr.3 +++ /dev/null | |||
@@ -1,360 +0,0 @@ | |||
1 | .\" $OpenBSD: CMS_signed_add1_attr.3,v 1.5 2024/09/02 07:54:21 tb Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2024 Job Snijders <job@openbsd.org> | ||
4 | .\" Copyright (c) 2024 Theo Buehler <tb@openbsd.org> | ||
5 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | ||
6 | .\" | ||
7 | .\" Permission to use, copy, modify, and distribute this software for any | ||
8 | .\" purpose with or without fee is hereby granted, provided that the above | ||
9 | .\" copyright notice and this permission notice appear in all copies. | ||
10 | .\" | ||
11 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
12 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
13 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
14 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
15 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
16 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
17 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
18 | .\" | ||
19 | .Dd $Mdocdate: September 2 2024 $ | ||
20 | .Dt CMS_SIGNED_ADD1_ATTR 3 | ||
21 | .Os | ||
22 | .Sh NAME | ||
23 | .Nm CMS_signed_add1_attr , | ||
24 | .Nm CMS_signed_add1_attr_by_NID , | ||
25 | .Nm CMS_signed_add1_attr_by_OBJ , | ||
26 | .Nm CMS_signed_add1_attr_by_txt , | ||
27 | .Nm CMS_signed_delete_attr , | ||
28 | .Nm CMS_signed_get0_data_by_OBJ , | ||
29 | .Nm CMS_signed_get_attr , | ||
30 | .Nm CMS_signed_get_attr_by_NID , | ||
31 | .Nm CMS_signed_get_attr_by_OBJ , | ||
32 | .Nm CMS_signed_get_attr_count , | ||
33 | .Nm CMS_unsigned_add1_attr , | ||
34 | .Nm CMS_unsigned_add1_attr_by_NID , | ||
35 | .Nm CMS_unsigned_add1_attr_by_OBJ , | ||
36 | .Nm CMS_unsigned_add1_attr_by_txt , | ||
37 | .Nm CMS_unsigned_delete_attr , | ||
38 | .Nm CMS_unsigned_get0_data_by_OBJ , | ||
39 | .Nm CMS_unsigned_get_attr , | ||
40 | .Nm CMS_unsigned_get_attr_by_NID , | ||
41 | .Nm CMS_unsigned_get_attr_by_OBJ , | ||
42 | .Nm CMS_unsigned_get_attr_count | ||
43 | .Nd change signed and unsigned attributes of a CMS SignerInfo object | ||
44 | .Sh SYNOPSIS | ||
45 | .In openssl/cms.h | ||
46 | .Ft int | ||
47 | .Fo CMS_signed_add1_attr | ||
48 | .Fa "CMS_SignerInfo *si" | ||
49 | .Fa "X509_ATTRIBUTE *attr" | ||
50 | .Fc | ||
51 | .Ft int | ||
52 | .Fo CMS_signed_add1_attr_by_NID | ||
53 | .Fa "CMS_SignerInfo *si" | ||
54 | .Fa "int nid" | ||
55 | .Fa "int type" | ||
56 | .Fa "const void *bytes" | ||
57 | .Fa "int len" | ||
58 | .Fc | ||
59 | .Ft int | ||
60 | .Fo CMS_signed_add1_attr_by_OBJ | ||
61 | .Fa "CMS_SignerInfo *si" | ||
62 | .Fa "const ASN1_OBJECT *obj" | ||
63 | .Fa "int type" | ||
64 | .Fa "const void *bytes" | ||
65 | .Fa "int len" | ||
66 | .Fc | ||
67 | .Ft int | ||
68 | .Fo CMS_signed_add1_attr_by_txt | ||
69 | .Fa "CMS_SignerInfo *si" | ||
70 | .Fa "const char *attrname" | ||
71 | .Fa "int type" | ||
72 | .Fa "const void *bytes" | ||
73 | .Fa "int len" | ||
74 | .Fc | ||
75 | .Ft "X509_ATTRIBUTE *" | ||
76 | .Fo CMS_signed_delete_attr | ||
77 | .Fa "CMS_SignerInfo *si" | ||
78 | .Fa "int loc" | ||
79 | .Fc | ||
80 | .Ft "void *" | ||
81 | .Fo CMS_signed_get0_data_by_OBJ | ||
82 | .Fa "CMS_SignerInfo *si" | ||
83 | .Fa "const ASN1_OBJECT *oid" | ||
84 | .Fa "int start_after" | ||
85 | .Fa "int type" | ||
86 | .Fc | ||
87 | .Ft "X509_ATTRIBUTE *" | ||
88 | .Fo CMS_signed_get_attr | ||
89 | .Fa "const CMS_SignerInfo *si" | ||
90 | .Fa "int loc" | ||
91 | .Fc | ||
92 | .Ft int | ||
93 | .Fo CMS_signed_get_attr_by_NID | ||
94 | .Fa "const CMS_SignerInfo *si" | ||
95 | .Fa "int nid" | ||
96 | .Fa "int start_after" | ||
97 | .Fc | ||
98 | .Ft int | ||
99 | .Fo CMS_signed_get_attr_by_OBJ | ||
100 | .Fa "const CMS_SignerInfo *si" | ||
101 | .Fa "const ASN1_OBJECT *obj" | ||
102 | .Fa "int start_after" | ||
103 | .Fc | ||
104 | .Ft int | ||
105 | .Fo CMS_signed_get_attr_count | ||
106 | .Fa "const CMS_SignerInfo *si" | ||
107 | .Fc | ||
108 | .Ft int | ||
109 | .Fo CMS_unsigned_add1_attr | ||
110 | .Fa "CMS_SignerInfo *si" | ||
111 | .Fa "X509_ATTRIBUTE *attr" | ||
112 | .Fc | ||
113 | .Ft int | ||
114 | .Fo CMS_unsigned_add1_attr_by_NID | ||
115 | .Fa "CMS_SignerInfo *si" | ||
116 | .Fa "int nid" | ||
117 | .Fa "int type" | ||
118 | .Fa "const void *bytes" | ||
119 | .Fa "int len" | ||
120 | .Fc | ||
121 | .Ft int | ||
122 | .Fo CMS_unsigned_add1_attr_by_OBJ | ||
123 | .Fa "CMS_SignerInfo *si" | ||
124 | .Fa "const ASN1_OBJECT *obj" | ||
125 | .Fa "int type" | ||
126 | .Fa "const void *bytes" | ||
127 | .Fa "int len" | ||
128 | .Fc | ||
129 | .Ft int | ||
130 | .Fo CMS_unsigned_add1_attr_by_txt | ||
131 | .Fa "CMS_SignerInfo *si" | ||
132 | .Fa "const char *attrname" | ||
133 | .Fa "int type" | ||
134 | .Fa "const void *bytes" | ||
135 | .Fa "int len" | ||
136 | .Fc | ||
137 | .Ft "X509_ATTRIBUTE *" | ||
138 | .Fo CMS_unsigned_delete_attr | ||
139 | .Fa "CMS_SignerInfo *si" | ||
140 | .Fa "int loc" | ||
141 | .Fc | ||
142 | .Ft "void *" | ||
143 | .Fo CMS_unsigned_get0_data_by_OBJ | ||
144 | .Fa "CMS_SignerInfo *si" | ||
145 | .Fa "ASN1_OBJECT *oid" | ||
146 | .Fa "int start_after" | ||
147 | .Fa "int type" | ||
148 | .Fc | ||
149 | .Ft "X509_ATTRIBUTE *" | ||
150 | .Fo CMS_unsigned_get_attr | ||
151 | .Fa "const CMS_SignerInfo *si" | ||
152 | .Fa "int loc" | ||
153 | .Fc | ||
154 | .Ft int | ||
155 | .Fo CMS_unsigned_get_attr_by_NID | ||
156 | .Fa "const CMS_SignerInfo *si" | ||
157 | .Fa "int nid" | ||
158 | .Fa "int start_after" | ||
159 | .Fc | ||
160 | .Ft int | ||
161 | .Fo CMS_unsigned_get_attr_by_OBJ | ||
162 | .Fa "const CMS_SignerInfo *si" | ||
163 | .Fa "const ASN1_OBJECT *obj" | ||
164 | .Fa "int start_after" | ||
165 | .Fc | ||
166 | .Ft int | ||
167 | .Fo CMS_unsigned_get_attr_count | ||
168 | .Fa "const CMS_SignerInfo *si" | ||
169 | .Fc | ||
170 | .Sh DESCRIPTION | ||
171 | A | ||
172 | .Em CMS_SignerInfo | ||
173 | object has two optional sets of X.501 attributes: | ||
174 | a set of signed attributes in the | ||
175 | .Fa signedAttrs | ||
176 | array and a set of unsigned attributes in the | ||
177 | .Fa unsignedAttrs | ||
178 | array. | ||
179 | The | ||
180 | .Fn CMS_signed_* | ||
181 | and | ||
182 | .Fn CMS_unsigned_* | ||
183 | functions are similar, except | ||
184 | .Fn CMS_signed_* | ||
185 | modifies the | ||
186 | .Vt CMS_SignerInfo | ||
187 | object's set of signed attributes and | ||
188 | .Fn CMS_unsigned_* | ||
189 | modifies the | ||
190 | .Vt CMS_SignerInfo | ||
191 | object's set of unsigned attributes. | ||
192 | For brevity only the | ||
193 | .Fn CMS_signed_* | ||
194 | functions are described below. | ||
195 | .Pp | ||
196 | .Fn CMS_signed_add1_attr | ||
197 | appends a deep copy of | ||
198 | .Fa attr | ||
199 | to the | ||
200 | .Fa signedAttrs | ||
201 | array of | ||
202 | .Fa si , | ||
203 | allocating a new array if necessary. | ||
204 | .Pp | ||
205 | .Fn CMS_signed_add1_attr_by_NID , | ||
206 | .Fn CMS_signed_add1_attr_by_OBJ , | ||
207 | and | ||
208 | .Fn CMS_signed_add1_attr_by_txt | ||
209 | create a new X.501 Attribute object using | ||
210 | .Xr X509_ATTRIBUTE_create_by_NID 3 , | ||
211 | .Xr X509_ATTRIBUTE_create_by_OBJ 3 , | ||
212 | or | ||
213 | .Xr X509_ATTRIBUTE_create_by_txt 3 , | ||
214 | respectively, | ||
215 | and append it to the | ||
216 | .Fa signedAttrs | ||
217 | array of | ||
218 | .Fa si . | ||
219 | .Pp | ||
220 | .Fn CMS_signed_delete_attr | ||
221 | deletes the element with the zero-based | ||
222 | .Fa loc | ||
223 | in | ||
224 | .Fa signedAttrs | ||
225 | of | ||
226 | .Fa si . | ||
227 | .Pp | ||
228 | .Fn CMS_signed_get0_data_by_OBJ , | ||
229 | .Fn CMS_signed_get_attr_by_NID , | ||
230 | and | ||
231 | .Fn CMS_signed_get_attr_by_OBJ | ||
232 | search the array starting after the index | ||
233 | .Fa start_after . | ||
234 | They fail if no matching object is found. | ||
235 | .Fn CMS_signed_get0_data_by_OBJ | ||
236 | also fails if the data is not of the requested | ||
237 | .Fa type . | ||
238 | .Pp | ||
239 | Additionally, the | ||
240 | .Fa start_after | ||
241 | argument of | ||
242 | .Fn CMS_signed_get0_data_by_OBJ | ||
243 | is interpreted in a special way. | ||
244 | If | ||
245 | .Fa start_after | ||
246 | is \-2 or smaller, the function also fails if the | ||
247 | .Fa signedAttrs | ||
248 | array of | ||
249 | .Fa si , | ||
250 | contains more than one matching object. | ||
251 | If | ||
252 | .Fa start_after | ||
253 | is \-3 or smaller, it also fails unless the matching object contains exactly | ||
254 | one value. | ||
255 | .Pp | ||
256 | .Fn CMS_signed_get_attr | ||
257 | returns the array element at the zero-based | ||
258 | .Fa loc . | ||
259 | It fails if the | ||
260 | .Fa loc | ||
261 | argument is negative or greater than or equal to the number of objects in the | ||
262 | array. | ||
263 | .Pp | ||
264 | .Fn CMS_signed_get_attr_count | ||
265 | returns the number of objects currently stored in the | ||
266 | .Fa signedAttrs | ||
267 | array of | ||
268 | .Fa si . | ||
269 | .Sh RETURN VALUES | ||
270 | .Fn CMS_signed_add1_attr , | ||
271 | .Fn CMS_signed_add1_attr_by_NID , | ||
272 | .Fn CMS_signed_add1_attr_by_OBJ , | ||
273 | .Fn CMS_signed_add1_attr_by_txt , | ||
274 | .Fn CMS_unsigned_add1_attr , | ||
275 | .Fn CMS_unsigned_add1_attr_by_NID , | ||
276 | .Fn CMS_unsigned_add1_attr_by_OBJ , | ||
277 | and | ||
278 | .Fn CMS_unsigned_add1_attr_by_txt | ||
279 | return 1 for success or 0 if an error occurs. | ||
280 | .Pp | ||
281 | .Fn CMS_signed_delete_attr | ||
282 | returns the deleted element or | ||
283 | .Dv NULL | ||
284 | if the | ||
285 | .Fa signedAttrs | ||
286 | array is | ||
287 | .Dv NULL , | ||
288 | or if the requested | ||
289 | .Fa loc | ||
290 | argument is negative, or greater than or equal to the number of objects in it. | ||
291 | .Pp | ||
292 | .Fn CMS_unsigned_delete_attr | ||
293 | returns the deleted element or | ||
294 | .Dv NULL | ||
295 | if the | ||
296 | .Fa unsignedAttrs | ||
297 | array is | ||
298 | .Dv NULL , | ||
299 | or if the requested | ||
300 | .Fa loc | ||
301 | argument is negative, or greater than or equal to the number of objects in it. | ||
302 | .Pp | ||
303 | .Fn CMS_signed_get0_data_by_OBJ | ||
304 | and | ||
305 | .Fn CMS_unsigned_get0_data_by_OBJ | ||
306 | return an internal pointer to the data contained in the value of the first | ||
307 | object that has an index greater than | ||
308 | .Fa start_after | ||
309 | and a type matching | ||
310 | .Fa type , | ||
311 | or NULL on failure. | ||
312 | .Pp | ||
313 | .Fn CMS_signed_get_attr | ||
314 | and | ||
315 | .Fn CMS_unsigned_get_attr | ||
316 | return an internal pointer or NULL on failure. | ||
317 | .Pp | ||
318 | .Fn CMS_signed_get_attr_by_NID , | ||
319 | .Fn CMS_signed_get_attr_by_OBJ , | ||
320 | .Fn CMS_unsigned_get_attr_by_NID , | ||
321 | and | ||
322 | .Fn CMS_unsigned_get_attr_by_OBJ | ||
323 | return the index of the first object in the array that has an index greater than | ||
324 | .Fa start_after | ||
325 | and a type matching | ||
326 | .Fa nid | ||
327 | or | ||
328 | .Fa oid , | ||
329 | respectively, or \-1 on failure. | ||
330 | In addition, | ||
331 | .Fn CMS_signed_get_attr_by_OBJ | ||
332 | and | ||
333 | .Fn CMS_unsigned_get_attr_by_OBJ | ||
334 | return \-2 if | ||
335 | .Xr OBJ_nid2obj 3 | ||
336 | fails on the requested | ||
337 | .Fa nid . | ||
338 | .Pp | ||
339 | .Fn CMS_signed_get_attr_count | ||
340 | and | ||
341 | .Fn CMS_unsigned_get_attr_count | ||
342 | return the number of array elements or \-1 on failure. | ||
343 | .Sh SEE ALSO | ||
344 | .Xr CMS_add1_signer 3 , | ||
345 | .Xr CMS_ContentInfo_new 3 , | ||
346 | .Xr CMS_get0_SignerInfos 3 , | ||
347 | .Xr OBJ_nid2obj 3 , | ||
348 | .Xr X509_ATTRIBUTE_create_by_OBJ 3 , | ||
349 | .Xr X509_ATTRIBUTE_new 3 | ||
350 | .Sh STANDARDS | ||
351 | RFC 5652: Cryptographic Message Syntax (CMS) | ||
352 | .Bl -dash -compact -offset indent | ||
353 | .It | ||
354 | section 5.3: SignerInfo Type | ||
355 | .It | ||
356 | section 11: Useful Attributes | ||
357 | .El | ||
358 | .Sh HISTORY | ||
359 | These functions first appeared in OpenSSL 0.9.9 and have been available since | ||
360 | .Ox 6.6 . | ||