diff options
author | schwarze <> | 2019-08-18 13:02:37 +0000 |
---|---|---|
committer | schwarze <> | 2019-08-18 13:02:37 +0000 |
commit | 8a79ec8f52f3e43d1ab8742cfab42dd56371e58b (patch) | |
tree | 0658a4d38515e513e616fbeacc27ff4764a33c43 /src | |
parent | 0fc04f9f313a0675c6689b0b146c615e2005c6d8 (diff) | |
download | openbsd-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.3 | 50 | ||||
-rw-r--r-- | src/lib/libcrypto/man/SMIME_write_CMS.3 | 50 |
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 |
66 | parses a message in S/MIME format. | 66 | parses a message in S/MIME format from |
67 | .Fa in . | ||
67 | .Pp | 68 | .Pp |
68 | .Fa in | 69 | If the message uses cleartext signing, the content is saved in a memory BIO |
69 | is a | ||
70 | .Vt BIO | ||
71 | to read the message from. | ||
72 | .Pp | ||
73 | If cleartext signing is used, then the content is saved in a memory BIO | ||
74 | which is written to | 70 | which is written to |
75 | .Pf * Fa bcont ; | ||
76 | otherwise | ||
77 | .Pf * Fa bcont | ||
78 | is set to | ||
79 | .Dv NULL . | ||
80 | .Pp | ||
81 | The parsed | ||
82 | .Vt CMS_ContentInfo | ||
83 | structure is returned, or | ||
84 | .Dv NULL | ||
85 | if an error occurred. | ||
86 | .Pp | ||
87 | If | ||
88 | .Pf * Fa bcont | 71 | .Pf * Fa bcont |
89 | is not | 72 | and which can then be passed to |
90 | .Dv NULL , | ||
91 | then the message is clear text signed. | ||
92 | .Pf * Fa bcont | ||
93 | can then be passed to | ||
94 | .Xr CMS_verify 3 | 73 | .Xr CMS_verify 3 |
95 | with the | 74 | with the |
96 | .Dv CMS_DETACHED | 75 | .Dv CMS_DETACHED |
97 | flag set. | 76 | flag set. |
98 | .Pp | 77 | Otherwise, |
99 | Otherwise the type of the returned structure can be determined using | 78 | .Pf * Fa bcont |
79 | is set to | ||
80 | .Dv NULL | ||
81 | and 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 |
102 | To support future functionality if | 84 | To support future functionality if |
@@ -105,13 +87,11 @@ is not | |||
105 | .Dv NULL , | 87 | .Dv NULL , |
106 | .Pf * Fa bcont | 88 | .Pf * Fa bcont |
107 | should be initialized to | 89 | should be initialized to |
108 | .Dv NULL . | 90 | .Dv NULL , |
109 | For example: | 91 | for example: |
110 | .Bd -literal -offset indent | 92 | .Bd -literal -offset indent |
111 | BIO *cont = NULL; | 93 | BIO *cont = NULL; |
112 | CMS_ContentInfo *cms; | 94 | CMS_ContentInfo *cms = SMIME_read_CMS(in, &cont); |
113 | |||
114 | cms = 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 | |||
147 | where it is in binary format or uses quoted printable format. | 127 | where it is in binary format or uses quoted printable format. |
148 | .Pp | 128 | .Pp |
149 | The use of a memory BIO to hold the signed content limits the size of | 129 | The use of a memory BIO to hold the signed content limits the size of |
150 | message which can be processed due to memory restraints: a streaming | 130 | the message which can be processed due to memory restraints: a streaming |
151 | single pass option should be available. | 131 | single 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 |
68 | adds the appropriate MIME headers to a CMS structure to produce an | 68 | adds the appropriate MIME headers to the |
69 | S/MIME message. | ||
70 | .Pp | ||
71 | .Fa out | ||
72 | is the | ||
73 | .Vt BIO | ||
74 | to write the data to. | ||
75 | .Fa cms | 69 | .Fa cms |
76 | is the appropriate | 70 | structure to produce an S/MIME message and writes it to |
77 | .Vt CMS_ContentInfo | 71 | .Fa out . |
78 | structure. | 72 | If streaming is enabled, the content must be supplied in the |
79 | If streaming is enabled, then the content must be supplied in the | ||
80 | .Fa data | 73 | .Fa data |
81 | argument. | 74 | argument. |
82 | .Fa flags | ||
83 | is an optional set of flags. | ||
84 | .Pp | 75 | .Pp |
85 | The following flags can be passed in the | 76 | The following |
86 | .Fa flags | 77 | .Fa flags |
87 | parameter: | 78 | can be passed: |
88 | .Bl -tag -width Ds | 79 | .Bl -tag -width Ds |
89 | .It Dv CMS_DETACHED | 80 | .It Dv CMS_DETACHED |
90 | Use cleartext signing. | 81 | Use cleartext signing. |
91 | This option only makes sense for SignedData where | 82 | This option only makes sense if |
83 | .Fa cms | ||
84 | is of the type | ||
85 | .Vt SignedData | ||
86 | and | ||
92 | .Dv CMS_DETACHED | 87 | .Dv CMS_DETACHED |
93 | is also set when | 88 | was also set when it was created with |
94 | .Xr CMS_sign 3 | 89 | .Xr CMS_sign 3 . |
95 | is called. | ||
96 | .Pp | 90 | .Pp |
97 | If cleartext signing is used and | 91 | If |
98 | .Dv CMS_STREAM | 92 | .Dv CMS_STREAM |
99 | is not set, then the data must be read twice: | 93 | is not set, the data must be read twice: |
100 | once to compute the signature in | 94 | once to compute the signature in |
101 | .Xr CMS_sign 3 | 95 | .Xr CMS_sign 3 |
102 | and once to output the S/MIME message. | 96 | and once to output the S/MIME message. |
@@ -109,12 +103,12 @@ is also set. | |||
109 | Perform streaming. | 103 | Perform streaming. |
110 | This flag should only be set if | 104 | This flag should only be set if |
111 | .Dv CMS_STREAM | 105 | .Dv CMS_STREAM |
112 | was also set in the previous call to a | 106 | was also passed to the function that created |
113 | .Vt CMS_ContentInfo | 107 | .Fa cms . |
114 | creation function. | ||
115 | .Pp | 108 | .Pp |
116 | If streaming is performed, the content is output in BER format using | 109 | The content is output in BER format using indefinite length |
117 | indefinite length constructed encoding except in the case of signed data | 110 | constructed encoding except in the case of |
111 | .Vt SignedData | ||
118 | with detached content where the content is absent and DER format is | 112 | with detached content where the content is absent and DER format is |
119 | used. | 113 | used. |
120 | .El | 114 | .El |