le_iks_aesCmac API Reference

Files

file  le_iks_aesCmac_common.h
 
file  le_iks_aesCmac_interface.h
 

Macros

#define LE_IKS_AESCMAC_MAX_TAG_SIZE   16
 

Typedefs

typedef void(* le_iks_aesCmac_DisconnectHandler_t) (void *)
 

Functions

void le_iks_aesCmac_ConnectService (void)
 
le_result_t le_iks_aesCmac_TryConnectService (void)
 
LE_FULL_API void le_iks_aesCmac_SetServerDisconnectHandler (le_iks_aesCmac_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_iks_aesCmac_DisconnectService (void)
 
le_result_t le_iks_aesCmac_ProcessChunk (uint64_t session, const uint8_t *msgChunkPtr, size_t msgChunkSize)
 
le_result_t le_iks_aesCmac_Done (uint64_t session, uint8_t *tagBufPtr, size_t *tagBufSizePtr)
 
le_result_t le_iks_aesCmac_Verify (uint64_t session, const uint8_t *tagBufPtr, size_t tagBufSize)
 

Detailed Description

Macro Definition Documentation

◆ LE_IKS_AESCMAC_MAX_TAG_SIZE

#define LE_IKS_AESCMAC_MAX_TAG_SIZE   16

Tag size in bytes.

Typedef Documentation

◆ le_iks_aesCmac_DisconnectHandler_t

typedef void(* le_iks_aesCmac_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

Function Documentation

◆ le_iks_aesCmac_ConnectService()

void le_iks_aesCmac_ConnectService ( void  )

Connect the current client thread to the service providing this API. Block until the service is available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client Specific Functions.

This function is created automatically.

◆ le_iks_aesCmac_DisconnectService()

void le_iks_aesCmac_DisconnectService ( void  )

Disconnect the current client thread from the service providing this API.

Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see Client Specific Functions.

This function is created automatically.

◆ le_iks_aesCmac_Done()

le_result_t le_iks_aesCmac_Done ( uint64_t  session,
uint8_t *  tagBufPtr,
size_t *  tagBufSizePtr 
)

Complete message processing and get the processed message's authentication tag.

The maximum size of the authentication tag is MAX_TAG_SIZE. If the supplied buffer is smaller than the maximum tag size then the tag will be truncated. However, all tags produced using the same key must use the same tag size. It is up to the caller to ensure this.

Returns
LE_OK if successful. LE_BAD_PARAMETER if the session reference is invalid or if the key type is invalid or if bufPtr is NULL. LE_UNSUPPORTED if underlying resource does not support this operation. LE_FAULT if no message was processed or le_iks_aesCmac_Done() or le_iks_aesCmac_Verify() has already been called, or if there was an internal error.
Parameters
[in]sessionSession reference.
[out]tagBufPtrBuffer to hold the authentication tag.
[in,out]tagBufSizePtr

◆ le_iks_aesCmac_ProcessChunk()

le_result_t le_iks_aesCmac_ProcessChunk ( uint64_t  session,
const uint8_t *  msgChunkPtr,
size_t  msgChunkSize 
)

Process message chunks. This function may be called multiple times to process the entire message but once a message has been completely processed and le_iks_aesCmac_Done() or le_iks_aesCmac_Verify() has been called this function should not be called again with the same session.

Returns
LE_OK if successful. LE_BAD_PARAMETER if the session reference is invalid or if the key type is invalid or if msgChunkPtr is NULL. LE_UNSUPPORTED if underlying resource does not support this operation. LE_FAULT if no more messages can be processed, ie. le_iks_aesCmac_Done() or le_iks_aesCmac_Verify() has already been called, or if there was an internal error.
Parameters
[in]sessionSession reference.
[in]msgChunkPtrMessage chunk. Must be <= MAX_PACKET_SIZE.
[in]msgChunkSize

◆ le_iks_aesCmac_SetServerDisconnectHandler()

LE_FULL_API void le_iks_aesCmac_SetServerDisconnectHandler ( le_iks_aesCmac_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected.

When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.

◆ le_iks_aesCmac_TryConnectService()

le_result_t le_iks_aesCmac_TryConnectService ( void  )

Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client Specific Functions.

This function is created automatically.

Returns
  • LE_OK if the client connected successfully to the service.
  • LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
  • LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
  • LE_COMM_ERROR if the Service Directory cannot be reached.

◆ le_iks_aesCmac_Verify()

le_result_t le_iks_aesCmac_Verify ( uint64_t  session,
const uint8_t *  tagBufPtr,
size_t  tagBufSize 
)

Complete message processing and compare the resulting authentication tag with the supplied tag.

The maximum size of the authentication tag is MAX_TAG_SIZE. If the supplied tag is smaller than the maximum tag size then only the first tagSize bytes of the tag is compared. However, all tags produced using the same key must use the same tag size. It is up to the caller to ensure this.

Returns
LE_OK if the specified tag matches the calculated message tag. LE_BAD_PARAMETER if the session reference is invalid or if the key type is invalid or if tagPtr is NULL or tagSize is zero. LE_UNSUPPORTED if underlying resource does not support this operation. LE_FAULT if the specified tag does not match the calculated message tag, or if no message was processed or le_iks_aesCmac_Done() or or le_iks_aesCmac_Verify() has already been called, or if there was an internal error.
Parameters
[in]sessionSession reference.
[in]tagBufPtrAuthentication tag to check against.
[in]tagBufSize