#include "xyssl/config.h"
#include "xyssl/debug.h"
#include "xyssl/ssl.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
Go to the source code of this file.
Functions | |
static int | ssl_parse_client_hello (ssl_context *ssl) |
static int | ssl_write_server_hello (ssl_context *ssl) |
static int | ssl_write_certificate_request (ssl_context *ssl) |
static int | ssl_write_server_key_exchange (ssl_context *ssl) |
static int | ssl_write_server_hello_done (ssl_context *ssl) |
static int | ssl_parse_client_key_exchange (ssl_context *ssl) |
static int | ssl_parse_certificate_verify (ssl_context *ssl) |
int | ssl_handshake_server (ssl_context *ssl) |
int ssl_handshake_server | ( | ssl_context * | ssl | ) |
Definition at line 819 of file ssl_srv.c.
References SSL_CERTIFICATE_REQUEST, SSL_CERTIFICATE_VERIFY, SSL_CLIENT_CERTIFICATE, SSL_CLIENT_CHANGE_CIPHER_SPEC, SSL_CLIENT_FINISHED, SSL_CLIENT_HELLO, SSL_CLIENT_KEY_EXCHANGE, SSL_DEBUG_MSG, SSL_FLUSH_BUFFERS, ssl_flush_output(), SSL_HANDSHAKE_OVER, SSL_HELLO_REQUEST, ssl_parse_certificate(), ssl_parse_certificate_verify(), ssl_parse_change_cipher_spec(), ssl_parse_client_hello(), ssl_parse_client_key_exchange(), ssl_parse_finished(), SSL_SERVER_CERTIFICATE, SSL_SERVER_CHANGE_CIPHER_SPEC, SSL_SERVER_FINISHED, SSL_SERVER_HELLO, SSL_SERVER_HELLO_DONE, SSL_SERVER_KEY_EXCHANGE, ssl_write_certificate(), ssl_write_certificate_request(), ssl_write_change_cipher_spec(), ssl_write_finished(), ssl_write_server_hello(), ssl_write_server_hello_done(), ssl_write_server_key_exchange(), _ssl_context::state, and XYSSL_ERR_SSL_BAD_INPUT_DATA.
Referenced by ssl_handshake().
static int ssl_parse_certificate_verify | ( | ssl_context * | ssl | ) | [static] |
Definition at line 758 of file ssl_srv.c.
References _ssl_context::in_hslen, _ssl_context::in_msg, _ssl_context::in_msgtype, rsa_context::len, _ssl_context::peer_cert, _x509_cert::rsa, rsa_pkcs1_verify(), RSA_PUBLIC, RSA_RAW, ssl_calc_verify(), SSL_DEBUG_MSG, SSL_DEBUG_RET, SSL_HS_CERTIFICATE_VERIFY, SSL_MSG_HANDSHAKE, ssl_read_record(), _ssl_context::state, and XYSSL_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY.
Referenced by ssl_handshake_server().
static int ssl_parse_client_hello | ( | ssl_context * | ssl | ) | [static] |
Definition at line 33 of file ssl_srv.c.
References buf, _ssl_session::cipher, _ssl_context::ciphers, _ssl_context::fin_md5, _ssl_context::fin_sha1, _ssl_session::id, _ssl_context::in_hdr, _ssl_context::in_left, _ssl_context::in_msg, _ssl_session::length, _ssl_context::major_ver, _ssl_context::max_major_ver, _ssl_context::max_minor_ver, md5_update(), _ssl_context::minor_ver, _ssl_context::randbytes, _ssl_context::session, sha1_update(), SSL_DEBUG_BUF, SSL_DEBUG_MSG, SSL_DEBUG_RET, ssl_fetch_input(), SSL_HS_CLIENT_HELLO, SSL_MAJOR_VERSION_3, SSL_MINOR_VERSION_1, SSL_MSG_HANDSHAKE, _ssl_context::state, XYSSL_ERR_SSL_BAD_HS_CLIENT_HELLO, and XYSSL_ERR_SSL_NO_CIPHER_CHOSEN.
Referenced by ssl_handshake_server().
static int ssl_parse_client_key_exchange | ( | ssl_context * | ssl | ) | [static] |
Definition at line 634 of file ssl_srv.c.
References _ssl_session::cipher, dhm_calc_secret(), _ssl_context::dhm_ctx, dhm_read_public(), _ssl_context::f_rng, dhm_context::GY, _ssl_context::in_hslen, _ssl_context::in_msg, _ssl_context::in_msgtype, dhm_context::K, rsa_context::len, dhm_context::len, _ssl_context::max_major_ver, _ssl_context::max_minor_ver, _ssl_context::minor_ver, _ssl_context::p_rng, _ssl_context::pmslen, _ssl_context::premaster, _ssl_context::rsa_key, rsa_pkcs1_decrypt(), RSA_PRIVATE, _ssl_context::s_set, _ssl_context::session, SSL_DEBUG_MPI, SSL_DEBUG_MSG, SSL_DEBUG_RET, ssl_derive_keys(), SSL_EDH_RSA_AES_256_SHA, SSL_EDH_RSA_DES_168_SHA, SSL_HS_CLIENT_KEY_EXCHANGE, SSL_MINOR_VERSION_0, SSL_MSG_HANDSHAKE, ssl_read_record(), _ssl_context::state, XYSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE, and XYSSL_ERR_SSL_FEATURE_UNAVAILABLE.
Referenced by ssl_handshake_server().
static int ssl_write_certificate_request | ( | ssl_context * | ssl | ) | [static] |
Definition at line 447 of file ssl_srv.c.
References _ssl_context::authmode, buf, _ssl_context::ca_chain, _x509_buf::len, _x509_cert::next, _ssl_context::out_msg, _ssl_context::out_msglen, _ssl_context::out_msgtype, _x509_buf::p, SSL_DEBUG_BUF, SSL_DEBUG_MSG, SSL_HS_CERTIFICATE_REQUEST, SSL_MSG_HANDSHAKE, SSL_VERIFY_NONE, ssl_write_record(), _ssl_context::state, and _x509_cert::subject_raw.
Referenced by ssl_handshake_server().
static int ssl_write_server_hello | ( | ssl_context * | ssl | ) | [static] |
Definition at line 349 of file ssl_srv.c.
References buf, _ssl_session::cipher, _ssl_context::f_rng, _ssl_session::id, _ssl_session::length, _ssl_context::major_ver, _ssl_context::minor_ver, _ssl_context::out_msg, _ssl_context::out_msglen, _ssl_context::out_msgtype, _ssl_context::p_rng, _ssl_context::randbytes, _ssl_context::resume, _ssl_context::s_get, _ssl_context::session, SSL_COMPRESS_NULL, SSL_DEBUG_BUF, SSL_DEBUG_MSG, ssl_derive_keys(), SSL_HS_SERVER_HELLO, SSL_MSG_HANDSHAKE, SSL_SERVER_CHANGE_CIPHER_SPEC, ssl_write_record(), and _ssl_context::state.
Referenced by ssl_handshake_server().
static int ssl_write_server_hello_done | ( | ssl_context * | ssl | ) | [static] |
Definition at line 611 of file ssl_srv.c.
References _ssl_context::out_msg, _ssl_context::out_msglen, _ssl_context::out_msgtype, SSL_DEBUG_MSG, SSL_DEBUG_RET, SSL_HS_SERVER_HELLO_DONE, SSL_MSG_HANDSHAKE, ssl_write_record(), and _ssl_context::state.
Referenced by ssl_handshake_server().
static int ssl_write_server_key_exchange | ( | ssl_context * | ssl | ) | [static] |
Definition at line 512 of file ssl_srv.c.
References _ssl_session::cipher, _ssl_context::dhm_ctx, dhm_make_params(), _ssl_context::f_rng, dhm_context::G, dhm_context::GX, rsa_context::len, md5(), md5_finish(), md5_starts(), md5_update(), _ssl_context::out_msg, _ssl_context::out_msglen, _ssl_context::out_msgtype, dhm_context::P, _ssl_context::p_rng, _ssl_context::randbytes, _ssl_context::rsa_key, rsa_pkcs1_sign(), RSA_PRIVATE, RSA_RAW, _ssl_context::session, sha1(), sha1_finish(), sha1_starts(), sha1_update(), SSL_DEBUG_BUF, SSL_DEBUG_MPI, SSL_DEBUG_MSG, SSL_DEBUG_RET, SSL_EDH_RSA_AES_256_SHA, SSL_EDH_RSA_DES_168_SHA, SSL_HS_SERVER_KEY_EXCHANGE, SSL_MSG_HANDSHAKE, ssl_write_record(), _ssl_context::state, dhm_context::X, and XYSSL_ERR_SSL_FEATURE_UNAVAILABLE.
Referenced by ssl_handshake_server().