![]() |
TrustCore SDK NanoSSL API reference
version 7.0
|
Customizable asynchronous and synchronous NanoSSL server callbacks. More...
Variables | |
sbyte4(* | sslSettings::funcPtrGetHintPSK )(sbyte4 connectionInstance, ubyte hintPSK[SSL_PSK_SERVER_IDENTITY_LENGTH], ubyte4 *pRetHintLength) |
Retrieve a server's preferred PSK. More... | |
sbyte4(* | sslSettings::funcPtrLookupPSK )(sbyte4 connectionInstance, ubyte *pIdentityPSK, ubyte4 identityLengthPSK, ubyte retPSK[SSL_PSK_MAX_LENGTH], ubyte4 *pRetLengthPSK) |
Retrieve a (based on the provided PSK's name/identity) the preferred PSK. More... | |
sbyte4(* | sslSettings::funcPtrLookupPSKParams )(sbyte4 connectionInstance, ubyte *pIdentityPSK, ubyte4 identityLengthPSK, ubyte **pPsk, ubyte4 *pPskLen, intBoolean *pFreeMemory) |
Retrieve a (based on the provided PSK's name/identity) the preferred PSK params. More... | |
sbyte4(* | sslSettings::funcPtrServerDeletePSK )(sbyte4 connectionInstance, sbyte *pServerName, ubyte4 serverNameLen, ubyte *pIdentityPSK, ubyte4 identityLengthPSK, ubyte *pPskParams) |
Save server's preferred PSK. More... | |
sbyte4(* | sslSettings::funcPtrServerSavePSK )(sbyte4 connectionInstance, ubyte *pServerName, ubyte4 serverNameLen, ubyte *pIdentityPSK, ubyte4 identityLengthPSK, ubyte *pPsk, ubyte4 pskLen) |
Save server's preferred PSK. More... | |
The following callbacks can be customized for your application:
sbyte4(* sslSettings::funcPtrGetHintPSK) (sbyte4 connectionInstance, ubyte hintPSK[SSL_PSK_SERVER_IDENTITY_LENGTH], ubyte4 *pRetHintLength) |
This callback function returns a hint through the hintPSK
parameter indicating the server's preferred PSK. To abort the session, the function should return an error code (a negative value) instead of DISPLAY_ERROR
(0).
Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.
To enable this callback, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSL_PSK_SUPPORT__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSL_SERVER__
__ENABLE_MOCANA_SSL_ASYNC_SERVER_API__
connectionInstance | Pointer to the SSL/TLS Client instance. |
hintPSK | On return, the server's preferred PSK. |
pRetHintLength | On return, pointer to number of bytes (excluding any terminating NULL ) in hintPSK . |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sslSettings::funcPtrLookupPSK) (sbyte4 connectionInstance, ubyte *pIdentityPSK, ubyte4 identityLengthPSK, ubyte retPSK[SSL_PSK_MAX_LENGTH], ubyte4 *pRetLengthPSK) |
This callback function looks up the specified identity (the PSK's name) and returns its preferred PSK — the secret used to encrypt data — through the retPSK
parameter. To abort the session, the function should return an error code (a negative value) instead of DISPLAY_ERROR
(0).
Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.
To enable this callback, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSL_PSK_SUPPORT__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSL_SERVER__
__ENABLE_MOCANA_SSL_ASYNC_SERVER_API__
connectionInstance | Pointer to the SSL/TLS Client instance. |
pIdentityPSK | Pointer to buffer containing the PSK identity to look up. |
identityLengthPSK | Number of bytes in PSK identity (pIdentityPSK ). |
retPSK | On return, buffer containing the identity's PSK. |
pRetLengthPSK | On return, pointer to number of bytes in identity's PSK (retPSK ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sslSettings::funcPtrLookupPSKParams) (sbyte4 connectionInstance, ubyte *pIdentityPSK, ubyte4 identityLengthPSK, ubyte **pPsk, ubyte4 *pPskLen, intBoolean *pFreeMemory) |
This callback function looks up the specified identity (the PSK's name) and returns its preferred PSK — the secret used to encrypt data — through the retPSK
parameter. To abort the session, the function should return an error code (a negative value) instead of DISPLAY_ERROR
(0).
Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.
To enable this callback, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSL_PSK_SUPPORT__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSL_SERVER__
__ENABLE_MOCANA_SSL_ASYNC_SERVER_API__
connectionInstance | Pointer to the SSL/TLS Client instance. |
pIdentityPSK | Pointer to buffer containing the PSK identity to look up. |
identityLengthPSK | Number of bytes in PSK identity (pIdentityPSK ). |
pPsk | On return, Pointer to serialized tls13PSK structure. |
pFreeMemory | Should stack free the memory of PSK. Application sets this value when the callback is invoked. If set to true, stack frees the memory. If set to FALSE, it is application's responsibility to free the memory. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sslSettings::funcPtrServerDeletePSK) (sbyte4 connectionInstance, sbyte *pServerName, ubyte4 serverNameLen, ubyte *pIdentityPSK, ubyte4 identityLengthPSK, ubyte *pPskParams) |
This callback function updates the existing psk To abort the session, the function should return an error code (a negative value) instead of DISPLAY_ERROR
(0).
Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.
To enable this callback, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSL_PSK_SUPPORT__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSL_SERVER__
__ENABLE_MOCANA_SSL_ASYNC_SERVER_API__
connectionInstance | Pointer to the SSL/TLS Client instance. |
pServerName | Name of the server. |
serverNameLen | Length of the server name. |
pIdentityPSK | Pointer to buffer containing the PSK identity to look up. |
identityLengthPSK | Number of bytes in PSK identity (pIdentityPSK ). |
pPskParams | Serialized tls13PSk structure. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sslSettings::funcPtrServerSavePSK) (sbyte4 connectionInstance, ubyte *pServerName, ubyte4 serverNameLen, ubyte *pIdentityPSK, ubyte4 identityLengthPSK, ubyte *pPsk, ubyte4 pskLen) |
This callback function saves associated paramter with psk server's preferred PSK. To abort the session, the function should return an error code (a negative value) instead of DISPLAY_ERROR
(0).
Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.
To enable this callback, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSL_PSK_SUPPORT__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSL_SERVER__
__ENABLE_MOCANA_SSL_ASYNC_SERVER_API__
connectionInstance | Pointer to the SSL/TLS Client instance. |
pServerName | Name of the server. |
serverNameLen | Length of the server name. |
pIdentityPSK | Pointer to buffer containing the PSK identity to look up. |
identityLengthPSK | Number of bytes in PSK identity (pIdentityPSK ). |
pPsk | Serialized tls13PSk structure. |
pskLen | Length of PSK. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.