SMIME_CRLF_COPY(3)
π NAME
okay so this is SMIME_CRLF_COPY(3), straight out of the Library Functions Manual, and itβs literally about buffered copy between BIOs. bestie, weβre moving data from one BIO to another and trying to be cute about it β¨
π SYNOPSIS
int
SMIME_crlf_copy(BIO *in_bio, BIO *out_bio, int flags);
π DESCRIPTION
SMIME_crlf_copy() copies data from in_bio to out_bio. and the way it avoids doing a million tiny write operations on out_bio? iconic behavior honestly: a buffering BIO created with BIO_f_buffer(3) is temporarily prepended to it π«Ά
If the bit SMIME_BINARY is set in the flags argument, all the data is copied verbatim using BIO_read(3) and BIO_write(3). no changes, no drama, just raw data moving through π
Otherwise, the data is read as text. All trailing carriage return and newline characters are discarded from every input line, and a single pair of carriage return and newline characters is appended to mark the end of every output line β except that the last output line will end without such a pair if the last input line does not have a newline character at the end. like, itβs matching the vibe of the original ending πΈ
If the bit SMIME_TEXT is set in the flags argument and the bit SMIME_BINARY is not set, the line Content-Type: text/plain is prepended to the output with two pairs of carriage return and newline characters after it. okayyyyy header moment π
In any case, BIO_flush(3) is called on the output at the end of the function. always flush, bestie, always π¦
β RETURN VALUES
SMIME_crlf_copy() is intended to return 1 on success or 0 on failure. thatβs the plan, anyway π
π¦ SEE ALSO
π HISTORY
SMIME_crlf_copy() first appeared in OpenSSL 1.0.0 and has been available since OpenBSD 4.9. vintage but still serving π
π BUGS
SMIME_crlf_copy() silently ignores most errors and may return 1 even if it lost part or all of the data in transit. not me finding out the function is lowkey lying to me π
Only blocking BIOs are supported. If any of the BIO arguments is non-blocking, part or all of the data is likely to be silently lost in transit. fr fr, do not play with that π¨
mwah π this page is brought to you by Debian, dated May 1, 2023 β slay and goodbye π
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· OpenSSL
- Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms