74 #define SSL_SESSION_ID_SIZE 32 79 #define SSL_CLIENT_AUTHENTICATION 0x00010000 80 #define SSL_SERVER_VERIFY_LATER 0x00020000 81 #define SSL_NO_DEFAULT_KEY 0x00040000 82 #define SSL_DISPLAY_STATES 0x00080000 83 #define SSL_DISPLAY_BYTES 0x00100000 84 #define SSL_DISPLAY_CERTS 0x00200000 85 #define SSL_DISPLAY_RSA 0x00400000 86 #define SSL_CONNECT_IN_PARTS 0x00800000 91 #define SSL_ERROR_DEAD -2 92 #define SSL_CLOSE_NOTIFY -3 93 #define SSL_ERROR_CONN_LOST -256 94 #define SSL_ERROR_SOCK_SETUP_FAILURE -258 95 #define SSL_ERROR_INVALID_HANDSHAKE -260 96 #define SSL_ERROR_INVALID_PROT_MSG -261 97 #define SSL_ERROR_INVALID_HMAC -262 98 #define SSL_ERROR_INVALID_VERSION -263 99 #define SSL_ERROR_INVALID_SESSION -265 100 #define SSL_ERROR_NO_CIPHER -266 101 #define SSL_ERROR_BAD_CERTIFICATE -268 102 #define SSL_ERROR_INVALID_KEY -269 103 #define SSL_ERROR_FINISHED_INVALID -271 104 #define SSL_ERROR_NO_CERT_DEFINED -272 105 #define SSL_ERROR_NO_CLIENT_RENOG -273 106 #define SSL_ERROR_NOT_SUPPORTED -274 107 #define SSL_ERROR_TIMEOUT -275 108 #define SSL_ERROR_EOS -276 109 #define SSL_X509_OFFSET -512 110 #define SSL_X509_ERROR(A) (SSL_X509_OFFSET+A) 113 #define SSL_ALERT_TYPE_WARNING 1 114 #define SLL_ALERT_TYPE_FATAL 2 117 #define SSL_ALERT_CLOSE_NOTIFY 0 118 #define SSL_ALERT_UNEXPECTED_MESSAGE 10 119 #define SSL_ALERT_BAD_RECORD_MAC 20 120 #define SSL_ALERT_HANDSHAKE_FAILURE 40 121 #define SSL_ALERT_BAD_CERTIFICATE 42 122 #define SSL_ALERT_ILLEGAL_PARAMETER 47 123 #define SSL_ALERT_DECODE_ERROR 50 124 #define SSL_ALERT_DECRYPT_ERROR 51 125 #define SSL_ALERT_INVALID_VERSION 70 126 #define SSL_ALERT_NO_RENEGOTIATION 100 129 #define SSL_AES128_SHA 0x2f 130 #define SSL_AES256_SHA 0x35 131 #define SSL_RC4_128_SHA 0x05 132 #define SSL_RC4_128_MD5 0x04 135 #define SSL_BUILD_SKELETON_MODE 0x01 136 #define SSL_BUILD_SERVER_ONLY 0x02 137 #define SSL_BUILD_ENABLE_VERIFICATION 0x03 138 #define SSL_BUILD_ENABLE_CLIENT 0x04 139 #define SSL_BUILD_FULL_MODE 0x05 142 #define SSL_BUILD_MODE 0 143 #define SSL_MAX_CERT_CFG_OFFSET 1 144 #define SSL_MAX_CA_CERT_CFG_OFFSET 2 145 #define SSL_HAS_PEM 3 148 #define SSL_DEFAULT_SVR_SESS 5 149 #define SSL_DEFAULT_CLNT_SESS 1 152 #define SSL_X509_CERT_COMMON_NAME 0 153 #define SSL_X509_CERT_ORGANIZATION 1 154 #define SSL_X509_CERT_ORGANIZATIONAL_NAME 2 155 #define SSL_X509_CA_CERT_COMMON_NAME 3 156 #define SSL_X509_CA_CERT_ORGANIZATION 4 157 #define SSL_X509_CA_CERT_ORGANIZATIONAL_NAME 5 160 #define SSL_OBJ_X509_CERT 1 161 #define SSL_OBJ_X509_CACERT 2 162 #define SSL_OBJ_RSA_KEY 3 163 #define SSL_OBJ_PKCS8 4 164 #define SSL_OBJ_PKCS12 5 277 EXP_FUNC
int STDCALL
ssl_read(
SSL *ssl, uint8_t **in_data);
289 EXP_FUNC
int STDCALL
ssl_write(
SSL *ssl,
const uint8_t *out_data,
int out_len);
418 EXP_FUNC
const SSL_X509_CERT* ssl_get_peer_cert(
const SSL* ssl,
unsigned int position);
419 EXP_FUNC
void ssl_cert_get_fingerprints(
const SSL_X509_CERT *cert,
unsigned char* md5,
unsigned char* sha1);
455 EXP_FUNC
int STDCALL
ssl_obj_load(
SSL_CTX *ssl_ctx,
int obj_type,
const char *filename,
const char *password);
472 #ifdef CONFIG_SSL_GENERATE_X509_CERT 495 EXP_FUNC
int STDCALL ssl_x509_create(
SSL_CTX *ssl_ctx, uint32_t options,
const char * dn[], uint8_t **cert_data);
503 EXP_FUNC
void ssl_mem_free(
void* mem);
EXP_FUNC void STDCALL ssl_display_error(int error_code)
Display why the handshake failed.
Definition: tls1.c:2235
EXP_FUNC SSL *STDCALL ssl_server_new(SSL_CTX *ssl_ctx, SSL_SOCKET *client_fd)
(server only) Establish a new SSL connection to an SSL client.
Definition: tls1_svr.c:52
EXP_FUNC int STDCALL ssl_get_config(int offset)
Retrieve various parameters about the axTLS engine.
EXP_FUNC const char *STDCALL ssl_cert_get_subject_alt_dnsname(const SSL_X509_CERT *cert, int dnsindex)
Retrieve a Subject Alternative DNSName.
EXP_FUNC const char *STDCALL ssl_cert_get_dn(const SSL_X509_CERT *cert, int component)
Retrieve an X.509 distinguished name component.
EXP_FUNC int STDCALL ssl_read(SSL *ssl, uint8_t **in_data)
Read the SSL data stream.
Definition: tls1.c:304
Definition: crypto_misc.h:68
EXP_FUNC const char *STDCALL ssl_version(void)
Return the axTLS library version as a string.
Definition: tls1.c:2219
EXP_FUNC int STDCALL ssl_obj_memory_load(SSL_CTX *ssl_ctx, int obj_type, const uint8_t *data, int len, const char *password)
Process binary data.
Definition: loader.c:108
EXP_FUNC void STDCALL ssl_ctx_free(SSL_CTX *ssl_ctx)
Remove a client/server context.
Definition: tls1.c:208
EXP_FUNC uint8_t STDCALL ssl_get_session_id_size(const SSL *ssl)
Get the session id size for a handshake.
Definition: tls1.c:1835
EXP_FUNC SSL *STDCALL ssl_find(SSL_CTX *ssl_ctx, SSL_SOCKET *client_fd)
Find an ssl object based on a file descriptor.
Definition: tls1.c:580
EXP_FUNC void STDCALL ssl_free(SSL *ssl)
Free any used resources on this connection.
Definition: tls1.c:261
EXP_FUNC int STDCALL ssl_obj_load(SSL_CTX *ssl_ctx, int obj_type, const char *filename, const char *password)
Process a file that is in binary DER or ASCII PEM format.
EXP_FUNC int STDCALL ssl_verify_cert(const SSL *ssl)
Authenticate a received certificate.
The definitions for the TLS library.
EXP_FUNC int STDCALL ssl_renegotiate(SSL *ssl)
Force the client to perform its handshake again.
Definition: tls1.c:606
EXP_FUNC SSL *STDCALL ssl_client_new(SSL_CTX *ssl_ctx, SSL_SOCKET *client_fd, const uint8_t *session_id, uint8_t sess_id_size)
(client only) Establish a new SSL connection to an SSL server.
EXP_FUNC const uint8_t *STDCALL ssl_get_session_id(const SSL *ssl)
Get the session id for a handshake.
Definition: tls1.c:1827
EXP_FUNC int STDCALL ssl_write(SSL *ssl, const uint8_t *out_data, int out_len)
Write to the SSL data stream.
Definition: tls1.c:329
EXP_FUNC SSL_CTX *STDCALL ssl_ctx_new(uint32_t options, int num_sessions)
Establish a new client/server context.
Definition: tls1.c:174
EXP_FUNC int STDCALL ssl_handshake_status(const SSL *ssl)
Return the status of the handshake.
Definition: tls1.c:1851
EXP_FUNC uint8_t STDCALL ssl_get_cipher_id(const SSL *ssl)
Return the cipher id (in the SSL form).
Definition: tls1.c:1843