versadac  1
versadac - Scalable Recorder Firmware
Macros | Functions | Variables
ssl_lib.c File Reference

Version independent SSL functions. More...

#include <stdio.h>
#include "ssl_locl.h"
#include "kssl_lcl.h"
#include <openssl/objects.h>
#include <openssl/lhash.h>
#include <openssl/x509v3.h>
#include <openssl/rand.h>
#include <openssl/dh.h>

Macros

#define ku_reject(x, usage)   (((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage)))
 

Functions

int SSL_clear (SSL *s)
 
int SSL_CTX_set_ssl_version (SSL_CTX *ctx, SSL_METHOD *meth)
 
SSLSSL_new (SSL_CTX *ctx)
 
int SSL_CTX_set_session_id_context (SSL_CTX *ctx, const unsigned char *sid_ctx, unsigned int sid_ctx_len)
 
int SSL_set_session_id_context (SSL *ssl, const unsigned char *sid_ctx, unsigned int sid_ctx_len)
 
int SSL_CTX_set_generate_session_id (SSL_CTX *ctx, GEN_SESSION_CB cb)
 
int SSL_set_generate_session_id (SSL *ssl, GEN_SESSION_CB cb)
 
int SSL_has_matching_session_id (const SSL *ssl, const unsigned char *id, unsigned int id_len)
 
int SSL_CTX_set_purpose (SSL_CTX *s, int purpose)
 
int SSL_set_purpose (SSL *s, int purpose)
 
int SSL_CTX_set_trust (SSL_CTX *s, int trust)
 
int SSL_set_trust (SSL *s, int trust)
 
void SSL_free (SSL *s)
 
void SSL_set_bio (SSL *s, BIO *rbio, BIO *wbio)
 
BIOSSL_get_rbio (const SSL *s)
 
BIOSSL_get_wbio (const SSL *s)
 
int SSL_get_fd (const SSL *s)
 
int SSL_get_rfd (const SSL *s)
 
int SSL_get_wfd (const SSL *s)
 
int SSL_set_fd (SSL *s, int fd)
 
int SSL_set_wfd (SSL *s, int fd)
 
int SSL_set_rfd (SSL *s, int fd)
 
size_t SSL_get_finished (const SSL *s, void *buf, size_t count)
 
size_t SSL_get_peer_finished (const SSL *s, void *buf, size_t count)
 
int SSL_get_verify_mode (const SSL *s)
 
int SSL_get_verify_depth (const SSL *s)
 
int SSL_CTX_get_verify_mode (const SSL_CTX *ctx)
 
int SSL_CTX_get_verify_depth (const SSL_CTX *ctx)
 
void SSL_set_verify (SSL *s, int mode, int(*callback)(int ok, X509_STORE_CTX *ctx))
 
void SSL_set_verify_depth (SSL *s, int depth)
 
void SSL_set_read_ahead (SSL *s, int yes)
 
int SSL_get_read_ahead (const SSL *s)
 
int SSL_pending (const SSL *s)
 
X509SSL_get_peer_certificate (const SSL *s)
 
 STACK_OF (X509)
 
void SSL_copy_session_id (SSL *t, const SSL *f)
 
int SSL_CTX_check_private_key (const SSL_CTX *ctx)
 
int SSL_check_private_key (const SSL *ssl)
 
int SSL_accept (SSL *s)
 
int SSL_connect (SSL *s)
 
long SSL_get_default_timeout (const SSL *s)
 
int SSL_read (SSL *s, void *buf, int num)
 
int SSL_peek (SSL *s, void *buf, int num)
 
int SSL_write (SSL *s, const void *buf, int num)
 
int SSL_shutdown (SSL *s)
 
int SSL_renegotiate (SSL *s)
 
int SSL_renegotiate_pending (SSL *s)
 
long SSL_ctrl (SSL *s, int cmd, long larg, void *parg)
 
long SSL_callback_ctrl (SSL *s, int cmd, void(*fp)(void))
 
struct lhash_stSSL_CTX_sessions (SSL_CTX *ctx)
 
long SSL_CTX_ctrl (SSL_CTX *ctx, int cmd, long larg, void *parg)
 
long SSL_CTX_callback_ctrl (SSL_CTX *ctx, int cmd, void(*fp)(void))
 
int ssl_cipher_id_cmp (const SSL_CIPHER *a, const SSL_CIPHER *b)
 
int ssl_cipher_ptr_id_cmp (const SSL_CIPHER *const *ap, const SSL_CIPHER *const *bp)
 
 STACK_OF (SSL_CIPHER)
 
const char * SSL_get_cipher_list (const SSL *s, int n)
 
int SSL_CTX_set_cipher_list (SSL_CTX *ctx, const char *str)
 
int SSL_set_cipher_list (SSL *s, const char *str)
 
char * SSL_get_shared_ciphers (const SSL *s, char *buf, int len)
 
int ssl_cipher_list_to_bytes (SSL *s, STACK_OF(SSL_CIPHER)*sk, unsigned char *p, int(*put_cb)(const SSL_CIPHER *, unsigned char *))
 
const char * SSL_get_servername (const SSL *s, const int type)
 
int SSL_get_servername_type (const SSL *s)
 
unsigned long SSL_SESSION_hash (const SSL_SESSION *a)
 
int SSL_SESSION_cmp (const SSL_SESSION *a, const SSL_SESSION *b)
 
static IMPLEMENT_LHASH_HASH_FN (SSL_SESSION_hash, SSL_SESSION *)
 
void SSL_CTX_free (SSL_CTX *a)
 
void SSL_CTX_set_default_passwd_cb (SSL_CTX *ctx, pem_password_cb *cb)
 
void SSL_CTX_set_default_passwd_cb_userdata (SSL_CTX *ctx, void *u)
 
void SSL_CTX_set_cert_verify_callback (SSL_CTX *ctx, int(*cb)(X509_STORE_CTX *, void *), void *arg)
 
void SSL_CTX_set_verify (SSL_CTX *ctx, int mode, int(*cb)(int, X509_STORE_CTX *))
 
void SSL_CTX_set_verify_depth (SSL_CTX *ctx, int depth)
 
void ssl_set_cert_masks (CERT *c, SSL_CIPHER *cipher)
 
int check_srvr_ecc_cert_and_alg (X509 *x, SSL_CIPHER *cs)
 
X509ssl_get_server_send_cert (SSL *s)
 
EVP_PKEYssl_get_sign_pkey (SSL *s, SSL_CIPHER *cipher)
 
void ssl_update_cache (SSL *s, int mode)
 
SSL_METHODSSL_get_ssl_method (SSL *s)
 
int SSL_set_ssl_method (SSL *s, SSL_METHOD *meth)
 
int SSL_get_error (const SSL *s, int i)
 
int SSL_do_handshake (SSL *s)
 
void SSL_set_accept_state (SSL *s)
 
void SSL_set_connect_state (SSL *s)
 
int ssl_undefined_function (SSL *s)
 
int ssl_undefined_void_function (void)
 
int ssl_undefined_const_function (const SSL *s)
 
SSL_METHODssl_bad_method (int ver)
 
const char * SSL_get_version (const SSL *s)
 
SSLSSL_dup (SSL *s)
 
void ssl_clear_cipher_ctx (SSL *s)
 
X509SSL_get_certificate (const SSL *s)
 
EVP_PKEYSSL_get_privatekey (SSL *s)
 
SSL_CIPHERSSL_get_current_cipher (const SSL *s)
 
const COMP_METHODSSL_get_current_compression (SSL *s)
 
const COMP_METHODSSL_get_current_expansion (SSL *s)
 
int ssl_init_wbio_buffer (SSL *s, int push)
 
void ssl_free_wbio_buffer (SSL *s)
 
void SSL_CTX_set_quiet_shutdown (SSL_CTX *ctx, int mode)
 
int SSL_CTX_get_quiet_shutdown (const SSL_CTX *ctx)
 
void SSL_set_quiet_shutdown (SSL *s, int mode)
 
int SSL_get_quiet_shutdown (const SSL *s)
 
void SSL_set_shutdown (SSL *s, int mode)
 
int SSL_get_shutdown (const SSL *s)
 
int SSL_version (const SSL *s)
 
SSL_CTXSSL_get_SSL_CTX (const SSL *ssl)
 
SSL_CTXSSL_set_SSL_CTX (SSL *ssl, SSL_CTX *ctx)
 
int SSL_CTX_set_default_verify_paths (SSL_CTX *ctx)
 
int SSL_CTX_load_verify_locations (SSL_CTX *ctx, const char *CAfile, const char *CApath)
 
void SSL_set_info_callback (SSL *ssl, void(*cb)(const SSL *ssl, int type, int val))
 
int SSL_state (const SSL *ssl)
 
void SSL_set_verify_result (SSL *ssl, long arg)
 
long SSL_get_verify_result (const SSL *ssl)
 
int SSL_get_ex_new_index (long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
 
int SSL_set_ex_data (SSL *s, int idx, void *arg)
 
void * SSL_get_ex_data (const SSL *s, int idx)
 
int SSL_CTX_get_ex_new_index (long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
 
int SSL_CTX_set_ex_data (SSL_CTX *s, int idx, void *arg)
 
void * SSL_CTX_get_ex_data (const SSL_CTX *s, int idx)
 
int ssl_ok (SSL *s)
 
X509_STORESSL_CTX_get_cert_store (const SSL_CTX *ctx)
 
void SSL_CTX_set_cert_store (SSL_CTX *ctx, X509_STORE *store)
 
int SSL_want (const SSL *s)
 
void SSL_CTX_set_tmp_rsa_callback (SSL_CTX *ctx, RSA *(*cb)(SSL *ssl, int is_export, int keylength))
 Set the callback for generating temporary RSA keys. More...
 
void SSL_set_tmp_rsa_callback (SSL *ssl, RSA *(*cb)(SSL *ssl, int is_export, int keylength))
 
void SSL_CTX_set_tmp_dh_callback (SSL_CTX *ctx, DH *(*dh)(SSL *ssl, int is_export, int keylength))
 Set the callback for generating temporary DH keys. More...
 
void SSL_set_tmp_dh_callback (SSL *ssl, DH *(*dh)(SSL *ssl, int is_export, int keylength))
 
void SSL_CTX_set_tmp_ecdh_callback (SSL_CTX *ctx, EC_KEY *(*ecdh)(SSL *ssl, int is_export, int keylength))
 
void SSL_set_tmp_ecdh_callback (SSL *ssl, EC_KEY *(*ecdh)(SSL *ssl, int is_export, int keylength))
 
void SSL_CTX_set_msg_callback (SSL_CTX *ctx, void(*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg))
 
void SSL_set_msg_callback (SSL *ssl, void(*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg))
 

Variables

const char * SSL_version_str =OPENSSL_VERSION_TEXT
 
SSL3_ENC_METHOD ssl3_undef_enc_method
 
int(*)(int, X509_STORE_CTX *) SSL_get_verify_callback (const SSL *s)
 
int(*)(int, X509_STORE_CTX *) SSL_CTX_get_verify_callback (const SSL_CTX *ctx)
 
void(*)(const SSL *, int, int) SSL_get_info_callback (const SSL *ssl)
 

Detailed Description

Version independent SSL functions.

Function Documentation

int SSL_CTX_set_cipher_list ( SSL_CTX ctx,
const char *  str 
)

specify the ciphers to be used by default by the SSL_CTX

int SSL_CTX_set_ssl_version ( SSL_CTX ctx,
SSL_METHOD meth 
)

Used to change an SSL_CTXs default SSL method type

void SSL_CTX_set_tmp_dh_callback ( SSL_CTX ctx,
DH *(*)(SSL *ssl, int is_export, int keylength)  dh 
)

Set the callback for generating temporary DH keys.

Parameters
ctxthe SSL context.
dhthe callback
void SSL_CTX_set_tmp_rsa_callback ( SSL_CTX ctx,
RSA *(*)(SSL *ssl, int is_export, int keylength)  cb 
)

Set the callback for generating temporary RSA keys.

Parameters
ctxthe SSL context.
cbthe callback
const char* SSL_get_cipher_list ( const SSL s,
int  n 
)

The old interface to get the same thing as SSL_get_ciphers()

const char* SSL_get_servername ( const SSL s,
const int  type 
)

return a servername extension value if provided in Client Hello, or NULL. So far, only host_name types are defined (RFC 3546).

int SSL_set_cipher_list ( SSL s,
const char *  str 
)

specify the ciphers to be used by the SSL

STACK_OF ( SSL_CIPHER  )

return a STACK of the ciphers available for the SSL and in order of preference

return a STACK of the ciphers available for the SSL and in order of algorithm id

Variable Documentation

SSL3_ENC_METHOD ssl3_undef_enc_method
Initial value:
={
(int (*)(SSL *,int))ssl_undefined_function,
(int (*)(SSL *, unsigned char *, int))ssl_undefined_function,
ssl_undefined_function,
(int (*)(SSL *, unsigned char *, unsigned char *, int))ssl_undefined_function,
(int (*)(SSL*, int))ssl_undefined_function,
(int (*)(SSL *, EVP_MD_CTX *, EVP_MD_CTX *, const char*, int, unsigned char *))ssl_undefined_function,
0,
(int (*)(SSL *, EVP_MD_CTX *, unsigned char *))ssl_undefined_function,
NULL,
0,
NULL,
0,
(int (*)(int))ssl_undefined_function
}
Definition: evp.h:265
Definition: ssl.h:1105