diff options
Diffstat (limited to 'src/lib/libcrypto/man/SMIME_crlf_copy.3')
| -rw-r--r-- | src/lib/libcrypto/man/SMIME_crlf_copy.3 | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/SMIME_crlf_copy.3 b/src/lib/libcrypto/man/SMIME_crlf_copy.3 new file mode 100644 index 0000000000..defee581fd --- /dev/null +++ b/src/lib/libcrypto/man/SMIME_crlf_copy.3 | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | .\" $OpenBSD: SMIME_crlf_copy.3,v 1.1 2021/12/13 13:46:09 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_CRLF_COPY 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm SMIME_crlf_copy | ||
| 22 | .Nd buffered copy between BIOs | ||
| 23 | .Sh SYNOPSIS | ||
| 24 | .Ft int | ||
| 25 | .Fo SMIME_crlf_copy | ||
| 26 | .Fa "BIO *in_bio" | ||
| 27 | .Fa "BIO *out_bio" | ||
| 28 | .Fa "int flags" | ||
| 29 | .Fc | ||
| 30 | .Sh DESCRIPTION | ||
| 31 | .Fn SMIME_crlf_copy | ||
| 32 | copies data from | ||
| 33 | .Fa in_bio | ||
| 34 | to | ||
| 35 | .Fa out_bio . | ||
| 36 | To avoid many small write operations on | ||
| 37 | .Fa out_bio , | ||
| 38 | a buffering BIO created with | ||
| 39 | .Xr BIO_f_buffer 3 | ||
| 40 | is temporarily prepended to it. | ||
| 41 | .Pp | ||
| 42 | If the bit | ||
| 43 | .Dv SMIME_BINARY | ||
| 44 | is set in the | ||
| 45 | .Fa flags | ||
| 46 | argument, all the data is copied verbatim using | ||
| 47 | .Xr BIO_read 3 | ||
| 48 | and | ||
| 49 | .Xr BIO_write 3 . | ||
| 50 | .Pp | ||
| 51 | Otherwise, the data is read as text. | ||
| 52 | All trailing carriage return and newline characters are discarded | ||
| 53 | from every input line and a single pair of carriage return and | ||
| 54 | newline characters is appended to mark the end of every output line, | ||
| 55 | except that the last output line will end without such a pair if | ||
| 56 | the last input line does not have a newline character at the end. | ||
| 57 | .Pp | ||
| 58 | If the bit | ||
| 59 | .Dv SMIME_TEXT | ||
| 60 | is set in the | ||
| 61 | .Fa flags | ||
| 62 | argument and the bit | ||
| 63 | .Dv SMIME_BINARY | ||
| 64 | is not set, the line | ||
| 65 | .Qq Content-Type: text/plain | ||
| 66 | is prepended to the output | ||
| 67 | with two pairs of carriage return and newline characters after it. | ||
| 68 | .Pp | ||
| 69 | In any case, | ||
| 70 | .Xr BIO_flush 3 | ||
| 71 | is called on the output at the end of the function. | ||
| 72 | .Sh RETURN VALUES | ||
| 73 | .Fn SMIME_crlf_copy | ||
| 74 | is intended to return 1 on success or 0 on failure. | ||
| 75 | .Sh SEE ALSO | ||
| 76 | .Xr BIO_f_buffer 3 , | ||
| 77 | .Xr BIO_flush 3 , | ||
| 78 | .Xr BIO_new 3 , | ||
| 79 | .Xr BIO_push 3 , | ||
| 80 | .Xr BIO_read 3 , | ||
| 81 | .Xr i2d_ASN1_bio_stream 3 , | ||
| 82 | .Xr SMIME_write_ASN1 3 | ||
| 83 | .Sh HISTORY | ||
| 84 | .Fn SMIME_crlf_copy | ||
| 85 | first appeared in OpenSSL 1.0.0 and has been available since | ||
| 86 | .Ox 4.9 . | ||
| 87 | .Sh BUGS | ||
| 88 | .Fn SMIME_crlf_copy | ||
| 89 | silently ignores most errors and may return 1 | ||
| 90 | even if it lost part or all of the data in transit. | ||
| 91 | .Pp | ||
| 92 | Only blocking BIOs are supported. | ||
| 93 | If any of the | ||
| 94 | .Vt BIO | ||
| 95 | arguments is non-blocking, part or all of the data is likely | ||
| 96 | to be silently lost in transit. | ||
