summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2019-08-18 13:02:37 +0000
committerschwarze <schwarze@openbsd.org>2019-08-18 13:02:37 +0000
commit3ecda961cf01ff5e72ad988fab516a3fa0b5faa3 (patch)
treee60d2a2e5e1e4a5b4f0fc070bc90bbeb6466746d
parentminor cleanup: (diff)
downloadwireguard-openbsd-3ecda961cf01ff5e72ad988fab516a3fa0b5faa3.tar.xz
wireguard-openbsd-3ecda961cf01ff5e72ad988fab516a3fa0b5faa3.zip
minor cleanup:
* avoid jumping back and forth between use cases * delete duplicate information * and minor wording improvements
-rw-r--r--lib/libcrypto/man/SMIME_read_CMS.350
-rw-r--r--lib/libcrypto/man/SMIME_write_CMS.350
2 files changed, 37 insertions, 63 deletions
diff --git a/lib/libcrypto/man/SMIME_read_CMS.3 b/lib/libcrypto/man/SMIME_read_CMS.3
index 94bce423908..af2facf1299 100644
--- a/lib/libcrypto/man/SMIME_read_CMS.3
+++ b/lib/libcrypto/man/SMIME_read_CMS.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: SMIME_read_CMS.3,v 1.3 2019/08/12 16:00:05 schwarze Exp $
+.\" $OpenBSD: SMIME_read_CMS.3,v 1.4 2019/08/18 13:02:37 schwarze Exp $
.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
@@ -48,7 +48,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 12 2019 $
+.Dd $Mdocdate: August 18 2019 $
.Dt SMIME_READ_CMS 3
.Os
.Sh NAME
@@ -63,40 +63,22 @@
.Fc
.Sh DESCRIPTION
.Fn SMIME_read_CMS
-parses a message in S/MIME format.
+parses a message in S/MIME format from
+.Fa in .
.Pp
-.Fa in
-is a
-.Vt BIO
-to read the message from.
-.Pp
-If cleartext signing is used, then the content is saved in a memory BIO
+If the message uses cleartext signing, the content is saved in a memory BIO
which is written to
-.Pf * Fa bcont ;
-otherwise
-.Pf * Fa bcont
-is set to
-.Dv NULL .
-.Pp
-The parsed
-.Vt CMS_ContentInfo
-structure is returned, or
-.Dv NULL
-if an error occurred.
-.Pp
-If
.Pf * Fa bcont
-is not
-.Dv NULL ,
-then the message is clear text signed.
-.Pf * Fa bcont
-can then be passed to
+and which can then be passed to
.Xr CMS_verify 3
with the
.Dv CMS_DETACHED
flag set.
-.Pp
-Otherwise the type of the returned structure can be determined using
+Otherwise,
+.Pf * Fa bcont
+is set to
+.Dv NULL
+and the type of the returned structure can be determined using
.Xr CMS_get0_type 3 .
.Pp
To support future functionality if
@@ -105,13 +87,11 @@ is not
.Dv NULL ,
.Pf * Fa bcont
should be initialized to
-.Dv NULL .
-For example:
+.Dv NULL ,
+for example:
.Bd -literal -offset indent
BIO *cont = NULL;
-CMS_ContentInfo *cms;
-
-cms = SMIME_read_CMS(in, &cont);
+CMS_ContentInfo *cms = SMIME_read_CMS(in, &cont);
.Ed
.Sh RETURN VALUES
.Fn SMIME_read_CMS
@@ -147,5 +127,5 @@ structure is always base64 encoded and will not handle the case
where it is in binary format or uses quoted printable format.
.Pp
The use of a memory BIO to hold the signed content limits the size of
-message which can be processed due to memory restraints: a streaming
+the message which can be processed due to memory restraints: a streaming
single pass option should be available.
diff --git a/lib/libcrypto/man/SMIME_write_CMS.3 b/lib/libcrypto/man/SMIME_write_CMS.3
index c516b79250a..ddb71e98e27 100644
--- a/lib/libcrypto/man/SMIME_write_CMS.3
+++ b/lib/libcrypto/man/SMIME_write_CMS.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: SMIME_write_CMS.3,v 1.2 2019/08/11 12:46:38 schwarze Exp $
+.\" $OpenBSD: SMIME_write_CMS.3,v 1.3 2019/08/18 13:02:37 schwarze Exp $
.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
@@ -48,7 +48,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 11 2019 $
+.Dd $Mdocdate: August 18 2019 $
.Dt SMIME_WRITE_CMS 3
.Os
.Sh NAME
@@ -65,38 +65,32 @@
.Fc
.Sh DESCRIPTION
.Fn SMIME_write_CMS
-adds the appropriate MIME headers to a CMS structure to produce an
-S/MIME message.
-.Pp
-.Fa out
-is the
-.Vt BIO
-to write the data to.
+adds the appropriate MIME headers to the
.Fa cms
-is the appropriate
-.Vt CMS_ContentInfo
-structure.
-If streaming is enabled, then the content must be supplied in the
+structure to produce an S/MIME message and writes it to
+.Fa out .
+If streaming is enabled, the content must be supplied in the
.Fa data
argument.
-.Fa flags
-is an optional set of flags.
.Pp
-The following flags can be passed in the
+The following
.Fa flags
-parameter:
+can be passed:
.Bl -tag -width Ds
.It Dv CMS_DETACHED
Use cleartext signing.
-This option only makes sense for SignedData where
+This option only makes sense if
+.Fa cms
+is of the type
+.Vt SignedData
+and
.Dv CMS_DETACHED
-is also set when
-.Xr CMS_sign 3
-is called.
+was also set when it was created with
+.Xr CMS_sign 3 .
.Pp
-If cleartext signing is used and
+If
.Dv CMS_STREAM
-is not set, then the data must be read twice:
+is not set, the data must be read twice:
once to compute the signature in
.Xr CMS_sign 3
and once to output the S/MIME message.
@@ -109,12 +103,12 @@ is also set.
Perform streaming.
This flag should only be set if
.Dv CMS_STREAM
-was also set in the previous call to a
-.Vt CMS_ContentInfo
-creation function.
+was also passed to the function that created
+.Fa cms .
.Pp
-If streaming is performed, the content is output in BER format using
-indefinite length constructed encoding except in the case of signed data
+The content is output in BER format using indefinite length
+constructed encoding except in the case of
+.Vt SignedData
with detached content where the content is absent and DER format is
used.
.El