Mistake on this page?
Report an issue in GitHub or email us
Typedefs | Enumerations | Functions

** More...

Typedefs

typedef void * mtls_t
 mxchip TLS handler type More...
 

Enumerations

Functions

int32_t MX_WIFI_TLS_set_ver (MX_WIFIObject_t *Obj, mtls_ver_t version)
 set the TLS protocol version. More...
 
int32_t MX_WIFI_TLS_set_clientCertificate (MX_WIFIObject_t *Obj, uint8_t *client_cert, uint16_t cert_len)
 TLS set client certificate. More...
 
int32_t MX_WIFI_TLS_set_clientPrivateKey (MX_WIFIObject_t *Obj, uint8_t *client_private_key, uint16_t key_len)
 TLS set client private key. More...
 
int32_t MX_WIFI_TLS_connect (MX_WIFIObject_t *Obj, int32_t domain, int32_t type, int32_t protocol, const struct sockaddr *addr, int32_t addrlen, char *ca, int32_t calen)
 TLS client create a TLS connection. More...
 
int32_t MX_WIFI_TLS_connect_sni (MX_WIFIObject_t *Obj, const char *sni_servername, int32_t sni_servername_len, const struct sockaddr *addr, int32_t addrlen, char *ca, int32_t calen)
 TLS client create a TLS connection with SNI. More...
 
int32_t MX_WIFI_TLS_send (MX_WIFIObject_t *Obj, mtls_t tls, void *data, int32_t len)
 TLS send data. More...
 
int32_t MX_WIFI_TLS_recv (MX_WIFIObject_t *Obj, mtls_t tls, void *buf, int32_t len)
 TLS redeive data. More...
 
int32_t MX_WIFI_TLS_close (MX_WIFIObject_t *Obj, mtls_t tls)
 Close the TLS session, release resource. More...
 
int32_t MX_WIFI_TLS_set_nonblock (MX_WIFIObject_t *Obj, mtls_t tls, int32_t nonblock)
 Set TLS nonblock mode. More...
 

Detailed Description

**

TLS related API **

Typedef Documentation

typedef void* mtls_t

mxchip TLS handler type

Definition at line 1316 of file mx_wifi.h.

Enumeration Type Documentation

anonymous enum

mxchip TLS version

Enumerator
SSL_V3_MODE 

SSL V3.

TLS_V1_0_MODE 

TLS V1.0.

TLS_V1_1_MODE 

TLS V1.1.

TLS_V1_2_MODE 

TLS V1.2.

Definition at line 1321 of file mx_wifi.h.

Function Documentation

int32_t MX_WIFI_TLS_close ( MX_WIFIObject_t Obj,
mtls_t  tls 
)

Close the TLS session, release resource.

Parameters
Objpointer to module handle
tlsPoint to the TLS context.
Return values
OperationStatus.
int32_t MX_WIFI_TLS_connect ( MX_WIFIObject_t Obj,
int32_t  domain,
int32_t  type,
int32_t  protocol,
const struct sockaddr addr,
int32_t  addrlen,
char *  ca,
int32_t  calen 
)

TLS client create a TLS connection.

Parameters
Objpointer to module handle

This function is called on the client side and initiates an TLS/TLS handshake with a server. When this function is called, the underlying communication channel has already been set up. This function is called after TCP 3-way handshak finished.

Parameters
domainSpecifies a communication domain
typeSpecifies the communication semantics.
protocolspecifies a particular protocol to be used with the socket.
addrPoint to the target address to be connected
addrlencontaining the size of the buffer pointed to by addr
capointer to the CA certificate string, used to verify server's certificate.
calenthe string length of ca. 0=do not verify server's certificate.
Return values
returnthe TLS context pointer on success or NULL for fail.
int32_t MX_WIFI_TLS_connect_sni ( MX_WIFIObject_t Obj,
const char *  sni_servername,
int32_t  sni_servername_len,
const struct sockaddr addr,
int32_t  addrlen,
char *  ca,
int32_t  calen 
)

TLS client create a TLS connection with SNI.

Parameters
Objpointer to module handle

This function is called on the client side and initiates an TLS/TLS handshake with a server. When this function is called, the underlying communication channel has already been set up. This function is called after TCP 3-way handshak finished.

Parameters
sni_servernameSpecifies the SNI servername
sni_servername_lenSpecifies the SNI servername length, max size MX_TLS_SNI_SERVERNAME_SIZE
addrPoint to the target address to be connected
addrlencontaining the size of the buffer pointed to by addr
capointer to the CA certificate string, used to verify server's certificate.
calenthe string length of ca. 0=do not verify server's certificate.
Return values
returnthe TLS context pointer on success or NULL for fail.
int32_t MX_WIFI_TLS_recv ( MX_WIFIObject_t Obj,
mtls_t  tls,
void *  buf,
int32_t  len 
)

TLS redeive data.

Parameters
Objpointer to module handle
tlsPoint to the TLS context.
dataPoint to buffer to receive TLS data.
lenmax receive buffer length.
Return values
Onsuccess, return the number of bytes received. On error, error code (< 0) is returned.
int32_t MX_WIFI_TLS_send ( MX_WIFIObject_t Obj,
mtls_t  tls,
void *  data,
int32_t  len 
)

TLS send data.

Parameters
Objpointer to module handle
tlsPoint to the TLS context.
dataPoint to data to send.
lendata length.
Return values
Onsuccess, return the number of bytes sent. On error, error code (< 0) is returned.
int32_t MX_WIFI_TLS_set_clientCertificate ( MX_WIFIObject_t Obj,
uint8_t *  client_cert,
uint16_t  cert_len 
)

TLS set client certificate.

Parameters
Objpointer to module handle
client_certPoint to buffer of client cert.
cert_lenlength of the client cert.
Return values
OperationStatus.
int32_t MX_WIFI_TLS_set_clientPrivateKey ( MX_WIFIObject_t Obj,
uint8_t *  client_private_key,
uint16_t  key_len 
)

TLS set client private key.

Parameters
Objpointer to module handle
client_private_keyPoint to buffer of client private key.
key_lenlength of the client cert.
Return values
OperationStatus.
int32_t MX_WIFI_TLS_set_nonblock ( MX_WIFIObject_t Obj,
mtls_t  tls,
int32_t  nonblock 
)

Set TLS nonblock mode.

Parameters
Objpointer to module handle
tlsPoint to the TLS context.
nonblocktrue - nonblock, flase - block
Return values
OperationStatus.
int32_t MX_WIFI_TLS_set_ver ( MX_WIFIObject_t Obj,
mtls_ver_t  version 
)

set the TLS protocol version.

Parameters
Objpointer to module handle
versionTLS protocol version
Return values
OperationStatus.
Note
This function should be called before TLS is ready to function (before mtls_connect and mtls_accept is called by application ).
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.