File nut/include/tls/tls1.h


Included Files


Preprocessor definitions

* @file tls1.h * * @brief The definitions for the TLS library.

#define HEADER_SSL_LIB_H

#define SSL_PROTOCOL_MIN_VERSION 0x31

#define SSL_PROTOCOL_MINOR_VERSION 0x02

#define SSL_PROTOCOL_VERSION_MAX 0x32

#define SSL_PROTOCOL_VERSION1_1 0x32

#define SSL_RANDOM_SIZE 32

#define SSL_SECRET_SIZE 48

#define SSL_FINISHED_HASH_SIZE 12

#define SSL_RECORD_SIZE 5

#define SSL_SERVER_READ 0

#define SSL_SERVER_WRITE 1

#define SSL_CLIENT_READ 2

#define SSL_CLIENT_WRITE 3

#define SSL_HS_HDR_SIZE 4

#define SSL_NEED_RECORD 0x0001

#define SSL_TX_ENCRYPTED 0x0002

#define SSL_RX_ENCRYPTED 0x0004

#define SSL_SESSION_RESUME 0x0008

#define SSL_IS_CLIENT 0x0010

#define SSL_HAS_CERT_REQ 0x0020

#define SSL_SENT_CLOSE_NOTIFY 0x0040

#define SET_SSL_FLAG( A )

#define CLR_SSL_FLAG( A )

#define IS_SET_SSL_FLAG( A )

#define MAX_KEY_BYTE_SIZE 512

#define RT_MAX_PLAIN_LENGTH 16384

#define RT_EXTRA 1024

#define BM_RECORD_OFFSET 5

#define NUM_PROTOCOLS 4

#define PARANOIA_CHECK( A, B )

#define DISPLAY_STATE( A, B, C, D )

#define DISPLAY_CERT( A, B )

#define DISPLAY_RSA( A, B )

#define DISPLAY_ALERT( A, B )

#define DISPLAY_BYTES( A, B, C, D, ... )


Typedef cipher_info_t

typedef struct {...} cipher_info_t
struct  
   {  
      uint8_t cipher;  
      uint8_t key_size;  
      uint8_t iv_size;  
      uint8_t key_block_size;  
      uint8_t padding_size;  
      uint8_t digest_size;  
      hmac_func hmac;  
      crypt_func encrypt;  
      crypt_func decrypt;  
   }  

Type struct _SSLObjLoader

struct _SSLObjLoader
struct _SSLObjLoader  
   {  
      uint8_t* buf;  
      int len;  
   }  

Typedef SSLObjLoader

typedef struct _SSLObjLoader SSLObjLoader
See: Type struct _SSL

Typedef SSL_SESSION

typedef struct {...} SSL_SESSION
struct  
   {  
      time_t conn_time;  
      uint8_t session_id[SSL_SESSION_ID_SIZE];  
      uint8_t master_secret[48];  
   }  

Typedef SSL_CERT

typedef struct {...} SSL_CERT
struct  
   {  
      uint8_t* buf;  
      int size;  
   }  

Typedef DISPOSABLE_CTX

typedef struct {...} DISPOSABLE_CTX
struct  
   {  
      MD5_CTX md5_ctx;  
      SHA1_CTX sha1_ctx;  
      uint8_t final_finish_mac[12];  
      uint8_t* key_block;  
      uint8_t master_secret[48];  
      uint8_t client_random[32];  
      uint8_t server_random[32];  
      uint16_t bm_proc_index;  
   }  

Type struct _SSL

struct _SSL
struct _SSL  
   {  
      uint32_t flag;  
      uint16_t need_bytes;  
      uint16_t got_bytes;  
      uint8_t record_type;  
      uint8_t cipher;  
      uint8_t sess_id_size;  
      uint8_t version;  
      uint8_t client_version;  
      int16_t next_state;  
      int16_t hs_status;  
      DISPOSABLE_CTX* dc;  
      int client_fd;  
      const cipher_info_t* cipher_info;  
      void* encrypt_ctx;  
      void* decrypt_ctx;  
      uint8_t bm_all_data[16384+1024];  
      uint8_t* bm_data;  
      uint16_t bm_index;  
      uint16_t bm_read_index;  
      struct _SSL* next;  
      struct _SSL* prev;  
      struct _SSL_CTX* ssl_ctx;  
      uint16_t session_index;  
      SSL_SESSION* session;  
      uint8_t session_id[SSL_SESSION_ID_SIZE];  
      uint8_t client_mac[20];  
      uint8_t server_mac[20];  
      uint8_t read_sequence[8];  
      uint8_t write_sequence[8];  
      uint8_t hmac_header[5];  
   }  

Typedef SSL

typedef struct _SSL SSL
See: Type struct _SSL

Type struct _SSL_CTX

struct _SSL_CTX
struct _SSL_CTX  
   {  
      uint32_t options;  
      uint8_t chain_length;  
      RSA_CTX* rsa_ctx;  
      SSL* head;  
      SSL* tail;  
      SSL_CERT certs[TLS_SSL_MAX_CERTS];  
      uint16_t num_sessions;  
      SSL_SESSION** ssl_sessions;  
   }  

Typedef SSL_CTX

typedef struct _SSL_CTX SSL_CTX
See: Type struct _SSL_CTX

Typedef SSLCTX

typedef struct _SSL_CTX SSLCTX
See: Type struct _SSL_CTX

External Variables

ssl_prot_prefs
extern const uint8_t ssl_prot_prefs[4]