This is a fork of the mbed port of axTLS

Dependents:   TLS_axTLS-Example HTTPSClientExample

Embed: (wiki syntax)

« Back to documentation index

tls1.h File Reference

tls1.h File Reference

The definitions for the TLS library. More...

Go to the source code of this file.

Functions

void disposable_new (SSL *ssl)
 Create a blob of memory that we'll get rid of once the handshake is complete.
void disposable_free (SSL *ssl)
 Remove the temporary blob of memory.
int send_packet (SSL *ssl, uint8_t protocol, const uint8_t *in, int length)
 Send an encrypted packet with padding bytes if necessary.
int process_finished (SSL *ssl, uint8_t *buf, int hs_len)
 Process a client finished message.
int send_alert (SSL *ssl, int error_code)
 Send an alert message.
int send_finished (SSL *ssl)
 Send a "finished" message.
int send_certificate (SSL *ssl)
 Send a certificate.
int basic_read2 (SSL *ssl, uint8_t *data, uint32_t length)
 Blocking read data must be valid buffer of size length at least length.
int send_change_cipher_spec (SSL *ssl)
 Sends the change cipher spec message.
void finished_digest (SSL *ssl, const char *label, uint8_t *digest)
 Calculate the digest used in the finished message.
void generate_master_secret (SSL *ssl, const uint8_t *premaster_secret)
 Generate a master secret based on the client/server random data and the premaster secret.
void add_packet (SSL *ssl, const uint8_t *pkt, int len)
 Add a packet to the end of our sent and received packets, so that we may use it to calculate the hash at the end.
void remove_ca_certs (CA_CERT_CTX *ca_cert_ctx)
 Clean up all of the CA certificates.
void DISPLAY_STATE (SSL *ssl, int is_send, uint8_t state, int not_ok)
 Debugging routine to display SSL handshaking stuff.
void DISPLAY_BYTES (SSL *ssl, const char *format, const uint8_t *data, int size,...)
 Debugging routine to display SSL handshaking bytes.
void DISPLAY_RSA (SSL *ssl, const RSA_CTX *rsa_ctx)
 Debugging routine to display RSA objects.
void DISPLAY_ALERT (SSL *ssl, int alert)
 Debugging routine to display alerts.
int process_certificate (SSL *ssl, X509_CTX **x509_ctx)
 Process a certificate message.
SSL_SESSION * ssl_session_update (int max_sessions, SSL_SESSION *ssl_sessions[], SSL *ssl, const uint8_t *session_id)
 Find if an existing session has the same session id.
void kill_ssl_session (SSL_SESSION **ssl_sessions, SSL *ssl)
 This ssl object doesn't want this session anymore.

Variables

const uint8_t ssl_prot_prefs [NUM_PROTOCOLS]
 The server will pick the cipher based on the order that the order that the ciphers are listed.

Detailed Description

The definitions for the TLS library.

Definition in file tls1.h.


Function Documentation

void add_packet ( SSL *  ssl,
const uint8_t *  pkt,
int  len 
)

Add a packet to the end of our sent and received packets, so that we may use it to calculate the hash at the end.

Definition at line 633 of file tls1.c.

int basic_read2 ( SSL *  ssl,
uint8_t *  data,
uint32_t  length 
)

Blocking read data must be valid buffer of size length at least length.

Definition at line 1104 of file tls1.c.

void DISPLAY_ALERT ( SSL *  ssl,
int  alert 
)

Debugging routine to display alerts.

Definition at line 2267 of file tls1.c.

void DISPLAY_BYTES ( SSL *  ssl,
const char *  format,
const uint8_t *  data,
int  size,
  ... 
)

Debugging routine to display SSL handshaking bytes.

Definition at line 166 of file tls1.c.

void DISPLAY_RSA ( SSL *  ssl,
const RSA_CTX *  rsa_ctx 
)

Debugging routine to display RSA objects.

Definition at line 2147 of file tls1.c.

void DISPLAY_STATE ( SSL *  ssl,
int  is_send,
uint8_t  state,
int  not_ok 
)

Debugging routine to display SSL handshaking stuff.

Debugging routine to display SSL states.

Definition at line 2082 of file tls1.c.

void disposable_free ( SSL *  ssl )

Remove the temporary blob of memory.

Definition at line 1689 of file tls1.c.

void disposable_new ( SSL *  ssl )

Create a blob of memory that we'll get rid of once the handshake is complete.

Definition at line 1675 of file tls1.c.

void finished_digest ( SSL *  ssl,
const char *  label,
uint8_t *  digest 
)

Calculate the digest used in the finished message.

This function also doubles up as a certificate verify function.

Definition at line 749 of file tls1.c.

void generate_master_secret ( SSL *  ssl,
const uint8_t *  premaster_secret 
)

Generate a master secret based on the client/server random data and the premaster secret.

Definition at line 722 of file tls1.c.

void kill_ssl_session ( SSL_SESSION **  ssl_sessions,
SSL *  ssl 
)

This ssl object doesn't want this session anymore.

Definition at line 1794 of file tls1.c.

int process_certificate ( SSL *  ssl,
X509_CTX **  x509_ctx 
)

Process a certificate message.

Definition at line 1962 of file tls1.c.

int process_finished ( SSL *  ssl,
uint8_t *  buf,
int  hs_len 
)

Process a client finished message.

Definition at line 1610 of file tls1.c.

void remove_ca_certs ( CA_CERT_CTX *  ca_cert_ctx )

Clean up all of the CA certificates.

Definition at line 470 of file asn1.c.

int send_alert ( SSL *  ssl,
int  error_code 
)

Send an alert message.

Return 1 if the alert was an "error".

Definition at line 1536 of file tls1.c.

int send_certificate ( SSL *  ssl )

Send a certificate.

Definition at line 1639 of file tls1.c.

int send_change_cipher_spec ( SSL *  ssl )

Sends the change cipher spec message.

We have just read a finished message from the client.

Definition at line 1485 of file tls1.c.

int send_finished ( SSL *  ssl )

Send a "finished" message.

Definition at line 1500 of file tls1.c.

int send_packet ( SSL *  ssl,
uint8_t  protocol,
const uint8_t *  in,
int  length 
)

Send an encrypted packet with padding bytes if necessary.

Definition at line 915 of file tls1.c.

SSL_SESSION* ssl_session_update ( int  max_sessions,
SSL_SESSION *  ssl_sessions[],
SSL *  ssl,
const uint8_t *  session_id 
)

Find if an existing session has the same session id.

If so, use the master secret from this session for session resumption.

Definition at line 1706 of file tls1.c.


Variable Documentation

const uint8_t ssl_prot_prefs[NUM_PROTOCOLS]

The server will pick the cipher based on the order that the order that the ciphers are listed.

This order is defined at compile time.

Definition at line 69 of file tls1.c.