Merge pull request #3159 from ethanlooney/16th_branch

Added doxygen comments and changed footer date to 2020
This commit is contained in:
Chris Conlon
2020-07-27 09:24:59 -06:00
committed by GitHub
4 changed files with 308 additions and 1 deletions

View File

@ -149,6 +149,27 @@ int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id);
WOLFSSL_API
int wc_ecc_check_key(ecc_key* key);
/*!
\ingroup ECC
\brief This function frees an ecc_key key after it has been used.
\param key pointer to the ecc_key structure to free
_Example_
\code
// initialize key and perform ECC operations
...
wc_ecc_key_free(&key);
\endcode
\sa wc_ecc_key_new
\sa wc_ecc_init_ex
*/
WOLFSSL_API
void wc_ecc_key_free(ecc_key* key);
/*!
\ingroup ECC
@ -541,6 +562,54 @@ int wc_ecc_verify_hash_ex(mp_int *r, mp_int *s, const byte* hash,
WOLFSSL_API
int wc_ecc_init(ecc_key* key);
/*!
\ingroup ECC
\brief This function initializes an ecc_key object for future
use with message verification or key negotiation.
\return 0 Returned upon successfully initializing the ecc_key object
\return MEMORY_E Returned if there is an error allocating memory
\param key pointer to the ecc_key object to initialize
\param devId ID to use with async hardware
\param heap pointer to a heap identifier
_Example_
\code
ecc_key key;
wc_ecc_init_ex(&key, heap, devId);
\endcode
\sa wc_ecc_make_key
\sa wc_ecc_free
\sa wc_ecc_init
*/
WOLFSSL_API
int wc_ecc_init_ex(ecc_key* key, void* heap, int devId);
/*!
\ingroup ECC
\brief This function uses a user defined heap and allocates space for the
key structure.
\return 0 Returned upon successfully initializing the ecc_key object
\return MEMORY_E Returned if there is an error allocating memory
_Example_
\code
wc_ecc_key_new(&heap);
\endcode
\sa wc_ecc_make_key
\sa wc_ecc_key_free
\sa wc_ecc_init
*/
WOLFSSL_API
ecc_key* wc_ecc_key_new(void* heap);
/*!
\ingroup ECC

View File

@ -137,6 +137,38 @@ WOLFSSL_API int wc_InitRng(WC_RNG*);
*/
WOLFSSL_API int wc_RNG_GenerateBlock(WC_RNG*, byte*, word32 sz);
/*!
\ingroup Random
\brief Creates a new WC_RNG structure.
\return WC_RNG structure on success
\return NULL on error
\param heap pointer to a heap identifier
\param nonce pointer to the buffer containing the nonce
\param nonceSz length of the nonce
_Example_
\code
RNG rng;
byte nonce[] = { initialize nonce };
word32 nonceSz = sizeof(nonce);
wc_rng_new(&nonce, nonceSz, &heap);
\endcode
\sa wc_InitRng
\sa wc_rng_free
\sa wc_FreeRng
\sa wc_RNG_HealthTest
*/
WOLFSSL_API WC_RNG* wc_rng_new(byte* nonce, word32 nonceSz, void* heap)
/*!
\ingroup Random
@ -211,6 +243,36 @@ WOLFSSL_API int wc_RNG_GenerateByte(WC_RNG*, byte*);
*/
WOLFSSL_API int wc_FreeRng(WC_RNG*);
/*!
\ingroup Random
\brief Should be called when RNG no longer needed in order to securely
free rng.
\param rng random number generator initialized with wc_InitRng
_Example_
\code
RNG rng;
byte nonce[] = { initialize nonce };
word32 nonceSz = sizeof(nonce);
rng = wc_rng_new(&nonce, nonceSz, &heap);
// use rng
wc_rng_free(&rng);
\endcode
\sa wc_InitRng
\sa wc_rng_new
\sa wc_FreeRng
\sa wc_RNG_HealthTest
*/
WOLFSSL_API WC_RNG* wc_rng_free(WC_RNG* rng);
/*!
\ingroup Random

View File

@ -2659,6 +2659,75 @@ WOLFSSL_API void wolfSSL_load_error_strings(void);
*/
WOLFSSL_API int wolfSSL_library_init(void);
/*!
\brief This function sets the Device Id at the WOLFSSL session level.
\return WOLFSSL_SUCCESS upon success.
\return BAD_FUNC_ARG if ssl is NULL.
\param ssl pointer to a SSL object, created with wolfSSL_new().
\param devId ID to use with async hardware
_Example_
\code
WOLFSSL* ssl;
int DevId = -2;
wolfSSL_SetDevId(ssl, devId);
\endcode
\sa wolfSSL_CTX_SetDevId
\sa wolfSSL_CTX_GetDevId
*/
WOLFSSL_API int wolfSSL_SetDevId(WOLFSSL* ssl, int devId)
/*!
\brief This function sets the Device Id at the WOLFSSL_CTX context level.
\return WOLFSSL_SUCCESS upon success.
\return BAD_FUNC_ARG if ssl is NULL.
\param ssl pointer to a SSL object, created with wolfSSL_new().
\param devId ID to use with async hardware
_Example_
\code
WOLFSSL_CTX* ctx;
int DevId = -2;
wolfSSL_CTX_SetDevId(ctx, devId);
\endcode
\sa wolfSSL_SetDevId
\sa wolfSSL_CTX_GetDevId
*/
WOLFSSL_API int wolfSSL_CTX_SetDevId(WOLFSSL_CTX* ctx, int devId)
/*!
\brief This function retrieves the Device Id.
\return devId upon success.
\return INVALID_DEVID if both ssl and ctx are NULL.
\param ctx pointer to the SSL context, created with wolfSSL_CTX_new().
\param ssl pointer to a SSL object, created with wolfSSL_new().
_Example_
\code
WOLFSSL_CTX* ctx;
wolfSSL_CTX_GetDevId(ctx, ssl);
\endcode
\sa wolfSSL_SetDevId
\sa wolfSSL_CTX_SetDevId
*/
WOLFSSL_API int wolfSSL_CTX_GetDevId(WOLFSSL_CTX* ctx, WOLFSSL* ssl);
/*!
\ingroup Setup
@ -4385,6 +4454,31 @@ WOLFSSL_API int wolfSSL_X509_NAME_get_text_by_NID(
*/
WOLFSSL_API int wolfSSL_X509_get_signature_type(WOLFSSL_X509*);
/*!
\brief This function frees a WOLFSSL_X509 structure.
\param x509 a pointer to the WOLFSSL_X509 struct.
_Example_
\code
WOLFSSL_X509* x509 = (WOLFSSL_X509*)XMALOC(sizeof(WOLFSSL_X509), NULL,
DYNAMIC_TYPE_X509) ;
wolfSSL_X509_free(x509);
\endcode
\sa wolfSSL_X509_get_signature
\sa wolfSSL_X509_version
\sa wolfSSL_X509_get_der
\sa wolfSSL_X509_get_serial_number
\sa wolfSSL_X509_notBefore
\sa wolfSSL_X509_notAfter
*/
WOLFSSL_API void wolfSSL_X509_free(WOLFSSL_X509* x509);
/*!
\ingroup CertsKeys
@ -4500,6 +4594,67 @@ WOLFSSL_API WOLFSSL_STACK* wolfSSL_X509_STORE_CTX_get_chain(
WOLFSSL_API int wolfSSL_X509_STORE_set_flags(WOLFSSL_X509_STORE* store,
unsigned long flag);
/*!
\ingroup CertsKeys
\brief This function the certificate "not before" validity encoded as
a byte array.
\return NULL returned if the WOLFSSL_X509 structure is NULL.
\return byte is returned that contains the notBeforeData.
\param x509 pointer to a WOLFSSL_X509 structure.
_Example_
\code
WOLFSSL_X509* x509 = (WOLFSSL_X509*)XMALLOC(sizeof(WOLFSSL_X509), NULL,
DYNAMIC_TYPE_X509);
...
byte* notBeforeData = wolfSSL_X509_notBefore(x509);
\endcode
\sa wolfSSL_X509_get_signature
\sa wolfSSL_X509_version
\sa wolfSSL_X509_get_der
\sa wolfSSL_X509_get_serial_number
\sa wolfSSL_X509_notAfter
\sa wolfSSL_X509_free
*/
WOLFSSL_API const byte* wolfSSL_X509_notBefore(WOLFSSL_X509* x509);
/*!
\ingroup CertsKeys
\brief This function the certificate "not after" validity encoded as
a byte array.
\return NULL returned if the WOLFSSL_X509 structure is NULL.
\return byte is returned that contains the notAfterData.
\param x509 pointer to a WOLFSSL_X509 structure.
_Example_
\code
WOLFSSL_X509* x509 = (WOLFSSL_X509*)XMALLOC(sizeof(WOLFSSL_X509), NULL,
DYNAMIC_TYPE_X509);
...
byte* notAfterData = wolfSSL_X509_notAfter(x509);
\endcode
\sa wolfSSL_X509_get_signature
\sa wolfSSL_X509_version
\sa wolfSSL_X509_get_der
\sa wolfSSL_X509_get_serial_number
\sa wolfSSL_X509_notBefore
\sa wolfSSL_X509_free
*/
WOLFSSL_API const byte* wolfSSL_X509_notAfter(WOLFSSL_X509* x509);
/*!
\ingroup Setup
@ -7567,6 +7722,27 @@ WOLFSSL_API int wolfSSL_DTLS_SetCookieSecret(WOLFSSL*,
const unsigned char*,
unsigned int);
/*!
\brief This function retrieves the random number.
\return rng upon success.
\return NULL if ssl is NULL.
\param ssl pointer to a SSL object, created with wolfSSL_new().
_Example_
\code
WOLFSSL* ssl;
wolfSSL_GetRNG(ssl);
\endcode
\sa wolfSSL_CTX_new_rng
*/
WOLFSSL_API WC_RNG* wolfSSL_GetRNG(WOLFSSL* ssl);
/*!
\ingroup Setup

View File

@ -32,7 +32,7 @@
</ul>
</div>
<div id="lowCenter">
<p class="footText" id="center">Copyright &#169 2017 wolfSSL Inc.<br>All rights reserved.</p>
<p class="footText" id="center">Copyright &#169 2020 wolfSSL Inc.<br>All rights reserved.</p>
<div class="lowNav">
<p class="footText">Help and Support</p>
<ul class="lowNavList">