diff options
author | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
commit | eb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch) | |
tree | edb6da6af7e865d488dc1a29309f1e1ec226e603 /src/lib/libcrypto/man/CMS_verify.3 | |
parent | 247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff) | |
download | openbsd-tb_20250414.tar.gz openbsd-tb_20250414.tar.bz2 openbsd-tb_20250414.zip |
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to 'src/lib/libcrypto/man/CMS_verify.3')
-rw-r--r-- | src/lib/libcrypto/man/CMS_verify.3 | 230 |
1 files changed, 0 insertions, 230 deletions
diff --git a/src/lib/libcrypto/man/CMS_verify.3 b/src/lib/libcrypto/man/CMS_verify.3 deleted file mode 100644 index 63f1b8bb18..0000000000 --- a/src/lib/libcrypto/man/CMS_verify.3 +++ /dev/null | |||
@@ -1,230 +0,0 @@ | |||
1 | .\" $OpenBSD: CMS_verify.3,v 1.10 2024/03/29 06:43:12 tb Exp $ | ||
2 | .\" full merge up to: OpenSSL 35fd9953 May 28 14:49:38 2019 +0200 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2008 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: March 29 2024 $ | ||
52 | .Dt CMS_VERIFY 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_verify , | ||
56 | .Nm CMS_get0_signers | ||
57 | .Nd verify a CMS SignedData structure | ||
58 | .Sh SYNOPSIS | ||
59 | .In openssl/cms.h | ||
60 | .Ft int | ||
61 | .Fo CMS_verify | ||
62 | .Fa "CMS_ContentInfo *cms" | ||
63 | .Fa "STACK_OF(X509) *certs" | ||
64 | .Fa "X509_STORE *store" | ||
65 | .Fa "BIO *indata" | ||
66 | .Fa "BIO *out" | ||
67 | .Fa "unsigned int flags" | ||
68 | .Fc | ||
69 | .Ft STACK_OF(X509) * | ||
70 | .Fo CMS_get0_signers | ||
71 | .Fa "CMS_ContentInfo *cms" | ||
72 | .Fc | ||
73 | .Sh DESCRIPTION | ||
74 | .Fn CMS_verify | ||
75 | verifies the CMS | ||
76 | .Vt SignedData | ||
77 | structure | ||
78 | .Fa cms . | ||
79 | .Fa certs | ||
80 | is a set of certificates in which to search for the signing | ||
81 | certificate(s). | ||
82 | .Fa store | ||
83 | is a trusted certificate store used for chain verification. | ||
84 | .Fa indata | ||
85 | is the detached content if the content is not present in | ||
86 | .Fa cms . | ||
87 | The content is written to | ||
88 | .Fa out | ||
89 | if it is not | ||
90 | .Dv NULL . | ||
91 | .Pp | ||
92 | .Fn CMS_get0_signers | ||
93 | retrieves the signing certificate(s) from | ||
94 | .Fa cms . | ||
95 | It may only be called after a successful | ||
96 | .Fn CMS_verify | ||
97 | operation. | ||
98 | The signers must be freed with | ||
99 | .Fn sk_X509_free . | ||
100 | .Pp | ||
101 | Normally the verify process proceeds as follows. | ||
102 | .Pp | ||
103 | Initially some sanity checks are performed on | ||
104 | .Fa cms . | ||
105 | There must be at least one signature on the data. | ||
106 | If the content is detached, | ||
107 | .Fa indata | ||
108 | cannot be | ||
109 | .Dv NULL . | ||
110 | .Pp | ||
111 | An attempt is made to locate all the signing certificate(s), first | ||
112 | looking in the | ||
113 | .Fa certs | ||
114 | parameter (if it is not | ||
115 | .Dv NULL ) | ||
116 | and then looking in any certificates contained in the | ||
117 | .Fa cms | ||
118 | structure itself. | ||
119 | If any signing certificate cannot be located, the operation fails. | ||
120 | .Pp | ||
121 | Each signing certificate is chain verified using the | ||
122 | .Sy smimesign | ||
123 | purpose and the supplied trusted certificate | ||
124 | .Fa store . | ||
125 | Any internal certificates in the message are used as untrusted CAs. | ||
126 | If CRL checking is enabled in | ||
127 | .Fa store , | ||
128 | any internal CRLs are used in addition to attempting to look them up in | ||
129 | .Fa store . | ||
130 | If any chain verify fails, an error code is returned. | ||
131 | .Pp | ||
132 | Finally the signed content is read (and written to | ||
133 | .Fa out | ||
134 | if it is not | ||
135 | .Dv NULL ) | ||
136 | and the signature is checked. | ||
137 | .Pp | ||
138 | If all signatures verify correctly, then the function is successful. | ||
139 | .Pp | ||
140 | Any of the following | ||
141 | .Fa flags | ||
142 | (OR'ed together) can be passed to change the default verify behaviour: | ||
143 | .Bl -tag -width Ds | ||
144 | .It Dv CMS_NOINTERN | ||
145 | Do not use the certificates in the message itself when | ||
146 | locating the signing certificate(s). | ||
147 | This means that all the signing certificates must be in the | ||
148 | .Fa certs | ||
149 | parameter. | ||
150 | .It Dv CMS_NOCRL | ||
151 | If CRL checking is enabled in | ||
152 | .Fa store , | ||
153 | then any CRLs in the message itself are ignored. | ||
154 | .It Dv CMS_TEXT | ||
155 | MIME headers for type text/plain are deleted from the content. | ||
156 | If the content is not of type text/plain, an error is returned. | ||
157 | .It Dv CMS_NO_SIGNER_CERT_VERIFY | ||
158 | Do not verify signing certificates. | ||
159 | .It Dv CMS_NO_ATTR_VERIFY | ||
160 | Do not check the signed attributes signature. | ||
161 | .It Dv CMS_NO_CONTENT_VERIFY | ||
162 | Do not check the content digest. | ||
163 | .El | ||
164 | .Pp | ||
165 | One application of | ||
166 | .Dv CMS_NOINTERN | ||
167 | is to only accept messages signed by a small number of certificates. | ||
168 | The acceptable certificates would be passed in the | ||
169 | .Fa certs | ||
170 | parameter. | ||
171 | In this case, if the signer is not one of the certificates supplied in | ||
172 | .Fa certs , | ||
173 | then the verify will fail because the signer cannot be found. | ||
174 | .Pp | ||
175 | In some cases the standard techniques for looking up and validating | ||
176 | certificates are not appropriate: for example an application may wish to | ||
177 | lookup certificates in a database or perform customised verification. | ||
178 | This can be achieved by setting and verifying the signers certificates | ||
179 | manually using the signed data utility functions. | ||
180 | .Pp | ||
181 | Care should be taken when modifying the default verify behaviour, for | ||
182 | example setting | ||
183 | .Dv CMS_NO_CONTENT_VERIFY | ||
184 | will totally disable all content verification and any modified content | ||
185 | will be considered valid. | ||
186 | This combination is however useful if one merely wishes to write the | ||
187 | content to | ||
188 | .Fa out | ||
189 | and its validity is not considered important. | ||
190 | .Pp | ||
191 | Chain verification should arguably be performed using the signing time | ||
192 | rather than the current time. | ||
193 | However since the signing time is supplied by the signer it cannot be | ||
194 | trusted without additional evidence (such as a trusted timestamp). | ||
195 | .Sh RETURN VALUES | ||
196 | .Fn CMS_verify | ||
197 | returns 1 for a successful verification or 0 if an error occurred. | ||
198 | .Pp | ||
199 | .Fn CMS_get0_signers | ||
200 | returns all signers or | ||
201 | .Dv NULL | ||
202 | if an error occurred. | ||
203 | The signers must be freed with | ||
204 | .Fn sk_X509_free . | ||
205 | .Pp | ||
206 | The error can be obtained from | ||
207 | .Xr ERR_get_error 3 . | ||
208 | .Sh SEE ALSO | ||
209 | .Xr CMS_ContentInfo_new 3 , | ||
210 | .Xr CMS_get0_SignerInfos 3 , | ||
211 | .Xr CMS_sign 3 , | ||
212 | .Xr CMS_verify_receipt 3 | ||
213 | .Sh STANDARDS | ||
214 | RFC 5652: Cryptographic Message Syntax (CMS), | ||
215 | section 5.1: SignedData Type | ||
216 | .Pp | ||
217 | RFC 8419: Use of Edwards-Curve Digital Signature Algorithm (EdDSA) Signatures | ||
218 | in the Cryptographic Message Syntax (CMS) | ||
219 | .Sh HISTORY | ||
220 | These functions first appeared in OpenSSL 0.9.8h | ||
221 | and have been available since | ||
222 | .Ox 6.7 . | ||
223 | .Sh BUGS | ||
224 | The trusted certificate store is not searched for the signing certificate. | ||
225 | This is primarily due to the inadequacies of the current | ||
226 | .Vt X509_STORE | ||
227 | functionality. | ||
228 | .Pp | ||
229 | The lack of single pass processing means that the signed content must | ||
230 | all be held in memory if it is not detached. | ||