/home/dko/projects/mobilec/trunk/src/security/xyssl-0.7/library/ssl_srv.c File Reference

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "xyssl/net.h"
#include "xyssl/ssl.h"

Go to the source code of this file.

Defines

#define _CRT_SECURE_NO_DEPRECATE   1

Functions

static int ssl_get_session (ssl_context *ssl)
static void ssl_set_session (ssl_context *ssl)
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_server_start (ssl_context *ssl)

Variables

static const char _ssl_srv_src [] = "_ssl_srv_src"


Define Documentation

#define _CRT_SECURE_NO_DEPRECATE   1

Definition at line 22 of file ssl_srv.c.


Function Documentation

static int ssl_get_session ( ssl_context ssl  )  [static]

Definition at line 33 of file ssl_srv.c.

References ssl_context::cipher, ERR_SSL_NO_SESSION_FOUND, int, ssl_context::master, ssl_context::sessid, sha1(), ssl_context::sidlen, ssl_context::sidtable, SSL_EXPIRATION_TIME, and SSL_SESSION_TBL_LEN.

Referenced by ssl_write_server_hello().

static int ssl_parse_certificate_verify ( ssl_context ssl  )  [static]

Definition at line 621 of file ssl_srv.c.

References ssl_context::authmode, ERR_SSL_BAD_HS_CERTIFICATE_VERIFY, ssl_context::in_hslen, ssl_context::in_msg, ssl_context::in_msgtype, int, rsa_context::len, ssl_context::peer_cert, _x509_cert::rsa, rsa_pkcs1_verify(), RSA_RAW, ssl_calc_verify(), SSL_HS_CERTIFICATE_VERIFY, SSL_MSG_HANDSHAKE, ssl_read_record(), SSL_VERIFY_REQUIRED, and ssl_context::state.

Referenced by ssl_server_start().

static int ssl_parse_client_hello ( ssl_context ssl  )  [static]

Definition at line 116 of file ssl_srv.c.

References ssl_context::cipher, ssl_context::cipherlist, ERR_SSL_BAD_HS_CLIENT_HELLO, ERR_SSL_NO_CIPHER_CHOSEN, ssl_context::hs_md5, ssl_context::hs_sha1, ssl_context::in_hdr, ssl_context::in_left, ssl_context::in_msg, int, ssl_context::major_ver, ssl_context::max_ver, md5_starts(), md5_update(), ssl_context::minor_ver, net_recv(), ssl_context::randbytes, ssl_context::read_fd, ssl_context::sessid, sha1_starts(), sha1_update(), ssl_context::sidlen, SSL_HS_CLIENT_HELLO, SSL_MSG_HANDSHAKE, SSLV3_MAJOR_VERSION, ssl_context::state, and TLS10_MINOR_VERSION.

Referenced by ssl_server_start().

static int ssl_parse_client_key_exchange ( ssl_context ssl  )  [static]

Definition at line 540 of file ssl_srv.c.

References ssl_context::cipher, dhm_calc_secret(), ssl_context::dhm_ctx, dhm_read_public(), ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE, ERR_SSL_FEATURE_UNAVAILABLE, ssl_context::in_hslen, ssl_context::in_msg, ssl_context::in_msgtype, rsa_context::len, dhm_context::len, ssl_context::max_ver, ssl_context::minor_ver, ssl_context::own_key, ssl_context::pmslen, ssl_context::premaster, rsa_pkcs1_decrypt(), SSL3_EDH_RSA_DES_168_SHA, ssl_derive_keys(), SSL_HS_CLIENT_KEY_EXCHANGE, SSL_MSG_HANDSHAKE, ssl_read_record(), ssl_set_session(), SSLV3_MINOR_VERSION, ssl_context::state, and TLS1_EDH_RSA_AES_256_SHA.

Referenced by ssl_server_start().

int ssl_server_start ( ssl_context ssl  ) 

Definition at line 663 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_flush_output(), 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(), and ssl_context::state.

Referenced by main(), and ssl_handshake().

static void ssl_set_session ( ssl_context ssl  )  [static]

Definition at line 78 of file ssl_srv.c.

References ssl_context::cipher, int, ssl_context::master, ssl_context::sessid, sha1(), ssl_context::sidlen, ssl_context::sidtable, and SSL_SESSION_TBL_LEN.

Referenced by ssl_parse_client_key_exchange().

static int ssl_write_certificate_request ( ssl_context ssl  )  [static]

Definition at line 406 of file ssl_srv.c.

References ssl_context::authmode, 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_HS_CERTIFICATE_REQUEST, SSL_MSG_HANDSHAKE, SSL_VERIFY_NONE, ssl_write_record(), ssl_context::state, and _x509_cert::subject_raw.

Referenced by ssl_server_start().

static int ssl_write_server_hello ( ssl_context ssl  )  [static]

Definition at line 336 of file ssl_srv.c.

References ssl_context::cipher, ssl_context::major_ver, ssl_context::minor_ver, ssl_context::out_msg, ssl_context::out_msglen, ssl_context::out_msgtype, ssl_context::randbytes, ssl_context::resumed, ssl_context::rng_d, ssl_context::rng_f, ssl_context::sessid, ssl_context::sidlen, SSL_COMPRESS_NULL, ssl_derive_keys(), ssl_get_session(), SSL_HS_SERVER_HELLO, SSL_MSG_HANDSHAKE, SSL_SERVER_CHANGE_CIPHER_SPEC, ssl_write_record(), and ssl_context::state.

Referenced by ssl_server_start().

static int ssl_write_server_hello_done ( ssl_context ssl  )  [static]

Definition at line 530 of file ssl_srv.c.

References ssl_context::out_msg, ssl_context::out_msglen, ssl_context::out_msgtype, SSL_HS_SERVER_HELLO_DONE, SSL_MSG_HANDSHAKE, ssl_write_record(), and ssl_context::state.

Referenced by ssl_server_start().

static int ssl_write_server_key_exchange ( ssl_context ssl  )  [static]

Definition at line 460 of file ssl_srv.c.

References ssl_context::cipher, ssl_context::dhm_ctx, dhm_make_params(), ERR_SSL_FEATURE_UNAVAILABLE, rsa_context::len, md5(), md5_finish(), md5_starts(), md5_update(), ssl_context::out_msg, ssl_context::out_msglen, ssl_context::out_msgtype, ssl_context::own_key, ssl_context::randbytes, ssl_context::rng_d, ssl_context::rng_f, rsa_pkcs1_sign(), RSA_RAW, sha1(), sha1_finish(), sha1_starts(), sha1_update(), SSL3_EDH_RSA_DES_168_SHA, SSL_HS_SERVER_KEY_EXCHANGE, SSL_MSG_HANDSHAKE, ssl_write_record(), ssl_context::state, and TLS1_EDH_RSA_AES_256_SHA.

Referenced by ssl_server_start().


Variable Documentation

const char _ssl_srv_src[] = "_ssl_srv_src" [static]

Definition at line 658 of file ssl_srv.c.


Generated on Fri May 16 14:49:56 2008 for Mobile-C by  doxygen 1.5.4