TrustCore SDK NanoSSL API reference  version 7.0
Core (Async and Sync) Client Functions

Core functions required by both asynchronous and synchronous NanoSSL clients. More...

Functions

MOC_EXTERN sbyte4 SSL_getClientSessionInfo (sbyte4 connectionInstance, ubyte *sessionIdLen, ubyte sessionId[SSL_MAXSESSIONIDSIZE], ubyte masterSecret[SSL_MASTERSECRETSIZE])
 Get connection instance's identifying information. More...
 
MOC_EXTERN sbyte4 SSL_setDNSNames (sbyte4 connectionInstance, const CNMatchInfo *cnMatchInfo)
 Specify a list of DNS names acceptable to the client. More...
 

Detailed Description

See also
Asynchronous Client Functions
Synchronous Client Functions
Core (Async and Sync) Client and Server Functions

Function Documentation

◆ SSL_getClientSessionInfo()

MOC_EXTERN sbyte4 SSL_getClientSessionInfo ( sbyte4  connectionInstance,
ubyte *  sessionIdLen,
ubyte  sessionId[SSL_MAXSESSIONIDSIZE],
ubyte  masterSecret[SSL_MASTERSECRETSIZE] 
)

This function retrieves identifying information for the connection instance's context. This information can be saved for SSL session reuse, allowing subsequent connections to be made much more quickly than the initial connection.

Since
1.41
Version
1.41 and later

To enable this function, at least one of the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_SSL_CLIENT__
  • __ENABLE_MOCANA_SSL_ASYNC_CLIENT_API__

ssl.h

Parameters
connectionInstanceConnection instance returned from SSL_connect
sessionIdLenPointer to number of bytes in sessionId.
sessionIdBuffer for returned session ID.
masterSecretBuffer for returned master secret.
Returns
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.
Remarks
This function is applicable to synchronous and asynchronous clients.

ssl.c

◆ SSL_setDNSNames()

MOC_EXTERN sbyte4 SSL_setDNSNames ( sbyte4  connectionInstance,
const CNMatchInfo *  cnMatchInfo 
)

This function specifies a list of DNS names that when matched to the certificate subject name will enable a connection.

Since
2.02
Version
2.02 and later

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_MULTIPLE_COMMON_NAMES__

Additionally, at least one of the following flags must be defined in moptions.h:

  • __ENABLE_MOCANA_SSL_CLIENT__
  • __ENABLE_MOCANA_SSL_ASYNC_CLIENT_API__

ssl.h

Parameters
connectionInstanceConnection instance returned from SSL_connect().
cnMatchInfosPointer to CNMatchInfo structure (defined in ca_mgmt.h) containing acceptable DNS names. The flags field is a bit combination of matchFlag enumerations (see ca_mgmt.h). The length of the array is indicated by setting the name field of the array's final element to NULL.
Returns
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.
MatchInfo myMatchInfo[] = { { 0, "yael.AMT.com"}, {1, ".intel.com"}, {0, NULL} };
SSL_setDNSNames( myConnection, myMatchInfo);

ssl.c