@@ -7599,18 +7599,49 @@ int wolfSSL_writev(WOLFSSL* ssl, const struct iovec* iov,
75997599 WOLFSSL_METHOD method = wolfTLSv1_2_client_method();
76007600 WOLFSSL_CTX* ctx = WOLFSSL_CTX_new(method);
76017601 …
7602- if(! wolfSSL_CTX_UnloadCAs(ctx)){
7602+ if(wolfSSL_CTX_UnloadCAs(ctx) != SSL_SUCCESS ){
76037603 // The function did not unload CAs
76047604 }
76057605 \endcode
76067606
76077607 \sa wolfSSL_CertManagerUnloadCAs
76087608 \sa LockMutex
7609- \sa FreeSignerTable
76107609 \sa UnlockMutex
76117610*/
76127611int wolfSSL_CTX_UnloadCAs (WOLFSSL_CTX * );
76137612
7613+
7614+ /*!
7615+ \ingroup Setup
7616+
7617+ \brief This function unloads intermediate certificates added to the CA
7618+ signer list and frees them.
7619+
7620+ \return SSL_SUCCESS returned on successful execution of the function.
7621+ \return BAD_FUNC_ARG returned if the WOLFSSL_CTX struct is NULL or there
7622+ are otherwise unpermitted argument values passed in a subroutine.
7623+ \return BAD_STATE_E returned if the WOLFSSL_CTX has a reference count > 1.
7624+ \return BAD_MUTEX_E returned if there was a mutex error. The LockMutex()
7625+ did not return 0.
7626+
7627+ \param ctx a pointer to a WOLFSSL_CTX structure, created using
7628+ wolfSSL_CTX_new().
7629+
7630+ _Example_
7631+ \code
7632+ WOLFSSL_METHOD method = wolfTLSv1_2_client_method();
7633+ WOLFSSL_CTX* ctx = WOLFSSL_CTX_new(method);
7634+ …
7635+ if(wolfSSL_CTX_UnloadIntermediateCerts(ctx) != NULL){
7636+ // The function did not unload CAs
7637+ }
7638+ \endcode
7639+
7640+ \sa wolfSSL_CTX_UnloadCAs
7641+ \sa wolfSSL_CertManagerUnloadIntermediateCerts
7642+ */
7643+ int wolfSSL_CTX_UnloadIntermediateCerts (WOLFSSL_CTX * ctx );
7644+
76147645/*!
76157646 \ingroup Setup
76167647
@@ -9551,18 +9582,45 @@ int wolfSSL_CertManagerLoadCABuffer(WOLFSSL_CERT_MANAGER* cm,
95519582 #include <wolfssl/ssl.h>
95529583
95539584 WOLFSSL_CTX* ctx = wolfSSL_CTX_new(protocol method);
9554- WOLFSSL_CERT_MANAGER* cm = wolfSSL_CertManagerNew( );
9585+ WOLFSSL_CERT_MANAGER* cm = wolfSSL_CTX_GetCertManager(ctx );
95559586 ...
9556- if(wolfSSL_CertManagerUnloadCAs(ctx-> cm) != SSL_SUCCESS){
9557- Failure case.
9587+ if(wolfSSL_CertManagerUnloadCAs(cm) != SSL_SUCCESS){
9588+ Failure case.
95589589 }
95599590 \endcode
95609591
9561- \sa FreeSignerTable
95629592 \sa UnlockMutex
95639593*/
95649594int wolfSSL_CertManagerUnloadCAs (WOLFSSL_CERT_MANAGER * cm );
95659595
9596+ /*!
9597+ \ingroup CertManager
9598+ \brief This function unloads intermediate certificates add to the CA
9599+ signer list.
9600+
9601+ \return SSL_SUCCESS returned on successful execution of the function.
9602+ \return BAD_FUNC_ARG returned if the WOLFSSL_CERT_MANAGER is NULL.
9603+ \return BAD_MUTEX_E returned if there was a mutex error.
9604+
9605+ \param cm a pointer to a WOLFSSL_CERT_MANAGER structure,
9606+ created using wolfSSL_CertManagerNew().
9607+
9608+ _Example_
9609+ \code
9610+ #include <wolfssl/ssl.h>
9611+
9612+ WOLFSSL_CTX* ctx = wolfSSL_CTX_new(protocol method);
9613+ WOLFSSL_CERT_MANAGER* cm = wolfSSL_CTX_GetCertManager(ctx);
9614+ ...
9615+ if(wolfSSL_CertManagerUnloadIntermediateCerts(cm) != SSL_SUCCESS){
9616+ Failure case.
9617+ }
9618+ \endcode
9619+
9620+ \sa UnlockMutex
9621+ */
9622+ int wolfSSL_CertManagerUnloadIntermediateCerts (WOLFSSL_CERT_MANAGER * cm );
9623+
95669624/*!
95679625 \ingroup CertManager
95689626 \brief The function will free the Trusted Peer linked list and unlocks
0 commit comments