summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2019-08-18 13:02:37 +0000
committerschwarze <>2019-08-18 13:02:37 +0000
commit8a79ec8f52f3e43d1ab8742cfab42dd56371e58b (patch)
tree0658a4d38515e513e616fbeacc27ff4764a33c43 /src
parent0fc04f9f313a0675c6689b0b146c615e2005c6d8 (diff)
downloadopenbsd-8a79ec8f52f3e43d1ab8742cfab42dd56371e58b.tar.gz
openbsd-8a79ec8f52f3e43d1ab8742cfab42dd56371e58b.tar.bz2
openbsd-8a79ec8f52f3e43d1ab8742cfab42dd56371e58b.zip
minor cleanup:
* avoid jumping back and forth between use cases * delete duplicate information * and minor wording improvements
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/SMIME_read_CMS.350
-rw-r--r--src/lib/libcrypto/man/SMIME_write_CMS.350
2 files changed, 37 insertions, 63 deletions
diff --git a/src/lib/libcrypto/man/SMIME_read_CMS.3 b/src/lib/libcrypto/man/SMIME_read_CMS.3
index 94bce42390..af2facf129 100644
--- a/src/lib/libcrypto/man/SMIME_read_CMS.3
+++ b/src/lib/libcrypto/man/SMIME_read_CMS.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: SMIME_read_CMS.3,v 1.3 2019/08/12 16:00:05 schwarze Exp $ 1.\" $OpenBSD: SMIME_read_CMS.3,v 1.4 2019/08/18 13:02:37 schwarze Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: August 12 2019 $ 51.Dd $Mdocdate: August 18 2019 $
52.Dt SMIME_READ_CMS 3 52.Dt SMIME_READ_CMS 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -63,40 +63,22 @@
63.Fc 63.Fc
64.Sh DESCRIPTION 64.Sh DESCRIPTION
65.Fn SMIME_read_CMS 65.Fn SMIME_read_CMS
66parses a message in S/MIME format. 66parses a message in S/MIME format from
67.Fa in .
67.Pp 68.Pp
68.Fa in 69If the message uses cleartext signing, the content is saved in a memory BIO
69is a
70.Vt BIO
71to read the message from.
72.Pp
73If cleartext signing is used, then the content is saved in a memory BIO
74which is written to 70which is written to
75.Pf * Fa bcont ;
76otherwise
77.Pf * Fa bcont
78is set to
79.Dv NULL .
80.Pp
81The parsed
82.Vt CMS_ContentInfo
83structure is returned, or
84.Dv NULL
85if an error occurred.
86.Pp
87If
88.Pf * Fa bcont 71.Pf * Fa bcont
89is not 72and which can then be passed to
90.Dv NULL ,
91then the message is clear text signed.
92.Pf * Fa bcont
93can then be passed to
94.Xr CMS_verify 3 73.Xr CMS_verify 3
95with the 74with the
96.Dv CMS_DETACHED 75.Dv CMS_DETACHED
97flag set. 76flag set.
98.Pp 77Otherwise,
99Otherwise the type of the returned structure can be determined using 78.Pf * Fa bcont
79is set to
80.Dv NULL
81and the type of the returned structure can be determined using
100.Xr CMS_get0_type 3 . 82.Xr CMS_get0_type 3 .
101.Pp 83.Pp
102To support future functionality if 84To support future functionality if
@@ -105,13 +87,11 @@ is not
105.Dv NULL , 87.Dv NULL ,
106.Pf * Fa bcont 88.Pf * Fa bcont
107should be initialized to 89should be initialized to
108.Dv NULL . 90.Dv NULL ,
109For example: 91for example:
110.Bd -literal -offset indent 92.Bd -literal -offset indent
111BIO *cont = NULL; 93BIO *cont = NULL;
112CMS_ContentInfo *cms; 94CMS_ContentInfo *cms = SMIME_read_CMS(in, &cont);
113
114cms = SMIME_read_CMS(in, &cont);
115.Ed 95.Ed
116.Sh RETURN VALUES 96.Sh RETURN VALUES
117.Fn SMIME_read_CMS 97.Fn SMIME_read_CMS
@@ -147,5 +127,5 @@ structure is always base64 encoded and will not handle the case
147where it is in binary format or uses quoted printable format. 127where it is in binary format or uses quoted printable format.
148.Pp 128.Pp
149The use of a memory BIO to hold the signed content limits the size of 129The use of a memory BIO to hold the signed content limits the size of
150message which can be processed due to memory restraints: a streaming 130the message which can be processed due to memory restraints: a streaming
151single pass option should be available. 131single pass option should be available.
diff --git a/src/lib/libcrypto/man/SMIME_write_CMS.3 b/src/lib/libcrypto/man/SMIME_write_CMS.3
index c516b79250..ddb71e98e2 100644
--- a/src/lib/libcrypto/man/SMIME_write_CMS.3
+++ b/src/lib/libcrypto/man/SMIME_write_CMS.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: SMIME_write_CMS.3,v 1.2 2019/08/11 12:46:38 schwarze Exp $ 1.\" $OpenBSD: SMIME_write_CMS.3,v 1.3 2019/08/18 13:02:37 schwarze Exp $
2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: August 11 2019 $ 51.Dd $Mdocdate: August 18 2019 $
52.Dt SMIME_WRITE_CMS 3 52.Dt SMIME_WRITE_CMS 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -65,38 +65,32 @@
65.Fc 65.Fc
66.Sh DESCRIPTION 66.Sh DESCRIPTION
67.Fn SMIME_write_CMS 67.Fn SMIME_write_CMS
68adds the appropriate MIME headers to a CMS structure to produce an 68adds the appropriate MIME headers to the
69S/MIME message.
70.Pp
71.Fa out
72is the
73.Vt BIO
74to write the data to.
75.Fa cms 69.Fa cms
76is the appropriate 70structure to produce an S/MIME message and writes it to
77.Vt CMS_ContentInfo 71.Fa out .
78structure. 72If streaming is enabled, the content must be supplied in the
79If streaming is enabled, then the content must be supplied in the
80.Fa data 73.Fa data
81argument. 74argument.
82.Fa flags
83is an optional set of flags.
84.Pp 75.Pp
85The following flags can be passed in the 76The following
86.Fa flags 77.Fa flags
87parameter: 78can be passed:
88.Bl -tag -width Ds 79.Bl -tag -width Ds
89.It Dv CMS_DETACHED 80.It Dv CMS_DETACHED
90Use cleartext signing. 81Use cleartext signing.
91This option only makes sense for SignedData where 82This option only makes sense if
83.Fa cms
84is of the type
85.Vt SignedData
86and
92.Dv CMS_DETACHED 87.Dv CMS_DETACHED
93is also set when 88was also set when it was created with
94.Xr CMS_sign 3 89.Xr CMS_sign 3 .
95is called.
96.Pp 90.Pp
97If cleartext signing is used and 91If
98.Dv CMS_STREAM 92.Dv CMS_STREAM
99is not set, then the data must be read twice: 93is not set, the data must be read twice:
100once to compute the signature in 94once to compute the signature in
101.Xr CMS_sign 3 95.Xr CMS_sign 3
102and once to output the S/MIME message. 96and once to output the S/MIME message.
@@ -109,12 +103,12 @@ is also set.
109Perform streaming. 103Perform streaming.
110This flag should only be set if 104This flag should only be set if
111.Dv CMS_STREAM 105.Dv CMS_STREAM
112was also set in the previous call to a 106was also passed to the function that created
113.Vt CMS_ContentInfo 107.Fa cms .
114creation function.
115.Pp 108.Pp
116If streaming is performed, the content is output in BER format using 109The content is output in BER format using indefinite length
117indefinite length constructed encoding except in the case of signed data 110constructed encoding except in the case of
111.Vt SignedData
118with detached content where the content is absent and DER format is 112with detached content where the content is absent and DER format is
119used. 113used.
120.El 114.El