summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2019-08-12 15:34:41 +0000
committerschwarze <>2019-08-12 15:34:41 +0000
commit7bdd8ad6450898a3d5965f232d14c25e9e729e8f (patch)
tree42742578932fe46a04ba42cc6655b19427c85ea0 /src
parent293c857071139378e7ebb4c89b4c4feb0333df9a (diff)
downloadopenbsd-7bdd8ad6450898a3d5965f232d14c25e9e729e8f.tar.gz
openbsd-7bdd8ad6450898a3d5965f232d14c25e9e729e8f.tar.bz2
openbsd-7bdd8ad6450898a3d5965f232d14c25e9e729e8f.zip
Fix .Xrs to non-existant pages by correcting the misspelled function
names and documenting these two functions, CMS_decrypt_set1_pkey(3) and CMS_decrypt_set1_key(3) right here in this same page. While here, simplify and improve some wording.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/CMS_decrypt.3126
1 files changed, 83 insertions, 43 deletions
diff --git a/src/lib/libcrypto/man/CMS_decrypt.3 b/src/lib/libcrypto/man/CMS_decrypt.3
index 5433411a39..5596aadcc2 100644
--- a/src/lib/libcrypto/man/CMS_decrypt.3
+++ b/src/lib/libcrypto/man/CMS_decrypt.3
@@ -1,7 +1,24 @@
1.\" $OpenBSD: CMS_decrypt.3,v 1.4 2019/08/11 12:46:38 schwarze Exp $ 1.\" $OpenBSD: CMS_decrypt.3,v 1.5 2019/08/12 15:34:41 schwarze Exp $
2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2008, 2014 The OpenSSL Project. All rights reserved. 22.\" Copyright (c) 2008, 2014 The OpenSSL Project. All rights reserved.
6.\" 23.\"
7.\" Redistribution and use in source and binary forms, with or without 24.\" Redistribution and use in source and binary forms, with or without
@@ -48,36 +65,49 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 67.\"
51.Dd $Mdocdate: August 11 2019 $ 68.Dd $Mdocdate: August 12 2019 $
52.Dt CMS_DECRYPT 3 69.Dt CMS_DECRYPT 3
53.Os 70.Os
54.Sh NAME 71.Sh NAME
55.Nm CMS_decrypt 72.Nm CMS_decrypt ,
73.Nm CMS_decrypt_set1_pkey ,
74.Nm CMS_decrypt_set1_key
56.Nd decrypt content from a CMS envelopedData structure 75.Nd decrypt content from a CMS envelopedData structure
57.Sh SYNOPSIS 76.Sh SYNOPSIS
58.In openssl/cms.h 77.In openssl/cms.h
59.Ft int 78.Ft int
60.Fo CMS_decrypt 79.Fo CMS_decrypt
61.Fa "CMS_ContentInfo *cms" 80.Fa "CMS_ContentInfo *cms"
62.Fa "EVP_PKEY *pkey" 81.Fa "EVP_PKEY *private_key"
63.Fa "X509 *cert" 82.Fa "X509 *certificate"
64.Fa "BIO *dcont" 83.Fa "BIO *dcont"
65.Fa "BIO *out" 84.Fa "BIO *out"
66.Fa "unsigned int flags" 85.Fa "unsigned int flags"
67.Fc 86.Fc
87.Ft int
88.Fo CMS_decrypt_set1_pkey
89.Fa "CMS_ContentInfo *cms"
90.Fa "EVP_PKEY *private_key"
91.Fa "X509 *certificate"
92.Fc
93.Ft int
94.Fo CMS_decrypt_set1_key
95.Fa "CMS_ContentInfo *cms"
96.Fa "unsigned char *symmetric_key"
97.Fa "size_t keylen"
98.Fa "const unsigned char *id"
99.Fa "size_t idlen"
100.Fc
68.Sh DESCRIPTION 101.Sh DESCRIPTION
69.Fn CMS_decrypt 102.Fn CMS_decrypt
70extracts and decrypts the content from a CMS EnvelopedData structure. 103extracts and decrypts the content from a CMS EnvelopedData structure
71.Fa pkey 104using the
72is the private key of the recipient, 105.Fa private_key
73.Fa cert 106and the
74is the recipient's certificate, 107.Fa certificate
75.Fa out 108of the recipient.
76is a 109It writes the decrypted content to
77.Vt BIO 110.Fa out .
78to write the content to and
79.Fa flags
80is an optional set of flags.
81.Pp 111.Pp
82The 112The
83.Fa dcont 113.Fa dcont
@@ -86,12 +116,13 @@ detached.
86It will normally be set to 116It will normally be set to
87.Dv NULL . 117.Dv NULL .
88.Pp 118.Pp
89Although the recipients certificate is not needed to decrypt the data it 119Although the recipient's
90is needed to locate the appropriate (of possible several) recipients in 120.Fa certificate
91the CMS structure. 121is not needed to decrypt the data, it is needed to locate the
122appropriate (of possible several) recipients in the CMS structure.
92.Pp 123.Pp
93If 124If the
94.Fa cert 125.Fa certificate
95is set to 126is set to
96.Dv NULL , 127.Dv NULL ,
97all possible recipients are tried. 128all possible recipients are tried.
@@ -116,18 +147,22 @@ Applications should use this flag with extreme caution
116especially in automated gateways as it can leave them open to attack. 147especially in automated gateways as it can leave them open to attack.
117.Pp 148.Pp
118It is possible to determine the correct recipient key by other means 149It is possible to determine the correct recipient key by other means
119(for example looking them up in a database) and setting them in the CMS 150(for example looking them up in a database) and setting them in the
151.Fa cms
120structure in advance using the CMS utility functions such as 152structure in advance using the CMS utility functions such as
121.Xr CMS_set1_pkey 3 . 153.Fn CMS_decrypt_set1_pkey .
122In this case both 154In this case both
123.Fa cert 155.Fa certificate
124and 156and
125.Fa pkey 157.Fa private_key
126should be set to 158should be set to
127.Dv NULL . 159.Dv NULL
160when calling
161.Fn CMS_decrypt
162later on.
128.Pp 163.Pp
129To process KEKRecipientInfo types, 164To process KEKRecipientInfo types,
130.Xr CMS_set1_key 3 165.Fn CMS_decrypt_set1_key
131or 166or
132.Xr CMS_RecipientInfo_set0_key 3 167.Xr CMS_RecipientInfo_set0_key 3
133and 168and
@@ -135,33 +170,38 @@ and
135should be called before 170should be called before
136.Fn CMS_decrypt 171.Fn CMS_decrypt
137and 172and
138.Fa cert 173.Fa certificate
139and 174and
140.Fa pkey 175.Fa private_key
141set to 176set to
142.Dv NULL . 177.Dv NULL
143.Pp 178when calling
144The following flags can be passed in the 179.Fn CMS_decrypt
145.Fa flags 180later on.
146parameter:
147.Pp 181.Pp
148If the 182If the
149.Dv CMS_TEXT 183.Dv CMS_TEXT
150flag is set, MIME headers for type text/plain 184bit is set in
151are deleted from the content. 185.Fa flags ,
152If the content is not of type text/plain, 186MIME headers for type text/plain are deleted from the content.
153then an error is returned. 187If the content is not of type text/plain, an error occurs.
154.Sh RETURN VALUES 188.Sh RETURN VALUES
155.Fn CMS_decrypt 189.Fn CMS_decrypt ,
156returns either 1 for success or 0 for failure. 190.Fn CMS_decrypt_set1_pkey ,
191and
192.Fn CMS_decrypt_set1_key
193return 1 for success or 0 for failure.
157The error can be obtained from 194The error can be obtained from
158.Xr ERR_get_error 3 . 195.Xr ERR_get_error 3 .
159.Sh SEE ALSO 196.Sh SEE ALSO
160.Xr CMS_encrypt 3 197.Xr CMS_encrypt 3
161.Sh HISTORY 198.Sh HISTORY
162.Fn CMS_decrypt 199.Fn CMS_decrypt ,
200.Fn CMS_decrypt_set1_pkey ,
201and
202.Fn CMS_decrypt_set1_key
163first appeared in OpenSSL 0.9.8h 203first appeared in OpenSSL 0.9.8h
164and has been available since 204and have been available since
165.Ox 6.6 . 205.Ox 6.6 .
166.Sh BUGS 206.Sh BUGS
167The lack of single pass processing and the need to hold all data in 207The lack of single pass processing and the need to hold all data in