openssl/doc
Neil Horman a25715be77 Improve documentation for BIO_s_mem
Recent leak discovered by valgrind:
==1007580== at 0x483C815: malloc (vg_replace_malloc.c:431)
==1007580== by 0x2C2689: CRYPTO_zalloc (in /home/vien/microedge-c/test)
==1007580== by 0x295A17: BUF_MEM_new (in /home/vien/microedge-c/test)
==1007580== by 0x295A78: BUF_MEM_new_ex (in /home/vien/microedge-c/test)
==1007580== by 0x28CACE: mem_new (in /home/vien/microedge-c/test)
==1007580== by 0x285EA8: BIO_new_ex (in /home/vien/microedge-c/test)
==1007580== by 0x231894: convert_pubkey_ECC (tpm2_driver.c:221)
==1007580== by 0x232B73: create_ephemeral_key (tpm2_driver.c:641)
==1007580== by 0x232E1F: tpm_gen_keypair (tpm2_driver.c:695)
==1007580== by 0x22D60A: gen_keypair (se_driver_api.c:275)
==1007580== by 0x21FF35: generate_keypair (dhkey.c:142)
==1007580== by 0x24D4C8: __test_dhkey (dhkey_test.c:55)

led me to find that BIO_get_mem_data is informative only, it does not
transer ownership of a BIO_s_mems data structure to the caller.
Additionally treating it as such leads to the above leak, or possibly
data corruption in the event that BIO_set_close(bio, BIO_NOCLOSE) is not
set properly prior to calling BIO_free.

Made an attempt to fix it in a minimally invasive manner in the 3.1
branch, but based on discussion, its just not safe to do in an API
compatible way, so just document the sematics a little more clearly
here, and fix it properly in a future release

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21724)

(cherry picked from commit 66d1658b4d)
2023-08-16 14:53:51 +02:00
..
designs Resolve some of the TODO(QUIC) items 2023-08-08 15:58:59 +02:00
HOWTO doc: add HOWTO document about Documenting public Functions and Macros 2023-03-29 12:18:07 +02:00
images doc: add OpenSSL logo 2020-02-26 21:04:38 +01:00
internal CMP: add support for genm with rootCaCert and genp with rootCaKeyUpdate 2023-07-17 08:48:36 +10:00
life-cycles doc: remove end of line whitespace 2021-09-22 16:22:50 +10:00
man1 http_server.c: allow clients to connect with IPv6 2023-08-15 20:41:26 +02:00
man3 Improve documentation for BIO_s_mem 2023-08-16 14:53:51 +02:00
man5 openssl-3.0#20290: Fixed typo in "config" man page 2023-02-20 08:01:56 +11:00
man7 Provide an introductory page to the whole OpenSSL guide 2023-08-08 18:42:41 +02:00
build.info make update 2023-08-08 18:42:42 +02:00
build.info.in doc: remove end of line whitespace 2021-09-22 16:22:50 +10:00
dir-locals.example.el
fingerprints.txt doc/fingerprints.txt: Add the OpenSSL OMC PGP key fingerprint 2023-05-23 15:24:38 +02:00
openssl-c-indent.el
perlvars.pm
README.md

OpenSSL Documentation

README.md This file

fingerprints.txt PGP fingerprints of authorised release signers

standards.txt standards.txt Moved to the web, https://www.openssl.org/docs/standards.html

HOWTO/ A few how-to documents; not necessarily up-to-date

man1/ The openssl command-line tools; start with openssl.pod

man3/ The SSL library and the crypto library

man5/ File formats

man7/ Overviews; start with crypto.pod and ssl.pod, for example Algorithm specific EVP_PKEY documentation.

Formatted versions of the manpages (apps,ssl,crypto) can be found at https://www.openssl.org/docs/manpages.html