#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "xyssl/net.h"
#include "xyssl/ssl.h"
#include "xyssl/havege.h"
#include "xyssl/timing.h"
#include "xyssl/certs.h"
Go to the source code of this file.
Data Structures | |
struct | options |
Defines | |
#define | OPMODE_NONE 0 |
#define | OPMODE_CLIENT 1 |
#define | OPMODE_SERVER 2 |
#define | IOMODE_BLOCK 0 |
#define | IOMODE_NONBLOCK 1 |
#define | COMMAND_READ 1 |
#define | COMMAND_WRITE 2 |
#define | COMMAND_BOTH 3 |
#define | DFL_OPMODE OPMODE_NONE |
#define | DFL_IOMODE IOMODE_BLOCK |
#define | DFL_SERVER_NAME "localhost" |
#define | DFL_SERVER_PORT 4433 |
#define | DFL_COMMAND COMMAND_READ |
#define | DFL_BUFFER_SIZE 1024 |
#define | DFL_MAX_BYTES 0 |
#define | DFL_DEBUG_LEVEL 0 |
#define | DFL_CONN_TIMEOUT 0 |
#define | DFL_MAX_CONNECTIONS 0 |
#define | DFL_SESSION_REUSE 1 |
#define | DFL_SESSION_LIFETIME 86400 |
#define | DFL_FORCE_CIPHER 0 |
#define | USAGE |
Functions | |
unsigned long int | lcppm5 (unsigned long int *state) |
void | my_debug (void *ctx, int level, char *str) |
static int | ssl_test (struct options *opt) |
int | main (int argc, char *argv[]) |
Variables | |
char * | dhm_G = "4" |
char * | dhm_P |
int | server_fd = -1 |
#define COMMAND_BOTH 3 |
Definition at line 44 of file ssl_test.c.
Referenced by main().
#define COMMAND_READ 1 |
Definition at line 42 of file ssl_test.c.
Referenced by main(), and ssl_test().
#define COMMAND_WRITE 2 |
Definition at line 43 of file ssl_test.c.
Referenced by main(), and ssl_test().
#define DFL_BUFFER_SIZE 1024 |
Definition at line 51 of file ssl_test.c.
Referenced by main().
#define DFL_COMMAND COMMAND_READ |
Definition at line 50 of file ssl_test.c.
Referenced by main().
#define DFL_CONN_TIMEOUT 0 |
Definition at line 54 of file ssl_test.c.
Referenced by main().
#define DFL_DEBUG_LEVEL 0 |
Definition at line 53 of file ssl_test.c.
Referenced by main().
#define DFL_FORCE_CIPHER 0 |
Definition at line 58 of file ssl_test.c.
Referenced by main(), and ssl_test().
#define DFL_IOMODE IOMODE_BLOCK |
Definition at line 47 of file ssl_test.c.
Referenced by main().
#define DFL_MAX_BYTES 0 |
Definition at line 52 of file ssl_test.c.
Referenced by main().
#define DFL_MAX_CONNECTIONS 0 |
Definition at line 55 of file ssl_test.c.
Referenced by main().
#define DFL_OPMODE OPMODE_NONE |
Definition at line 46 of file ssl_test.c.
Referenced by main().
#define DFL_SERVER_NAME "localhost" |
Definition at line 48 of file ssl_test.c.
Referenced by main().
#define DFL_SERVER_PORT 4433 |
Definition at line 49 of file ssl_test.c.
Referenced by main().
#define DFL_SESSION_LIFETIME 86400 |
Definition at line 57 of file ssl_test.c.
Referenced by main().
#define DFL_SESSION_REUSE 1 |
Definition at line 56 of file ssl_test.c.
Referenced by main().
#define IOMODE_BLOCK 0 |
Definition at line 39 of file ssl_test.c.
Referenced by main().
#define IOMODE_NONBLOCK 1 |
Definition at line 40 of file ssl_test.c.
Referenced by main(), and ssl_test().
#define OPMODE_CLIENT 1 |
Definition at line 36 of file ssl_test.c.
Referenced by main(), and ssl_test().
#define OPMODE_NONE 0 |
Definition at line 35 of file ssl_test.c.
#define OPMODE_SERVER 2 |
Definition at line 37 of file ssl_test.c.
Referenced by main(), and ssl_test().
#define USAGE |
"\n usage: ssl_test opmode=<> command=<>...\n" \ "\n acceptable parameters:\n" \ " opmode=client/server default: <none>\n" \ " iomode=block/nonblock default: block\n" \ " server_name=%%s default: localhost\n" \ " server_port=%%d default: 4433\n" \ " command=read/write/both default: read\n" \ " buffer_size=%%d (bytes) default: 1024\n" \ " max_bytes=%%d (bytes) default: 0 (no limit)\n" \ " debug_level=%%d default: 0 (disabled)\n" \ " conn_timeout=%%d (ms) default: 0 (no timeout)\n" \ " max_connections=%%d default: 0 (no limit)\n" \ " session_reuse=on/off default: on (enabled)\n" \ " session_lifetime=%%d (s) default: 86400\n" \ " force_cipher=<name> default: all enabled\n" \ " acceptable cipher names:\n" \ " SSL_RSA_RC4_128_MD5 SSL_RSA_RC4_128_SHA\n" \ " SSL_RSA_DES_168_SHA SSL_EDH_RSA_DES_168_SHA\n" \ " SSL_RSA_AES_128_SHA SSL_EDH_RSA_AES_256_SHA\n" \ " SSL_RSA_AES_256_SHA\n\n"
Definition at line 372 of file ssl_test.c.
Definition at line 96 of file ssl_test.c.
Referenced by ssl_test().
Definition at line 394 of file ssl_test.c.
References options::buffer_size, options::command, COMMAND_BOTH, COMMAND_READ, COMMAND_WRITE, options::conn_timeout, options::debug_level, DFL_BUFFER_SIZE, DFL_COMMAND, DFL_CONN_TIMEOUT, DFL_DEBUG_LEVEL, DFL_FORCE_CIPHER, DFL_IOMODE, DFL_MAX_BYTES, DFL_MAX_CONNECTIONS, DFL_OPMODE, DFL_SERVER_NAME, DFL_SERVER_PORT, DFL_SESSION_LIFETIME, DFL_SESSION_REUSE, options::force_cipher, options::iomode, IOMODE_BLOCK, IOMODE_NONBLOCK, options::max_bytes, options::max_connections, options::opmode, OPMODE_CLIENT, OPMODE_SERVER, options::server_name, options::server_port, options::session_lifetime, options::session_reuse, SSL_EDH_RSA_AES_256_SHA, SSL_EDH_RSA_DES_168_SHA, SSL_RSA_AES_128_SHA, SSL_RSA_AES_256_SHA, SSL_RSA_DES_168_SHA, SSL_RSA_RC4_128_MD5, SSL_RSA_RC4_128_SHA, ssl_test(), and USAGE.
void my_debug | ( | void * | ctx, | |
int | level, | |||
char * | str | |||
) |
Definition at line 113 of file ssl_test.c.
Definition at line 122 of file ssl_test.c.
References options::buffer_size, client_fd, options::command, COMMAND_READ, COMMAND_WRITE, options::conn_timeout, DFL_FORCE_CIPHER, dhm_G, dhm_P, options::force_cipher, get_timer(), havege_init(), havege_rand(), options::iomode, IOMODE_NONBLOCK, lcppm5(), options::max_bytes, my_debug(), net_accept(), net_bind(), net_close(), net_connect(), net_recv(), net_send(), net_set_nonblock(), _x509_cert::next, options::opmode, OPMODE_CLIENT, OPMODE_SERVER, rsa_free(), server_fd, options::server_name, options::server_port, options::session_lifetime, options::session_reuse, ssl_close_notify(), ssl_default_ciphers, ssl_free(), ssl_init(), SSL_IS_CLIENT, SSL_IS_SERVER, ssl_read(), ssl_set_authmode(), ssl_set_bio(), ssl_set_ca_chain(), ssl_set_ciphers(), ssl_set_dbg(), ssl_set_dh_param(), ssl_set_endpoint(), ssl_set_own_cert(), ssl_set_rng(), ssl_set_session(), SSL_VERIFY_NONE, ssl_write(), test_ca_crt, test_srv_crt, test_srv_key, x509_free(), x509parse_crt(), x509parse_key(), XYSSL_ERR_NET_CONN_RESET, XYSSL_ERR_NET_TRY_AGAIN, and XYSSL_ERR_SSL_PEER_CLOSE_NOTIFY.
Referenced by main().
char* dhm_G = "4" |
Definition at line 63 of file ssl_test.c.
Referenced by ssl_test().
char* dhm_P |
"E4004C1F94182000103D883A448B3F802CE4B44A83301270002C20D0321CFD00" "11CCEF784C26A400F43DFB901BCA7538F2C6B176001CF5A0FD16D2C48B1D0C1C" "F6AC8E1DA6BCC3B4E1F96B0564965300FFA1D0B601EB2800F489AA512C4B248C" "01F76949A60BB7F00A40B1EAB64BDD48E8A700D60B7F1200FA8E77B0A979DABF"
Definition at line 64 of file ssl_test.c.
Referenced by ssl_test().
Definition at line 70 of file ssl_test.c.