diff options
| author | schwarze <> | 2021-12-13 17:24:39 +0000 |
|---|---|---|
| committer | schwarze <> | 2021-12-13 17:24:39 +0000 |
| commit | 5dc3c1edf50a3819117d36117d179b329070e45d (patch) | |
| tree | 391ad10780fdb214d1ad52d36440d05909b92b5e /src | |
| parent | 9021d14f9c0c87cbe273ab6f4fe8e4f48363f4f6 (diff) | |
| download | openbsd-5dc3c1edf50a3819117d36117d179b329070e45d.tar.gz openbsd-5dc3c1edf50a3819117d36117d179b329070e45d.tar.bz2 openbsd-5dc3c1edf50a3819117d36117d179b329070e45d.zip | |
new manual page SMIME_write_ASN1(3);
still vague in various respects, but it's a start
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/SMIME_write_ASN1.3 | 166 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/SMIME_write_CMS.3 | 7 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/SMIME_write_PKCS7.3 | 7 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/i2d_ASN1_bio_stream.3 | 5 |
5 files changed, 179 insertions, 9 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 2e608bffbb..88610412cc 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.224 2021/12/13 13:46:09 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.225 2021/12/13 17:24:39 schwarze Exp $ |
| 2 | 2 | ||
| 3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
| 4 | 4 | ||
| @@ -281,6 +281,7 @@ MAN= \ | |||
| 281 | SMIME_crlf_copy.3 \ | 281 | SMIME_crlf_copy.3 \ |
| 282 | SMIME_read_CMS.3 \ | 282 | SMIME_read_CMS.3 \ |
| 283 | SMIME_read_PKCS7.3 \ | 283 | SMIME_read_PKCS7.3 \ |
| 284 | SMIME_write_ASN1.3 \ | ||
| 284 | SMIME_write_CMS.3 \ | 285 | SMIME_write_CMS.3 \ |
| 285 | SMIME_write_PKCS7.3 \ | 286 | SMIME_write_PKCS7.3 \ |
| 286 | STACK_OF.3 \ | 287 | STACK_OF.3 \ |
diff --git a/src/lib/libcrypto/man/SMIME_write_ASN1.3 b/src/lib/libcrypto/man/SMIME_write_ASN1.3 new file mode 100644 index 0000000000..971cd226dd --- /dev/null +++ b/src/lib/libcrypto/man/SMIME_write_ASN1.3 | |||
| @@ -0,0 +1,166 @@ | |||
| 1 | .\" $OpenBSD: SMIME_write_ASN1.3,v 1.1 2021/12/13 17:24:39 schwarze Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | ||
| 4 | .\" | ||
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 7 | .\" copyright notice and this permission notice appear in all copies. | ||
| 8 | .\" | ||
| 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .\" | ||
| 17 | .Dd $Mdocdate: December 13 2021 $ | ||
| 18 | .Dt SMIME_WRITE_ASN1 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm SMIME_write_ASN1 | ||
| 22 | .Nd generate an S/MIME message | ||
| 23 | .Sh SYNOPSIS | ||
| 24 | .In openssl/asn1.h | ||
| 25 | .Ft int | ||
| 26 | .Fo SMIME_write_ASN1 | ||
| 27 | .Fa "BIO *out_bio" | ||
| 28 | .Fa "ASN1_VALUE *val_in" | ||
| 29 | .Fa "BIO *in_bio" | ||
| 30 | .Fa "int flags" | ||
| 31 | .Fa "int ctype_nid" | ||
| 32 | .Fa "int econt_nid" | ||
| 33 | .Fa "STACK_OF(X509_ALGOR) *micalg" | ||
| 34 | .Fa "const ASN1_ITEM *it" | ||
| 35 | .Fc | ||
| 36 | .Sh DESCRIPTION | ||
| 37 | .Fn SMIME_write_ASN1 | ||
| 38 | generates an S/MIME message on | ||
| 39 | .Fa out_bio | ||
| 40 | by writing MIME 1.0 headers | ||
| 41 | followed by a BER- and base64-encoded serialization of | ||
| 42 | .Fa val_in , | ||
| 43 | which can be of the type | ||
| 44 | .Vt CMS_ContentInfo | ||
| 45 | or | ||
| 46 | .Vt PKCS7 | ||
| 47 | and has to match the | ||
| 48 | .Fa it | ||
| 49 | argument. | ||
| 50 | .Pp | ||
| 51 | The | ||
| 52 | .Fa flags | ||
| 53 | can be the logical OR of zero or more of the following bits: | ||
| 54 | .Bl -tag -width Ds | ||
| 55 | .It Dv PKCS7_REUSE_DIGEST | ||
| 56 | Skip the calls to | ||
| 57 | .Xr PKCS7_dataInit 3 | ||
| 58 | and | ||
| 59 | .Xr PKCS7_dataFinal 3 . | ||
| 60 | This flag has no effect unless | ||
| 61 | .Dv SMIME_DETACHED | ||
| 62 | is also set. | ||
| 63 | It is normally used if | ||
| 64 | .Fa out_bio | ||
| 65 | is already set up to calculate and finalize the digest when written through. | ||
| 66 | .It Dv SMIME_BINARY | ||
| 67 | If specified, this flag is passed through to | ||
| 68 | .Xr SMIME_crlf_copy 3 . | ||
| 69 | .It Dv SMIME_CRLFEOL | ||
| 70 | End MIME header lines with pairs of carriage return and newline characters. | ||
| 71 | By default, no carriage return characters are written | ||
| 72 | and header lines are ended with newline characters only. | ||
| 73 | .It Dv SMIME_DETACHED | ||
| 74 | Use cleartext signing. | ||
| 75 | Generate a | ||
| 76 | .Qq multipart/signed | ||
| 77 | S/MIME message using the | ||
| 78 | .Fa micalg | ||
| 79 | argument and ignoring the | ||
| 80 | .Fa ctype_nid | ||
| 81 | and | ||
| 82 | .Fa econt_nid | ||
| 83 | arguments. | ||
| 84 | The content is read from | ||
| 85 | .Fa in_bio . | ||
| 86 | If | ||
| 87 | .Fa in_bio | ||
| 88 | is a | ||
| 89 | .Dv NULL | ||
| 90 | pointer, this flag is ignored. | ||
| 91 | .Pp | ||
| 92 | If this flag is ignored or not specified, | ||
| 93 | the smime-type is chosen according to | ||
| 94 | .Fa ctype_nid | ||
| 95 | instead: | ||
| 96 | .Bl -tag -width Ds | ||
| 97 | .It Dv NID_pkcs7_enveloped | ||
| 98 | .Qq enveloped-data | ||
| 99 | .It Dv NID_pkcs7_signed | ||
| 100 | .Qq signed-receipt | ||
| 101 | if | ||
| 102 | .Fa econt_nid | ||
| 103 | is | ||
| 104 | .Dv NID_id_smime_ct_receipt | ||
| 105 | .br | ||
| 106 | .Qq signed-data | ||
| 107 | if | ||
| 108 | .Fa micalg | ||
| 109 | is not empty | ||
| 110 | .br | ||
| 111 | .Qq certs-only | ||
| 112 | if | ||
| 113 | .Fa micalg | ||
| 114 | is empty | ||
| 115 | .It Dv NID_id_smime_ct_compressedData | ||
| 116 | .Qq compressed-data | ||
| 117 | .El | ||
| 118 | .It Dv SMIME_OLDMIME | ||
| 119 | In Content-Type headers, use | ||
| 120 | .Qq application/x-pkcs7-mime | ||
| 121 | or | ||
| 122 | .Qq application/x-pkcs7-signature . | ||
| 123 | By default, | ||
| 124 | .Qq application/pkcs7-mime | ||
| 125 | or | ||
| 126 | .Qq application/pkcs7-signature | ||
| 127 | are used instead. | ||
| 128 | .It Dv SMIME_STREAM | ||
| 129 | Perform streaming by passing this flag through to | ||
| 130 | .Xr i2d_ASN1_bio_stream 3 | ||
| 131 | and reading the content from | ||
| 132 | .Fa in_bio . | ||
| 133 | This only works if | ||
| 134 | .Dv SMIME_DETACHED | ||
| 135 | is not specified. | ||
| 136 | .It SMIME_TEXT | ||
| 137 | Prepend the line | ||
| 138 | .Qq Content-Type: text/plain | ||
| 139 | to the content. | ||
| 140 | This only makes sense if | ||
| 141 | .Dv SMIME_DETACHED | ||
| 142 | is also set. | ||
| 143 | It is ignored if the flag | ||
| 144 | .Dv SMIME_BINARY | ||
| 145 | is also set. | ||
| 146 | .El | ||
| 147 | .Sh RETURN VALUES | ||
| 148 | .Fn SMIME_write_ASN1 | ||
| 149 | is intended to return 1 on success or 0 on failure. | ||
| 150 | .Sh SEE ALSO | ||
| 151 | .Xr ASN1_item_i2d_bio 3 , | ||
| 152 | .Xr BIO_f_base64 3 , | ||
| 153 | .Xr BIO_new 3 , | ||
| 154 | .Xr i2d_ASN1_bio_stream 3 , | ||
| 155 | .Xr SMIME_crlf_copy 3 , | ||
| 156 | .Xr SMIME_write_CMS 3 , | ||
| 157 | .Xr SMIME_write_PKCS7 3 , | ||
| 158 | .Xr X509_ALGOR_new 3 | ||
| 159 | .Sh HISTORY | ||
| 160 | .Fn SMIME_write_ASN1 | ||
| 161 | first appeared in OpenSSL 1.0.0 and has been available since | ||
| 162 | .Ox 4.9 . | ||
| 163 | .Sh BUGS | ||
| 164 | .Fn SMIME_write_ASN1 | ||
| 165 | ignores most errors and is likely to return 1 | ||
| 166 | even after producing corrupt or incomplete output. | ||
diff --git a/src/lib/libcrypto/man/SMIME_write_CMS.3 b/src/lib/libcrypto/man/SMIME_write_CMS.3 index 5a4e607a3c..c2c6b77e53 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.5 2019/11/02 15:39:46 schwarze Exp $ | 1 | .\" $OpenBSD: SMIME_write_CMS.3,v 1.6 2021/12/13 17:24:39 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: November 2 2019 $ | 51 | .Dd $Mdocdate: December 13 2021 $ |
| 52 | .Dt SMIME_WRITE_CMS 3 | 52 | .Dt SMIME_WRITE_CMS 3 |
| 53 | .Os | 53 | .Os |
| 54 | .Sh NAME | 54 | .Sh NAME |
| @@ -120,7 +120,8 @@ returns 1 for success or 0 for failure. | |||
| 120 | .Xr CMS_encrypt 3 , | 120 | .Xr CMS_encrypt 3 , |
| 121 | .Xr CMS_sign 3 , | 121 | .Xr CMS_sign 3 , |
| 122 | .Xr d2i_CMS_ContentInfo 3 , | 122 | .Xr d2i_CMS_ContentInfo 3 , |
| 123 | .Xr ERR_get_error 3 | 123 | .Xr ERR_get_error 3 , |
| 124 | .Xr SMIME_write_ASN1 3 | ||
| 124 | .Sh HISTORY | 125 | .Sh HISTORY |
| 125 | .Fn SMIME_write_CMS | 126 | .Fn SMIME_write_CMS |
| 126 | first appeared in OpenSSL 0.9.8h | 127 | first appeared in OpenSSL 0.9.8h |
diff --git a/src/lib/libcrypto/man/SMIME_write_PKCS7.3 b/src/lib/libcrypto/man/SMIME_write_PKCS7.3 index 39d8b5d859..4257a89018 100644 --- a/src/lib/libcrypto/man/SMIME_write_PKCS7.3 +++ b/src/lib/libcrypto/man/SMIME_write_PKCS7.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: SMIME_write_PKCS7.3,v 1.7 2020/06/03 13:41:27 schwarze Exp $ | 1 | .\" $OpenBSD: SMIME_write_PKCS7.3,v 1.8 2021/12/13 17:24:39 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>. |
| @@ -49,7 +49,7 @@ | |||
| 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 51 | .\" | 51 | .\" |
| 52 | .Dd $Mdocdate: June 3 2020 $ | 52 | .Dd $Mdocdate: December 13 2021 $ |
| 53 | .Dt SMIME_WRITE_PKCS7 3 | 53 | .Dt SMIME_WRITE_PKCS7 3 |
| 54 | .Os | 54 | .Os |
| 55 | .Sh NAME | 55 | .Sh NAME |
| @@ -136,7 +136,8 @@ otherwise 0 is returned and an error code can be retrieved with | |||
| 136 | .Xr PEM_write_PKCS7 3 , | 136 | .Xr PEM_write_PKCS7 3 , |
| 137 | .Xr PKCS7_final 3 , | 137 | .Xr PKCS7_final 3 , |
| 138 | .Xr PKCS7_new 3 , | 138 | .Xr PKCS7_new 3 , |
| 139 | .Xr SMIME_read_PKCS7 3 | 139 | .Xr SMIME_read_PKCS7 3 , |
| 140 | .Xr SMIME_write_ASN1 3 | ||
| 140 | .Sh HISTORY | 141 | .Sh HISTORY |
| 141 | .Fn SMIME_write_PKCS7 | 142 | .Fn SMIME_write_PKCS7 |
| 142 | first appeared in OpenSSL 0.9.5 and has been available since | 143 | first appeared in OpenSSL 0.9.5 and has been available since |
diff --git a/src/lib/libcrypto/man/i2d_ASN1_bio_stream.3 b/src/lib/libcrypto/man/i2d_ASN1_bio_stream.3 index 007d8eefd4..82908bb10f 100644 --- a/src/lib/libcrypto/man/i2d_ASN1_bio_stream.3 +++ b/src/lib/libcrypto/man/i2d_ASN1_bio_stream.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: i2d_ASN1_bio_stream.3,v 1.1 2021/12/13 13:46:09 schwarze Exp $ | 1 | .\" $OpenBSD: i2d_ASN1_bio_stream.3,v 1.2 2021/12/13 17:24:39 schwarze Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> |
| 4 | .\" | 4 | .\" |
| @@ -83,7 +83,8 @@ is intended to return 1 on success or 0 on failure. | |||
| 83 | .Xr BIO_push 3 , | 83 | .Xr BIO_push 3 , |
| 84 | .Xr i2d_CMS_bio_stream 3 , | 84 | .Xr i2d_CMS_bio_stream 3 , |
| 85 | .Xr i2d_PKCS7_bio_stream 3 , | 85 | .Xr i2d_PKCS7_bio_stream 3 , |
| 86 | .Xr SMIME_crlf_copy 3 | 86 | .Xr SMIME_crlf_copy 3 , |
| 87 | .Xr SMIME_write_ASN1 3 | ||
| 87 | .Sh HISTORY | 88 | .Sh HISTORY |
| 88 | .Fn i2d_ASN1_bio_stream | 89 | .Fn i2d_ASN1_bio_stream |
| 89 | first appeared in OpenSSL 1.0.0 and has been available since | 90 | first appeared in OpenSSL 1.0.0 and has been available since |
