ThingWorx C SDK
|
A template for a SSL/TLS wrapper layer. More...
#include "twOSPort.h"
#include "twLogger.h"
#include "stringUtils.h"
#include "stdio.h"
#include "string.h"
#include "path/to/my/ssl/header.h"
Go to the source code of this file.
Macros | |
#define | TW_SSL my_ssl_struct |
The base SSL structure for your SSL library. | |
#define | TW_SSL_FREE(a) my_ssl_struct_delete(a) |
Calls a function to free the TW_SSL structure. More... | |
#define | TW_SSL_SESSION_ID(a) my_ssl_struct->session_id |
The session ID of the TW_SSL structure. More... | |
#define | TW_SSL_CTX my_ssl_struct_ctx |
The SSL context structure for your SSL library. | |
#define | TW_NEW_SSL_CTX my_ssl_struct_ctx_create() |
Calls a function to create a new TW_SSL_CTX structure. | |
#define | TW_SSL_CTX_FREE(a) my_ssl_struct_ctx_delete() |
Calls a function to free a TW_SSL_CTX structure. More... | |
#define | TW_USE_CERT_FILE(a, b, c) my_ssl_struct_ctx_load_object(a,b,c) |
Calls a function to load the first certificate stored in a file into the TW_SSL_CTX structure. More... | |
#define | TW_USE_KEY_FILE(a, b, c, d) my_ssl_struct_ctx_load_object(a,b,c) |
Calls a function to load the first private key stored in a file into the TW_SSL_CTX structure. More... | |
#define | TW_USE_CERT_CHAIN_FILE(a, b, c) my_ssl_struct_ctx_load_object(a,b,c) |
Calls a function to load the certificate authority cert chain used to validate the server's certificate into the TW_SSL_CTX structure. More... | |
#define | TW_SET_CLIENT_CA_LIST(a, b) my_ssl_struct_ctx_load_object(a,b,NULL) |
Calls a function to load a client certificate authority cert chain into the TW_SSL_CTX structure. More... | |
#define | TW_IS_FIPS_COMPATIBLE() returnValue(TW_FIPS_MODE_NOT_SUPPORTED) |
Calls a function that determines if the SSL library is FIPS mode compatible. More... | |
#define | TW_ENABLE_FIPS_MODE() returnValue(TW_FIPS_MODE_NOT_SUPPORTED) |
Enables FIPS mode. More... | |
#define | TW_DISABLE_FIPS_MODE() returnValue(TW_FIPS_MODE_NOT_SUPPORTED) |
Disables FIPS mode. More... | |
#define | TW_IS_FIPS_MODE_ENABLED() returnValue(FALSE) |
Calls a function that determines if the SSL library is running with FIPS mode. More... | |
#define | TW_SSL_VERSION() returnValue(NULL) |
Output ssl library version. More... | |
#define | TW_SHA1_CTX hash_state |
The structure for your SSL implementation's SHA1 hash. | |
#define | TW_SHA1_INIT(a) sha1_init(a) |
Calls a function to initalize a SHA1 hash. More... | |
#define | TW_SHA1_UPDATE(a, b, c) sha1_process(a,b,c) |
Calls a function to process a SHA1 hash. More... | |
#define | TW_SHA1_FINAL(a, b) sha1_done(b,a) |
Finalize and get the calculated SHA1 digest. More... | |
#define | TW_MD5_CTX hash_state |
The structure for your SSL implementation's MD5 hash. | |
#define | TW_MD5_INIT(a) sha1_init(a) |
Calls a function to initalize a MD5 hash. More... | |
#define | TW_MD5_UPDATE(a, b, c) sha1_process(a,b,c) |
Calls a function to process a MD5 hash. More... | |
#define | TW_MD5_FINAL(a, b) sha1_done(b,a) |
Finalize and get the calculated MD5 digest. More... | |
A template for a SSL/TLS wrapper layer.
#define TW_DISABLE_FIPS_MODE | ( | ) | returnValue(TW_FIPS_MODE_NOT_SUPPORTED) |
Disables FIPS mode.
#define TW_ENABLE_FIPS_MODE | ( | ) | returnValue(TW_FIPS_MODE_NOT_SUPPORTED) |
Enables FIPS mode.
#define TW_IS_FIPS_COMPATIBLE | ( | ) | returnValue(TW_FIPS_MODE_NOT_SUPPORTED) |
Calls a function that determines if the SSL library is FIPS mode compatible.
#define TW_IS_FIPS_MODE_ENABLED | ( | ) | returnValue(FALSE) |
Calls a function that determines if the SSL library is running with FIPS mode.
#define TW_MD5_FINAL | ( | a, | |
b | |||
) | sha1_done(b,a) |
Finalize and get the calculated MD5 digest.
[in] | a | A pointer to the buffer to recieve the digest |
[in] | b | A pointer to a TW_MD5_CTX to finalize |
#define TW_MD5_INIT | ( | a | ) | sha1_init(a) |
Calls a function to initalize a MD5 hash.
[in] | a | A pointer to a TW_MD5_CTX to be initalized |
#define TW_MD5_UPDATE | ( | a, | |
b, | |||
c | |||
) | sha1_process(a,b,c) |
Calls a function to process a MD5 hash.
[in] | a | A pointer to a TW_MD5_CTX to be processed |
[in] | b | A pointer to the message to add to the hash |
[in] | c | The length of the message |
#define TW_SET_CLIENT_CA_LIST | ( | a, | |
b | |||
) | my_ssl_struct_ctx_load_object(a,b,NULL) |
Calls a function to load a client certificate authority cert chain into the TW_SSL_CTX structure.
[in] | a | A pointer to the TW_SSL_CTX structure to load the client certificate authority cert chain into |
[in] | b | The path of the client certificate authority cert chain file to load from |
#define TW_SHA1_FINAL | ( | a, | |
b | |||
) | sha1_done(b,a) |
Finalize and get the calculated SHA1 digest.
[in] | a | A pointer to the buffer to recieve the digest |
[in] | b | A pointer to a TW_SHA1_CTX to finalize |
#define TW_SHA1_INIT | ( | a | ) | sha1_init(a) |
Calls a function to initalize a SHA1 hash.
[in] | a | A pointer to a TW_SHA1_CTX to be initalized |
#define TW_SHA1_UPDATE | ( | a, | |
b, | |||
c | |||
) | sha1_process(a,b,c) |
Calls a function to process a SHA1 hash.
[in] | a | A pointer to a TW_SHA1_CTX to be processed |
[in] | b | A pointer to the message to add to the hash |
[in] | c | The length of the message |
/note SHA1 processes an arbitrary-length message into a fixed-length output of 160 bits, typically represented as a sequence of 40 hexadecimal digits
#define TW_SSL_CTX_FREE | ( | a | ) | my_ssl_struct_ctx_delete() |
Calls a function to free a TW_SSL_CTX structure.
[in] | a | A pointer to the TW_SSL_CTX structure to be freed |
#define TW_SSL_FREE | ( | a | ) | my_ssl_struct_delete(a) |
#define TW_SSL_SESSION_ID | ( | a | ) | my_ssl_struct->session_id |
#define TW_SSL_VERSION | ( | ) | returnValue(NULL) |
Output ssl library version.
#define TW_USE_CERT_CHAIN_FILE | ( | a, | |
b, | |||
c | |||
) | my_ssl_struct_ctx_load_object(a,b,c) |
Calls a function to load the certificate authority cert chain used to validate the server's certificate into the TW_SSL_CTX structure.
[in] | a | A pointer to the TW_SSL_CTX structure to load the certificate authority cert chain into |
[in] | b | The path of the certificate authority cert chain file to load from |
[in] | c | The container format of the file |
#define TW_USE_CERT_FILE | ( | a, | |
b, | |||
c | |||
) | my_ssl_struct_ctx_load_object(a,b,c) |
Calls a function to load the first certificate stored in a file into the TW_SSL_CTX structure.
[in] | a | A pointer to the TW_SSL_CTX structure to load the certificate into |
[in] | b | The path of the certificate file to load from |
[in] | c | The container format of the file |
#define TW_USE_KEY_FILE | ( | a, | |
b, | |||
c, | |||
d | |||
) | my_ssl_struct_ctx_load_object(a,b,c) |
Calls a function to load the first private key stored in a file into the TW_SSL_CTX structure.
[in] | a | A pointer to the TW_SSL_CTX structure to load the private key into |
[in] | b | The path of the private key file to load from |
[in] | c | The container format of the file |