diff options
Diffstat (limited to 'src/lib/libcrypto/man/PKCS7_dataFinal.3')
-rw-r--r-- | src/lib/libcrypto/man/PKCS7_dataFinal.3 | 158 |
1 files changed, 0 insertions, 158 deletions
diff --git a/src/lib/libcrypto/man/PKCS7_dataFinal.3 b/src/lib/libcrypto/man/PKCS7_dataFinal.3 deleted file mode 100644 index 1a01b2ff61..0000000000 --- a/src/lib/libcrypto/man/PKCS7_dataFinal.3 +++ /dev/null | |||
@@ -1,158 +0,0 @@ | |||
1 | .\" $OpenBSD: PKCS7_dataFinal.3,v 1.3 2022/12/26 07:18:52 jmc Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org> | ||
4 | .\" | ||
5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
7 | .\" copyright notice and this permission notice appear in all copies. | ||
8 | .\" | ||
9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | .\" | ||
17 | .Dd $Mdocdate: December 26 2022 $ | ||
18 | .Dt PKCS7_DATAFINAL 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm PKCS7_dataFinal | ||
22 | .Nd move data from a BIO chain to a ContentInfo object | ||
23 | .Sh SYNOPSIS | ||
24 | .In openssl/pkcs7.h | ||
25 | .Ft int | ||
26 | .Fo PKCS7_dataFinal | ||
27 | .Fa "PKCS7 *p7" | ||
28 | .Fa "BIO *chain" | ||
29 | .Fc | ||
30 | .Sh DESCRIPTION | ||
31 | .Fn PKCS7_dataFinal | ||
32 | transfers the data from the memory BIO at the end of the given | ||
33 | .Fa chain | ||
34 | into the appropriate content field of | ||
35 | .Fa p7 | ||
36 | itself or of its appropriate substructure. | ||
37 | It is typically used as the final step of populating | ||
38 | .Fa p7 , | ||
39 | after creating the | ||
40 | .Fa chain | ||
41 | with | ||
42 | .Xr PKCS7_dataInit 3 | ||
43 | and after writing the data into it. | ||
44 | .Pp | ||
45 | After calling | ||
46 | .Fn PKCS7_dataFinal , | ||
47 | the program can call | ||
48 | .Xr BIO_free_all 3 | ||
49 | on the | ||
50 | .Fa chain | ||
51 | because such chains are not designed for reuse. | ||
52 | .Pp | ||
53 | Depending on the | ||
54 | .Fa contentType | ||
55 | of | ||
56 | .Fa p7 , | ||
57 | .Fn PKCS7_dataFinal | ||
58 | sets the following fields: | ||
59 | .Bl -tag -width Ds | ||
60 | .It for Vt SignedData No or Vt DigestedData : | ||
61 | in substructures of the | ||
62 | .Fa content | ||
63 | field of | ||
64 | .Fa p7 : | ||
65 | the | ||
66 | .Fa content | ||
67 | field in the | ||
68 | .Vt ContentInfo | ||
69 | structure (unless | ||
70 | .Fa p7 | ||
71 | is configured to store a detached signature) and the | ||
72 | .Fa encryptedDigest | ||
73 | fields in all the | ||
74 | .Vt SignerInfo | ||
75 | structures | ||
76 | .It for Vt EnvelopedData No or Vt SignedAndEnvelopedData : | ||
77 | the | ||
78 | .Fa encryptedContent | ||
79 | field in the | ||
80 | .Vt EncryptedContentInfo | ||
81 | structure contained in the | ||
82 | .Fa content | ||
83 | field of | ||
84 | .Fa p7 | ||
85 | .It for arbitrary data : | ||
86 | the | ||
87 | .Fa content | ||
88 | field of | ||
89 | .Fa p7 | ||
90 | itself | ||
91 | .El | ||
92 | .Sh RETURN VALUES | ||
93 | .Fn PKCS7_dataFinal | ||
94 | returns 1 on success or 0 on failure. | ||
95 | .Pp | ||
96 | Possible reasons for failure include: | ||
97 | .Pp | ||
98 | .Bl -dash -compact -offset 2n -width 1n | ||
99 | .It | ||
100 | .Fa p7 | ||
101 | is | ||
102 | .Dv NULL . | ||
103 | .It | ||
104 | The | ||
105 | .Fa content | ||
106 | field of | ||
107 | .Fa p7 | ||
108 | is empty. | ||
109 | .It | ||
110 | The | ||
111 | .Fa contentType | ||
112 | of | ||
113 | .Fa p7 | ||
114 | is unsupported. | ||
115 | .It | ||
116 | The | ||
117 | .Fa chain | ||
118 | does not contain the expected memory BIO. | ||
119 | .It | ||
120 | Signing or digesting is requested and | ||
121 | .Fa p7 | ||
122 | is not configured to store a detached signature, | ||
123 | but does not contain the required field to store the content either. | ||
124 | .It | ||
125 | At least one signer lacks a usable digest algorithm. | ||
126 | .It | ||
127 | Signing or digesting fails. | ||
128 | .It | ||
129 | Memory allocation fails. | ||
130 | .El | ||
131 | .Pp | ||
132 | Signers lacking private keys do not cause failure | ||
133 | but are silently skipped. | ||
134 | .Sh SEE ALSO | ||
135 | .Xr BIO_new 3 , | ||
136 | .Xr PKCS7_dataInit 3 , | ||
137 | .Xr PKCS7_final 3 , | ||
138 | .Xr PKCS7_new 3 , | ||
139 | .Xr PKCS7_sign 3 | ||
140 | .Sh HISTORY | ||
141 | .Fn PKCS7_dataFinal | ||
142 | first appeared in SSLeay 0.9.1 and has been available since | ||
143 | .Ox 2.6 . | ||
144 | .Sh CAVEATS | ||
145 | This function does not support | ||
146 | .Vt EncryptedData . | ||
147 | .Pp | ||
148 | Even though this function is typically used after | ||
149 | .Xr PKCS7_dataInit 3 | ||
150 | and even though | ||
151 | .Xr PKCS7_dataInit 3 | ||
152 | also supports reading from | ||
153 | .Vt ContentInfo | ||
154 | structures that are already fully populated, do not use | ||
155 | .Fn PKCS7_dataFinal | ||
156 | on fully populated structures. | ||
157 | It is only intended for putting data into new structures | ||
158 | and it is neither needed nor suitable for reading. | ||