My Project
|
Functions | |
int | wolfSSL_shutdown (WOLFSSL *) |
This function shuts down an active SSL/TLS connection using the SSL session, ssl. This function will try to send a “close notify” alert to the peer. The calling application can choose to wait for the peer to send its “close notify” alert in response or just go ahead and shut down the underlying connection after directly calling wolfSSL_shutdown (to save resources). Either option is allowed by the TLS specification. If the underlying connection will be used again in the future, the complete two-directional shutdown procedure must be performed to keep synchronization intact between the peers. wolfSSL_shutdown() works with both blocking and non-blocking I/O. When the underlying I/O is non-blocking, wolfSSL_shutdown() will return an error if the underlying I/O could not satisfy the needs of wolfSSL_shutdown() to continue. In this case, a call to wolfSSL_get_error() will yield either SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. The calling process must then repeat the call to wolfSSL_shutdown() when the underlying I/O is ready. More... | |
int | wolfSSL_SetServerID (WOLFSSL *ssl, const unsigned char *id, int len, int newSession) |
This function associates the client session with the server id. If the newSession flag is on, an existing session won’t be reused. More... | |
int | wolfSSL_library_init (void) |
This function is called internally in wolfSSL_CTX_new(). This function is a wrapper around wolfSSL_Init() and exists for OpenSSL compatibility (SSL_library_init) when wolfSSL has been compiled with OpenSSL compatibility layer. wolfSSL_Init() is the more typically-used wolfSSL initialization function. More... | |
int | wolfSSL_get_shutdown (const WOLFSSL *ssl) |
This function checks the shutdown conditions in closeNotify or connReset or sentNotify members of the Options structure. The Options structure is within the WOLFSSL structure. More... | |
int | wolfSSL_is_init_finished (WOLFSSL *ssl) |
This function checks to see if the connection is established. More... | |
int | wolfSSL_Init (void) |
Initializes the wolfSSL library for use. Must be called once per application and before any other call to the library. More... | |
int | wolfSSL_Cleanup (void) |
Un-initializes the wolfSSL library from further use. Doesn’t have to be called, though it will free any resources used by the library. More... | |
int | wolfSSL_SetMinVersion (WOLFSSL *ssl, int version) |
This function sets the minimum downgrade version allowed. Applicable only when the connection allows downgrade using (wolfSSLv23_client_method or wolfSSLv23_server_method). More... | |
int | wolfSSL_ALPN_GetProtocol (WOLFSSL *ssl, char **protocol_name, unsigned short *size) |
This function gets the protocol name set by the server. More... | |
int | wolfSSL_ALPN_GetPeerProtocol (WOLFSSL *ssl, char **list, unsigned short *listSz) |
This function copies the alpn_client_list data from the SSL object to the buffer. More... | |
int | wolfSSL_MakeTlsMasterSecret (unsigned char *ms, word32 msLen, const unsigned char *pms, word32 pmsLen, const unsigned char *cr, const unsigned char *sr, int tls1_2, int hash_type) |
This function copies the values of cr and sr then passes through to wc_PRF (pseudo random function) and returns that value. More... | |
int | wolfSSL_preferred_group (WOLFSSL *ssl) |
This function returns the key exchange group the client prefers to use in the TLS v1.3 handshake. Call this function to after a handshake is complete to determine which group the server prefers so that this information can be used in future connections to pre-generate a key pair for key exchange. More... | |
int | wolfSSL_get_client_suites_sigalgs (const WOLFSSL *ssl, const byte **suites, word16 *suiteSz, const byte **hashSigAlgo, word16 *hashSigAlgoSz) |
This function returns the raw list of ciphersuites and signature algorithms offered by the client. The lists are only stored and returned inside a callback setup with wolfSSL_CTX_set_cert_cb(). This is useful to be able to dynamically load certificates and keys based on the available ciphersuites and signature algorithms. More... | |
WOLFSSL_CIPHERSUITE_INFO | wolfSSL_get_ciphersuite_info (byte first, byte second) |
This returns information about the ciphersuite directly from the raw ciphersuite bytes. More... | |
int | wolfSSL_get_sigalg_info (byte first, byte second, int *hashAlgo, int *sigAlgo) |
This returns information about the hash and signature algorithm directly from the raw ciphersuite bytes. More... | |
int wolfSSL_ALPN_GetPeerProtocol | ( | WOLFSSL * | ssl, |
char ** | list, | ||
unsigned short * | listSz | ||
) |
This function copies the alpn_client_list data from the SSL object to the buffer.
ssl | a pointer to a WOLFSSL structure, created using wolfSSL_new(). |
list | a pointer to the buffer. The data from the SSL object will be copied into it. |
listSz | the buffer size. |
Example
int wolfSSL_ALPN_GetProtocol | ( | WOLFSSL * | ssl, |
char ** | protocol_name, | ||
unsigned short * | size | ||
) |
This function gets the protocol name set by the server.
ssl | a pointer to a WOLFSSL structure, created using wolfSSL_new(). |
protocol_name | a pointer to a char that represents the protocol name and will be held in the ALPN structure. |
size | a word16 type that represents the size of the protocol_name. |
Example
int wolfSSL_Cleanup | ( | void | ) |
Un-initializes the wolfSSL library from further use. Doesn’t have to be called, though it will free any resources used by the library.
Example
WOLFSSL_CIPHERSUITE_INFO wolfSSL_get_ciphersuite_info | ( | byte | first, |
byte | second | ||
) |
This returns information about the ciphersuite directly from the raw ciphersuite bytes.
[in] | first | First byte of the ciphersuite |
[in] | second | Second byte of the ciphersuite |
Example
int wolfSSL_get_client_suites_sigalgs | ( | const WOLFSSL * | ssl, |
const byte ** | suites, | ||
word16 * | suiteSz, | ||
const byte ** | hashSigAlgo, | ||
word16 * | hashSigAlgoSz | ||
) |
This function returns the raw list of ciphersuites and signature algorithms offered by the client. The lists are only stored and returned inside a callback setup with wolfSSL_CTX_set_cert_cb(). This is useful to be able to dynamically load certificates and keys based on the available ciphersuites and signature algorithms.
[in] | ssl | The WOLFSSL object to extract the lists from. |
[out] | optional | suites Raw and unfiltered list of client ciphersuites |
[out] | optional | suiteSz Size of suites in bytes |
[out] | optional | hashSigAlgo Raw and unfiltered list of client signature algorithms |
[out] | optional | hashSigAlgoSz Size of hashSigAlgo in bytes |
Example
int wolfSSL_get_shutdown | ( | const WOLFSSL * | ssl | ) |
This function checks the shutdown conditions in closeNotify or connReset or sentNotify members of the Options structure. The Options structure is within the WOLFSSL structure.
ssl | a constant pointer to a WOLFSSL structure, created using wolfSSL_new(). |
Example
int wolfSSL_get_sigalg_info | ( | byte | first, |
byte | second, | ||
int * | hashAlgo, | ||
int * | sigAlgo | ||
) |
This returns information about the hash and signature algorithm directly from the raw ciphersuite bytes.
[in] | first | First byte of the hash and signature algorithm |
[in] | second | Second byte of the hash and signature algorithm |
[out] | hashAlgo | The enum wc_HashType of the MAC algorithm |
[out] | sigAlgo | The enum Key_Sum of the authentication algorithm |
Example
int wolfSSL_Init | ( | void | ) |
Initializes the wolfSSL library for use. Must be called once per application and before any other call to the library.
Example
int wolfSSL_is_init_finished | ( | WOLFSSL * | ssl | ) |
This function checks to see if the connection is established.
ssl | a pointer to a WOLFSSL structure, created using wolfSSL_new(). |
EXAMPLE
int wolfSSL_library_init | ( | void | ) |
This function is called internally in wolfSSL_CTX_new(). This function is a wrapper around wolfSSL_Init() and exists for OpenSSL compatibility (SSL_library_init) when wolfSSL has been compiled with OpenSSL compatibility layer. wolfSSL_Init() is the more typically-used wolfSSL initialization function.
none | No parameters. |
Example
int wolfSSL_MakeTlsMasterSecret | ( | unsigned char * | ms, |
word32 | msLen, | ||
const unsigned char * | pms, | ||
word32 | pmsLen, | ||
const unsigned char * | cr, | ||
const unsigned char * | sr, | ||
int | tls1_2, | ||
int | hash_type | ||
) |
This function copies the values of cr and sr then passes through to wc_PRF (pseudo random function) and returns that value.
ms | the master secret held in the Arrays structure. |
msLen | the length of the master secret. |
pms | the pre-master secret held in the Arrays structure. |
pmsLen | the length of the pre-master secret. |
cr | the client random. |
sr | the server random. |
tls1_2 | signifies that the version is at least tls version 1.2. |
hash_type | signifies the hash type. |
Example
int wolfSSL_preferred_group | ( | WOLFSSL * | ssl | ) |
This function returns the key exchange group the client prefers to use in the TLS v1.3 handshake. Call this function to after a handshake is complete to determine which group the server prefers so that this information can be used in future connections to pre-generate a key pair for key exchange.
[in,out] | ssl | a pointer to a WOLFSSL structure, created using wolfSSL_new(). |
Example
int wolfSSL_SetMinVersion | ( | WOLFSSL * | ssl, |
int | version | ||
) |
This function sets the minimum downgrade version allowed. Applicable only when the connection allows downgrade using (wolfSSLv23_client_method or wolfSSLv23_server_method).
ssl | a pointer to a WOLFSSL structure, created using wolfSSL_new(). |
version | an integer representation of the version to be set as the minimum: WOLFSSL_SSLV3 = 0, WOLFSSL_TLSV1 = 1, WOLFSSL_TLSV1_1 = 2 or WOLFSSL_TLSV1_2 = 3. |
Example
int wolfSSL_SetServerID | ( | WOLFSSL * | ssl, |
const unsigned char * | id, | ||
int | len, | ||
int | newSession | ||
) |
This function associates the client session with the server id. If the newSession flag is on, an existing session won’t be reused.
ssl | a pointer to a WOLFSSL structure, created using wolfSSL_new(). |
id | a constant byte pointer that will be copied to the serverID member of the WOLFSSL_SESSION structure. |
len | an int type representing the length of the session id parameter. |
newSession | an int type representing the flag to denote whether to reuse a session or not. |
Example
int wolfSSL_shutdown | ( | WOLFSSL * | ) |
This function shuts down an active SSL/TLS connection using the SSL session, ssl. This function will try to send a “close notify” alert to the peer. The calling application can choose to wait for the peer to send its “close notify” alert in response or just go ahead and shut down the underlying connection after directly calling wolfSSL_shutdown (to save resources). Either option is allowed by the TLS specification. If the underlying connection will be used again in the future, the complete two-directional shutdown procedure must be performed to keep synchronization intact between the peers. wolfSSL_shutdown() works with both blocking and non-blocking I/O. When the underlying I/O is non-blocking, wolfSSL_shutdown() will return an error if the underlying I/O could not satisfy the needs of wolfSSL_shutdown() to continue. In this case, a call to wolfSSL_get_error() will yield either SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. The calling process must then repeat the call to wolfSSL_shutdown() when the underlying I/O is ready.
ssl | pointer to the SSL session created with wolfSSL_new(). |
Example