From 7ea904c873d7b57e8ed90731be8b98e986dd625c Mon Sep 17 00:00:00 2001 From: Uriah-wolfSSL <106351767+Uriah-wolfSSL@users.noreply.github.com> Date: Wed, 24 Aug 2022 12:09:50 -0500 Subject: [PATCH] Added CertNew() and CertFree() info. (#5502) * Updated wc_CertNew() dox for the return value listings, small changes to description and add some detail to the example per peer review. --- doc/dox_comments/header_files/asn_public.h | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/doc/dox_comments/header_files/asn_public.h b/doc/dox_comments/header_files/asn_public.h index 17bb76b8c..24e1a6c52 100644 --- a/doc/dox_comments/header_files/asn_public.h +++ b/doc/dox_comments/header_files/asn_public.h @@ -21,6 +21,66 @@ */ int wc_InitCert(Cert*); +/*! + \ingroup ASN + + \brief This function allocates a new Cert structure for use during + cert operations without the application having to allocate the structure + itself. The Cert structure is also initialized by this function thus + removing the need to call wc_InitCert(). When the application is finished + using the allocated Cert structure wc_CertFree() must be called. + + \return pointer If successful the call will return a pointer to the + newly allocated and initialized Cert. + \return NULL On a memory allocation failure. + + \param A pointer to the heap used for dynamic allocation. Can be NULL. + + _Example_ + \code + Cert* myCert; + + myCert = wc_CertNew(NULL); + if (myCert == NULL) { + // Cert creation failure + } + \endcode + + \sa wc_InitCert + \sa wc_MakeCert + \sa wc_CertFree + +*/ +Cert* wc_CertNew(void* heap); + +/*! + \ingroup ASN + + \brief This function frees the memory allocated for a cert structure + by a previous call to wc_CertNew(). + + \return None. + + \param A pointer to the cert structure to free. + + _Example_ + \code + Cert* myCert; + + myCert = wc_CertNew(NULL); + + // Perform cert operations. + + wc_CertFree(myCert); + \endcode + + \sa wc_InitCert + \sa wc_MakeCert + \sa wc_CertNew + +*/ +void wc_CertFree(Cert* cert); + /*! \ingroup ASN