doc: clarify SSL_CIPHER_description allocation
authorDaniel McCarney <daniel@binaryparadox.net>
Thu, 21 Mar 2024 19:41:11 +0000 (15:41 -0400)
committerTomas Mraz <tomas@openssl.org>
Mon, 29 Apr 2024 09:04:31 +0000 (11:04 +0200)
commit6a4a714045415be6720f4165c4d70a0ff229a26a
tree2daa42a8578974965b1a83111d004c1f99358e61
parent58ffcbbdc3302a35cea317aeee6b76987907ee60
doc: clarify SSL_CIPHER_description allocation

Previously the documentation for `SSL_CIPHER_description` said:
> If buf is provided, it must be at least 128 bytes, otherwise a buffer
> will be allocated using OPENSSL_malloc().

In reality, `OPENSSL_malloc` is only invoked if the provided `buf`
argument is `NULL`. If the `buf` arg is not `NULL`, but smaller than
128 bytes, the function returns `NULL` without attempting to allocate
a new buffer for the description.

This commit adjusts the documentation to better describe the implemented
behaviour.

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23921)
doc/man3/SSL_CIPHER_get_name.pod