wolfSSL Manual

Docs -> wolfSSL Manual

Chapter 17: wolfSSL API Reference


17.7  Informational


The functions in this section are informational.  They allow the application to gather some kind of information about the current status or setup of wolfSSL.






CyaSSL_GetObjectSize


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_GetObjectSize(void);


Description:

This function returns the size of the CYASSL object and will be dependent on build options and settings.  If SHOW_SIZES has been defined when building CyaSSL, this function will also print the sizes of individual objects within the CYASSL object (Suites, Ciphers, etc.) to stdout.


Return Values:

This function returns the size of the CYASSL object.


Parameters:


This function has no parameters.


Example:


int size = 0;

size = CyaSSL_GetObjectSize();

printf(“sizeof(CYASSL) = %d\n”, size);


See Also:

CyaSSL_new();






CyaSSL_GetMacSecret


Synopsis:

#include <cyassl/ssl.h>


const unsigned char* CyaSSL_GetMacSecret(CYASSL* ssl, int verify);


Description:

Allows retrieval of the Hmac/Mac secret from the handshake process.  The verify parameter specifies whether this is for verification of a peer message.


Return Values:

If successful the call will return a valid pointer to the secret.  The size of the secret can be obtained from CyaSSL_GetHmacSize().


NULL will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


verify - specifies whether this is for verification of a peer message.


See Also:

CyaSSL_GetHmacSize()






CyaSSL_GetClientWriteKey


Synopsis:

#include <cyassl/ssl.h>


const unsigned char* CyaSSL_GetClientWriteKey(CYASSL* ssl);


Description:

Allows retrieval of the client write key from the handshake process.


Return Values:

If successful the call will return a valid pointer to the key.  The size of the key can be obtained from CyaSSL_GetKeySize().


NULL will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetKeySize()

CyaSSL_GetClientWriteIV()






CyaSSL_GetClientWriteIV


Synopsis:

#include <cyassl/ssl.h>


const unsigned char* CyaSSL_GetClientWriteIV(CYASSL* ssl);


Description:

Allows retrieval of the client write IV (initialization vector) from the handshake process.


Return Values:

If successful the call will return a valid pointer to the IV.  The size of the IV can be obtained from CyaSSL_GetCipherBlockSize().


NULL will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetCipherBlockSize()

CyaSSL_GetClientWriteKey()






CyaSSL_GetServerWriteKey


Synopsis:

#include <cyassl/ssl.h>


const unsigned char* CyaSSL_GetServerWriteKey(CYASSL* ssl);


Description:

Allows retrieval of the server write key from the handshake process.


Return Values:

If successful the call will return a valid pointer to the key.  The size of the key can be obtained from CyaSSL_GetKeySize().


NULL will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetKeySize()

CyaSSL_GetServerWriteIV()






CyaSSL_GetServerWriteIV


Synopsis:

#include <cyassl/ssl.h>


const unsigned char* CyaSSL_GetServerWriteIV(CYASSL* ssl);


Description:

Allows retrieval of the server write IV (initialization vector) from the handshake process.


Return Values:

If successful the call will return a valid pointer to the IV.  The size of the IV can be obtained from CyaSSL_GetCipherBlockSize().


NULL will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetCipherBlockSize()

CyaSSL_GetClientWriteKey()






CyaSSL_GetKeySize


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_GetKeySize(CYASSL* ssl);


Description:

Allows retrieval of the server write IV (initialization vector) from the handshake process.


Return Values:

If successful the call will return the key size in bytes.


BAD_FUNC_ARG will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetClientWriteKey()

CyaSSL_GetServerWriteKey()






CyaSSL_GetSide


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_GetSide(CYASSL* ssl);


Description:

Allows retrieval of the side of this CYASSL connection.


Return Values:

If successful the call will return either CYASSL_SERVER_END or CYASSL_CLIENT_END depending on the side of CYASSL object.


BAD_FUNC_ARG will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetClientWriteKey()

CyaSSL_GetServerWriteKey()






CyaSSL_IsTLSv1_1


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_IsTLSV1_1(CYASSL* ssl);


Description:

Allows caller to determine if the negotiated protocol version is at least TLS version 1.1 or greater.


Return Values:

If successful the call will return 1 for true or 0 for false.


BAD_FUNC_ARG will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetSide()






CyaSSL_GetBulkCipher


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_GetBulkCipher(CYASSL* ssl);


Description:

Allows caller to determine the negotiated bulk cipher algorithm from the handshake.


Return Values:

If successful the call will return one of the following:


cyassl_cipher_null

cyassl_des

cyassl_triple_des

cyassl_aes

cyassl_aes_gcm

cyassl_aes_ccm

cyassl_camellia

cyassl_hc128

cyassl_rabbit


BAD_FUNC_ARG will be returned for an error state.



Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetCipherBlockSize()

CyaSSL_GetKeySize()






CyaSSL_GetCipherBlockSize


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_GetCipherBlockSize(CYASSL* ssl);


Description:

Allows caller to determine the negotiated cipher block size from the handshake.


Return Values:

If successful the call will return the size in bytes of the cipher block size.


BAD_FUNC_ARG will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetBulkCipher()

CyaSSL_GetKeySize()






CyaSSL_GetAeadMacSize


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_GetAeadMacSize(CYASSL* ssl);


Description:

Allows caller to determine the negotiated aead mac size from the handshake.  For cipher type CYASSL_AEAD_TYPE.


Return Values:

If successful the call will return the size in bytes of the aead mac size.


BAD_FUNC_ARG will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetBulkCipher()

CyaSSL_GetKeySize()






CyaSSL_GetHmacSize


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_GetHmacSize(CYASSL* ssl);


Description:

Allows caller to determine the negotiated (h)mac size from the handshake.  For cipher types except CYASSL_AEAD_TYPE.


Return Values:

If successful the call will return the size in bytes of the (h)mac size.


BAD_FUNC_ARG will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetBulkCipher()

CyaSSL_GetHmacType()






CyaSSL_GetHmacType


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_GetHmacType(CYASSL* ssl);


Description:

Allows caller to determine the negotiated (h)mac type from the handshake.  For cipher types except CYASSL_AEAD_TYPE.


Return Values:

If successful the call will return one of the following:


MD5

SHA

SHA256

SHA384


BAD_FUNC_ARG or SSL_FATAL_ERROR will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetBulkCipher()

CyaSSL_GetHmacSize()






CyaSSL_GetCipherType


Synopsis:

#include <cyassl/ssl.h>


int CyaSSL_GetCipherType(CYASSL* ssl);


Description:

Allows caller to determine the negotiated cipher type from the handshake.


Return Values:

If successful the call will return one of the following:


CYASSL_BLOCK_TYPE

CYASSL_STREAM_TYPE

CYASSL_AEAD_TYPE


BAD_FUNC_ARG will be returned for an error state.


Parameters:


ssl - a pointer to a CYASSL object, created using CyaSSL_new().


See Also:

CyaSSL_GetBulkCipher()

CyaSSL_GetHmacType()




 

Questions? +1 (425) 245-8247