Skip to content

Commit

Permalink
Updates for doxygen and review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ColtonWilley committed Sep 23, 2024
1 parent e5022e3 commit 720e242
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 2 deletions.
79 changes: 79 additions & 0 deletions doc/dox_comments/header_files/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10012,6 +10012,85 @@ int wolfSSL_CertManagerLoadCRLBuffer(WOLFSSL_CERT_MANAGER* cm,
int wolfSSL_CertManagerSetCRL_Cb(WOLFSSL_CERT_MANAGER* cm,
CbMissingCRL cb);

/*!
\ingroup CertManager
\brief This function sets the CRL Update callback. If
HAVE_CRL and HAVE_CRL_UPDATE_CB is defined , and an entry with the same
issuer and a lower CRL number exists when a CRL is added, then the
CbUpdateCRL is called with the details of the existing entry and the
new one replacing it.
\return SSL_SUCCESS returned upon successful execution of the function and
subroutines.
\return BAD_FUNC_ARG returned if the WOLFSSL_CERT_MANAGER structure is NULL.
\param cm the WOLFSSL_CERT_MANAGER structure holding the information for
the certificate.
\param cb a function pointer to (*CbUpdateCRL) that is set to the
cbUpdateCRL member of the WOLFSSL_CERT_MANAGER.
Signature requirement:
void (*CbUpdateCRL)(CrlInfo *old, CrlInfo *new);
_Example_
\code
#include <wolfssl/ssl.h>
WOLFSSL_CTX* ctx = wolfSSL_CTX_new(protocol method);
WOLFSSL* ssl = wolfSSL_new(ctx);
void cb(CrlInfo *old, CrlInfo *new){
Function body.
}
CbUpdateCRL cb = CbUpdateCRL;
if(ctx){
return wolfSSL_CertManagerSetCRLUpdate_Cb(SSL_CM(ssl), cb);
}
\endcode
\sa CbUpdateCRL
*/
int wolfSSL_CertManagerSetCRLUpdate_Cb(WOLFSSL_CERT_MANAGER* cm,
CbUpdateCRL cb);

/*!
\ingroup CertManager
\brief This function yields a structure with parsed CRL information from
an encoded CRL buffer.
\return SSL_SUCCESS returned upon successful execution of the function and
subroutines.
\return BAD_FUNC_ARG returned if the WOLFSSL_CERT_MANAGER structure is NULL.
\param cm the WOLFSSL_CERT_MANAGER structure..
\param info pointer to caller managed CrlInfo structure that will receive
the CRL information.
\param buff input buffer containing encoded CRL.
\param sz the length in bytes of the input CRL data in buff.
\param type WOLFSSL_FILETYPE_PEM or WOLFSSL_FILETYPE_DER
_Example_
\code
#include <wolfssl/ssl.h>
CrlInfo info;
WOLFSSL_CERT_MANAGER* cm = NULL;
cm = wolfSSL_CertManagerNew();
// Read crl data from file into buffer
wolfSSL_CertManagerGetCRLInfo(cm, &info, crlData, crlDataLen,
WOLFSSL_FILETYPE_PEM);
\endcode
\sa CbUpdateCRL
\sa wolfSSL_SetCRL_Cb
*/
int wolfSSL_CertManagerGetCRLInfo(WOLFSSL_CERT_MANAGER* cm, CrlInfo* info,
const byte* buff, long sz, int type)

/*!
\ingroup CertManager
\brief This function frees the CRL stored in the Cert Manager. An
Expand Down
6 changes: 4 additions & 2 deletions src/crl.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ int CheckCertCRL(WOLFSSL_CRL* crl, DecodedCert* cert)
}

#ifdef HAVE_CRL_UPDATE_CB
static void SetCrlInfo(CRL_Entry* entry, CrlInfo *info) {
static void SetCrlInfo(CRL_Entry* entry, CrlInfo *info)
{
info->issuerHash = (byte *)entry->issuerHash;
info->issuerHashLen = CRL_DIGEST_SIZE;
info->lastDate = (byte *)entry->lastDate;
Expand All @@ -572,7 +573,8 @@ static void SetCrlInfo(CRL_Entry* entry, CrlInfo *info) {
info->crlNumber = (sword32)entry->crlNumber;
}

static void SetCrlInfoFromDecoded(DecodedCRL* entry, CrlInfo *info) {
static void SetCrlInfoFromDecoded(DecodedCRL* entry, CrlInfo *info)
{
info->issuerHash = (byte *)entry->issuerHash;
info->issuerHashLen = SIGNER_DIGEST_SIZE;
info->lastDate = (byte *)entry->lastDate;
Expand Down

0 comments on commit 720e242

Please sign in to comment.