summaryrefslogtreecommitdiffstats
path: root/doc/man3
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-12-18 16:15:49 +0100
committerDr. David von Oheimb <dev@ddvo.net>2021-12-21 12:11:49 +0100
commit79b2a2f2eedb9d6b24a3f6748332328cf54568fb (patch)
tree31d61a9636cccc6a378871407b11fc1fc89aa8c6 /doc/man3
parent0d4c52320d245be80bd69346fdda4b12b4961eae (diff)
add OSSL_STACK_OF_X509_free() for commonly used pattern
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17307)
Diffstat (limited to 'doc/man3')
-rw-r--r--doc/man3/X509_STORE_CTX_get_error.pod2
-rw-r--r--doc/man3/X509_new.pod14
2 files changed, 13 insertions, 3 deletions
diff --git a/doc/man3/X509_STORE_CTX_get_error.pod b/doc/man3/X509_STORE_CTX_get_error.pod
index 04005f3ecd..901113c917 100644
--- a/doc/man3/X509_STORE_CTX_get_error.pod
+++ b/doc/man3/X509_STORE_CTX_get_error.pod
@@ -72,7 +72,7 @@ verification is successful. Otherwise the returned chain may be incomplete or
invalid. The returned chain persists after the I<ctx> structure is freed.
When it is no longer needed it should be free up using:
- sk_X509_pop_free(chain, X509_free);
+ OSSL_STACK_OF_X509_free(chain);
X509_verify_cert_error_string() returns a human readable error string for
verification error I<n>.
diff --git a/doc/man3/X509_new.pod b/doc/man3/X509_new.pod
index ea2b3a2cc9..f1d07bf79e 100644
--- a/doc/man3/X509_new.pod
+++ b/doc/man3/X509_new.pod
@@ -4,7 +4,9 @@
X509_new, X509_new_ex,
X509_free, X509_up_ref,
-X509_chain_up_ref - X509 certificate ASN1 allocation functions
+X509_chain_up_ref,
+OSSL_STACK_OF_X509_free
+- X509 certificate ASN1 allocation and deallocation functions
=head1 SYNOPSIS
@@ -15,6 +17,7 @@ X509_chain_up_ref - X509 certificate ASN1 allocation functions
void X509_free(X509 *a);
int X509_up_ref(X509 *a);
STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *x);
+ void OSSL_STACK_OF_X509_free(STACK_OF(X509) *certs);
=head1 DESCRIPTION
@@ -40,6 +43,9 @@ X509_up_ref() increments the reference count of B<a>.
X509_chain_up_ref() increases the reference count of all certificates in
chain B<x> and returns a copy of the stack, or an empty stack if B<a> is NULL.
+OSSL_STACK_OF_X509_free() deallocates the given list of pointers to
+certificates after calling X509_free() on all its elements.
+
=head1 NOTES
The function X509_up_ref() if useful if a certificate structure is being
@@ -61,6 +67,8 @@ X509_up_ref() returns 1 for success and 0 for failure.
X509_chain_up_ref() returns a copy of the stack or NULL if an error occurred.
+OSSL_STACK_OF_X509_free() has no return value.
+
=head1 SEE ALSO
L<d2i_X509(3)>,
@@ -82,7 +90,9 @@ L<X509_verify_cert(3)>
=head1 HISTORY
-The function X509_new_ex() was added in OpenSSL 3.0.
+X509_new_ex() was added in OpenSSL 3.0.
+
+OSSL_STACK_OF_X509_free() was added in OpenSSL 3.1.
=head1 COPYRIGHT