[DOC] Some pointer ownership details

Relates to https://github.com/openssl/openssl/issues/28298 and
https://github.com/openssl/openssl/issues/28156.

CLA: trivial
This commit is contained in:
Michaut.Francois 2025-08-26 15:56:19 -03:00
parent c66d9760a7
commit 399c54fa02
No known key found for this signature in database
3 changed files with 16 additions and 9 deletions

View File

@ -13,7 +13,8 @@ SSL_get_SSL_CTX - get the SSL_CTX from which an SSL is created
=head1 DESCRIPTION
SSL_get_SSL_CTX() returns a pointer to the SSL_CTX object, from which
B<ssl> was created with L<SSL_new(3)>.
B<ssl> was created with L<SSL_new(3)>. The returned pointer is an
internal pointer which should NOT be freed.
=head1 RETURN VALUES

View File

@ -16,12 +16,16 @@ SSL_dup, SSL_new, SSL_up_ref - create an SSL structure for a connection
SSL_new() creates a new B<SSL> structure which is needed to hold the
data for a TLS/SSL connection. The new structure inherits the settings
of the underlying context B<ctx>: connection method,
options, verification settings, timeout settings. An B<SSL> structure is
reference counted. Creating an B<SSL> structure for the first time increments
the reference count. Freeing it (using SSL_free) decrements it. When the
reference count drops to zero, any memory or resources allocated to the B<SSL>
structure are freed.
of the underlying context B<ctx>: connection method, options,
verification settings, timeout settings. Theses settings are copied in the
B<SSL> structure, so modifing the original B<SSL_CTX> will not affect already
created B<SSL> instances. An up-ref'd copy of B<ctx> will be stored inside the
B<SSL> instance for later retrieval (with SSL_get_SSL_CTX). It is thus safe to
free the B<ctx> instance before the newly created B<SSL> instance.
An B<SSL> structure is reference counted. Creating an B<SSL> structure for the
first time increments the reference count. Freeing it (using SSL_free)
decrements it. When the reference count drops to zero, any memory or resources
allocated to the B<SSL> structure are freed.
SSL_up_ref() increments the reference count for an
existing B<SSL> structure.

View File

@ -31,10 +31,12 @@ X509_NAME_ENTRY_create_by_OBJ - X509_NAME_ENTRY utility functions
=head1 DESCRIPTION
X509_NAME_ENTRY_get_object() retrieves the field name of B<ne> in
and B<ASN1_OBJECT> structure.
and B<ASN1_OBJECT> structure. The returned pointer is an internal
pointer which should NOT be freed.
X509_NAME_ENTRY_get_data() retrieves the field value of B<ne> in
and B<ASN1_STRING> structure.
and B<ASN1_STRING> structure. The returned pointer is an internal
pointer which should NOT be freed.
X509_NAME_ENTRY_set_object() sets the field name of B<ne> to B<obj>.