Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions

     Provides detail on the available APIs for the SSL Layer.

Functions

NMI_API void m2m_ssl_ecc_process_done (void)
 Allow SSL driver to tidy up after application has finished processing ECC message. More...
 
NMI_API sint8 m2m_ssl_handshake_rsp (tstrEccReqInfo *strECCResp, uint8 *pu8RspDataBuff, uint16 u16RspDataSz)
 Sends ECC responses to the WINC. More...
 
NMI_API sint8 m2m_ssl_init (tpfAppSSLCb pfAppSSLCb)
 Initializes the SSL layer. More...
 
NMI_API sint8 m2m_ssl_retrieve_cert (uint16 *pu16Curve, uint8 *pu8Value, uint8 *pu8Sig, tstrECPoint *pstrKey)
 Retrieve the next set of information from the WINC for ECDSA verification. More...
 
NMI_API sint8 m2m_ssl_retrieve_hash (uint8 *pu8Value, uint16 u16ValueSz)
 Retrieve the value from the WINC for ECDSA signing. More...
 
NMI_API sint8 m2m_ssl_retrieve_next_for_verifying (tenuEcNamedCurve *penuCurve, uint8 *pu8Value, uint16 *pu16ValueSz, uint8 *pu8Sig, uint16 *pu16SigSz, tstrECPoint *pstrKey)
 Retrieve the next set of information from the WINC for ECDSA verification. More...
 
NMI_API sint8 m2m_ssl_send_certs_to_winc (uint8 *pu8Buffer, uint32 u32BufferSz)
 Sends certificates to the WINC. More...
 
NMI_API sint8 m2m_ssl_set_active_ciphersuites (uint32 u32SslCsBMP)
 Sets the active ciphersuites. More...
 
NMI_API void m2m_ssl_stop_processing_certs (void)
 Allow SSL driver to tidy up in case application does not read all available certificates. More...
 
NMI_API void m2m_ssl_stop_retrieving (void)
 Allow SSL driver to tidy up when the application chooses not to retrieve all available information. More...
 

NMI_API void m2m_ssl_ecc_process_done ( void  )

Allow SSL driver to tidy up after application has finished processing ECC message.

Returns
None.
Warning
The application should call this function after receiving an SSL callback with message type M2M_SSL_REQ_ECC, after retrieving any related information, and before calling m2m_ssl_handshake_rsp.
NMI_API sint8 m2m_ssl_handshake_rsp ( tstrEccReqInfo strECCResp,
uint8 pu8RspDataBuff,
uint16  u16RspDataSz 
)

Sends ECC responses to the WINC.

Parameters
[in]strECCRespECC Response struct.
[in]pu8RspDataBuffPointer of the response data to be sent.
[in]u16RspDataSzResponse data size.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
@param [in] strECCResp
            ECC Response struct.
@param [in] pu8RspDataBuff
            Pointer of the response data to be sent.
@param [in] u16RspDataSz
            Response data size.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
NMI_API sint8 m2m_ssl_init ( tpfAppSSLCb  pfAppSSLCb)

Initializes the SSL layer.

Parameters
[in]pfAppSslCbApplication SSL callback function.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
Parameters
[in]pfAppSSLCbApplication SSL callback function.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
NMI_API sint8 m2m_ssl_retrieve_cert ( uint16 pu16Curve,
uint8 pu8Value,
uint8 pu8Sig,
tstrECPoint pstrKey 
)

Retrieve the next set of information from the WINC for ECDSA verification.

Parameters
[out]pu16CurveThe named curve, to be cast to type tenuEcNamedCurve.
[out]pu8ValueValue retrieved for verification. This is the digest of the message, truncated/prepended to the appropriate size. The size of the value is equal to the field size of the curve, hence is determined by pu16Curve.
[out]pu8SigSignature retrieved for verification. The size of the signature is equal to twice the field size of the curve, hence is determined by pu16Curve.
[out]pstrKeyPublic key retrieved for verification.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
Precondition
This function should only be called after the application has been notified that verification information is ready via ECC_REQ_SIGN_VERIFY.
Warning
If this function returns M2M_ERR_FAIL, then any remaining verification info from the WINC is lost.
This API has been deprecated and is kept for legacy purposes only. It is recommended that m2m_ssl_retrieve_next_for_verifying is used instead.
NMI_API sint8 m2m_ssl_retrieve_hash ( uint8 pu8Value,
uint16  u16ValueSz 
)

Retrieve the value from the WINC for ECDSA signing.

Parameters
[out]pu8ValueValue retrieved for signing. This is the digest of the message, truncated/prepended to the appropriate size.
[in]u16ValueSzSize of value to be retrieved. (The application should obtain this information, along with the curve, from the associated ECC_REQ_SIGN_GEN notification.)
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
Precondition
This function should only be called after the application has been notified that signing information is ready via ECC_REQ_SIGN_GEN.
Warning
If this function returns M2M_ERR_FAIL, then the value for signing is lost.
NMI_API sint8 m2m_ssl_retrieve_next_for_verifying ( tenuEcNamedCurve penuCurve,
uint8 pu8Value,
uint16 pu16ValueSz,
uint8 pu8Sig,
uint16 pu16SigSz,
tstrECPoint pstrKey 
)

Retrieve the next set of information from the WINC for ECDSA verification.

Parameters
[out]penuCurveThe named curve.
[out]pu8ValueValue retrieved for verification. This is the digest of the message, truncated/prepended to the appropriate size.
[in,out]pu16ValueSzin: Size of value buffer provided by caller. out: Size of value retrieved (provided for convenience; the value size is in fact determined by the curve).
[out]pu8SigSignature retrieved for verification.
[in,out]pu16SigSzin: Size of signature buffer provided by caller. out: Size of signature retrieved (provided for convenience; the signature size is in fact determined by the curve).
[out]pstrKeyPublic key retrieved for verification.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
Precondition
This function should only be called after the application has been notified that verification information is ready via ECC_REQ_SIGN_VERIFY.
Warning
If this function returns M2M_ERR_FAIL, then any remaining verification info from the WINC is lost.

Referenced by m2m_ssl_retrieve_cert().

NMI_API sint8 m2m_ssl_send_certs_to_winc ( uint8 pu8Buffer,
uint32  u32BufferSz 
)

Sends certificates to the WINC.

Parameters
[in]pu8BufferPointer to the certificates.
[in]u32BufferSzSize of the certificates.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
Parameters
[in]pu8BufferPointer to the certificates. The buffer format must match the format of tstrTlsSrvSecHdr.
[in]u32BufferSzSize of the certificates.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
NMI_API sint8 m2m_ssl_set_active_ciphersuites ( uint32  u32SslCsBMP)

Sets the active ciphersuites.

Override the default Active SSL ciphers in the SSL module with a certain combination selected by the caller in the form of a bitmap containing the required ciphers to be on. There is no need to call this function if the application will not change the default ciphersuites.

Parameters
[in]u32SslCsBMPBitmap containing the desired ciphers to be enabled for the SSL module. The ciphersuites are defined in TLS Cipher Suite IDs. The default ciphersuites are all ciphersuites supported by the firmware with the exception of ECC ciphersuites. The caller can override the default with any desired combination. If u32SslCsBMP does not contain any ciphersuites supported by firmware, then the current active list will not change.
Returns

Override the default Active SSL ciphers in the SSL module with a certain combination selected by the caller in the form of a bitmap containing the required ciphers to be on.
There is no need to call this function if the application will not change the default ciphersuites.

Parameters
[in]u32SslCsBMPBitmap containing the desired ciphers to be enabled for the SSL module. The ciphersuites are defined in TLS Cipher Suite IDs. The default ciphersuites are all ciphersuites supported by the firmware with the exception of ECC ciphersuites. The caller can override the default with any desired combination. If u32SslCsBMP does not contain any ciphersuites supported by firmware, then the current active list will not change.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
NMI_API void m2m_ssl_stop_processing_certs ( void  )

Allow SSL driver to tidy up in case application does not read all available certificates.

Returns
None.
Warning
This API has been deprecated and is kept for legacy purposes only. It is recommended that m2m_ssl_stop_retrieving is used instead.
NMI_API void m2m_ssl_stop_retrieving ( void  )

Allow SSL driver to tidy up when the application chooses not to retrieve all available information.

Returns
None.
Warning
The application must call this function if it has been notified (via ECC_REQ_SIGN_GEN or ECC_REQ_SIGN_VERIFY) that information is available for retrieving from the WINC, but chooses not to retrieve it all. The application must not call this function if it has retrieved all the available information, or if a retrieve function returned M2M_ERR_FAIL indicating that any remaining information has been lost.
See Also
m2m_ssl_retrieve_next_for_verifying
m2m_ssl_retrieve_cert
m2m_ssl_retrieve_hash

Referenced by m2m_ssl_stop_processing_certs().