Eneboo - Documentación para desarrolladores
'defines' | Funciones | Variables
Referencia del Archivo src/libdigidoc/openssl/ssl/ssl_lib.c

Version independent SSL functions. Más...

#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/ocsp.h>
#include <openssl/dh.h>
#include <openssl/engine.h>

'defines'

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

Funciones

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)
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.
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.
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, intSSL_get_info_callback (const SSL *ssl)

Descripción detallada

Version independent SSL functions.


Documentación de los 'defines'

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

Documentación de las funciones

int check_srvr_ecc_cert_and_alg ( X509 x,
SSL_CIPHER cs 
)
int SSL_accept ( SSL s)
SSL_METHOD* ssl_bad_method ( int  ver)
long SSL_callback_ctrl ( SSL s,
int  cmd,
void(*)(void)  fp 
)
int SSL_check_private_key ( const SSL ssl)
int ssl_cipher_id_cmp ( const SSL_CIPHER a,
const SSL_CIPHER b 
)
int ssl_cipher_list_to_bytes ( SSL s,
STACK_OF(SSL_CIPHER)*  sk,
unsigned char *  p,
int(*)(const SSL_CIPHER *, unsigned char *)  put_cb 
)
int ssl_cipher_ptr_id_cmp ( const SSL_CIPHER *const *  ap,
const SSL_CIPHER *const *  bp 
)
int SSL_clear ( SSL s)
void ssl_clear_cipher_ctx ( SSL s)
int SSL_connect ( SSL s)
void SSL_copy_session_id ( SSL t,
const SSL f 
)
long SSL_ctrl ( SSL s,
int  cmd,
long  larg,
void *  parg 
)
long SSL_CTX_callback_ctrl ( SSL_CTX ctx,
int  cmd,
void(*)(void)  fp 
)
int SSL_CTX_check_private_key ( const SSL_CTX ctx)
long SSL_CTX_ctrl ( SSL_CTX ctx,
int  cmd,
long  larg,
void *  parg 
)
void SSL_CTX_free ( SSL_CTX a)
X509_STORE* SSL_CTX_get_cert_store ( const SSL_CTX ctx)
void* SSL_CTX_get_ex_data ( const SSL_CTX 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_get_quiet_shutdown ( const SSL_CTX ctx)
int SSL_CTX_get_verify_depth ( const SSL_CTX ctx)
int SSL_CTX_get_verify_mode ( const SSL_CTX ctx)
int SSL_CTX_load_verify_locations ( SSL_CTX ctx,
const char *  CAfile,
const char *  CApath 
)
struct lhash_st* SSL_CTX_sessions ( SSL_CTX ctx) [read]
void SSL_CTX_set_cert_store ( SSL_CTX ctx,
X509_STORE store 
)
void SSL_CTX_set_cert_verify_callback ( SSL_CTX ctx,
int(*)(X509_STORE_CTX *, void *)  cb,
void *  arg 
)
int SSL_CTX_set_cipher_list ( SSL_CTX ctx,
const char *  str 
)

specify the ciphers to be used by default by the SSL_CTX

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 
)
int SSL_CTX_set_default_verify_paths ( SSL_CTX ctx)
int SSL_CTX_set_ex_data ( SSL_CTX s,
int  idx,
void *  arg 
)
int SSL_CTX_set_generate_session_id ( SSL_CTX ctx,
GEN_SESSION_CB  cb 
)
void SSL_CTX_set_msg_callback ( SSL_CTX ctx,
void(*)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg cb 
)
int SSL_CTX_set_purpose ( SSL_CTX s,
int  purpose 
)
void SSL_CTX_set_quiet_shutdown ( SSL_CTX ctx,
int  mode 
)
int SSL_CTX_set_session_id_context ( SSL_CTX ctx,
const unsigned char *  sid_ctx,
unsigned int  sid_ctx_len 
)
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.

Parámetros:
ctxthe SSL context.
dhthe callback
void SSL_CTX_set_tmp_ecdh_callback ( SSL_CTX ctx,
EC_KEY *(*)(SSL *ssl, int is_export, int keylength)  ecdh 
)
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.

Parámetros:
ctxthe SSL context.
cbthe callback
int SSL_CTX_set_trust ( SSL_CTX s,
int  trust 
)
void SSL_CTX_set_verify ( SSL_CTX ctx,
int  mode,
int(*)(int, X509_STORE_CTX *)  cb 
)
void SSL_CTX_set_verify_depth ( SSL_CTX ctx,
int  depth 
)
int SSL_do_handshake ( SSL s)
SSL* SSL_dup ( SSL s)
void SSL_free ( SSL s)
void ssl_free_wbio_buffer ( SSL s)
X509* SSL_get_certificate ( const SSL s)
const char* SSL_get_cipher_list ( const SSL s,
int  n 
)

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

SSL_CIPHER* SSL_get_current_cipher ( const SSL s)
const COMP_METHOD* SSL_get_current_compression ( SSL s)
const COMP_METHOD* SSL_get_current_expansion ( SSL s)
long SSL_get_default_timeout ( const SSL s)
int SSL_get_error ( const SSL s,
int  i 
)
void* SSL_get_ex_data ( const SSL s,
int  idx 
)
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_get_fd ( const SSL s)
size_t SSL_get_finished ( const SSL s,
void *  buf,
size_t  count 
)
X509* SSL_get_peer_certificate ( const SSL s)
size_t SSL_get_peer_finished ( const SSL s,
void *  buf,
size_t  count 
)
EVP_PKEY* SSL_get_privatekey ( SSL s) [read]
int SSL_get_quiet_shutdown ( const SSL s)
BIO* SSL_get_rbio ( const SSL s)
int SSL_get_read_ahead ( const SSL s)
int SSL_get_rfd ( const SSL s)
X509* ssl_get_server_send_cert ( SSL s)
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_get_servername_type ( const SSL s)
char* SSL_get_shared_ciphers ( const SSL s,
char *  buf,
int  len 
)
int SSL_get_shutdown ( const SSL s)
EVP_PKEY* ssl_get_sign_pkey ( SSL s,
SSL_CIPHER cipher 
)
SSL_CTX* SSL_get_SSL_CTX ( const SSL ssl)
SSL_METHOD* SSL_get_ssl_method ( SSL s)
int SSL_get_verify_depth ( const SSL s)
int SSL_get_verify_mode ( const SSL s)
long SSL_get_verify_result ( const SSL ssl)
const char* SSL_get_version ( const SSL s)
BIO* SSL_get_wbio ( const SSL s)
int SSL_get_wfd ( const SSL s)
int SSL_has_matching_session_id ( const SSL ssl,
const unsigned char *  id,
unsigned int  id_len 
)
int ssl_init_wbio_buffer ( SSL s,
int  push 
)
SSL* SSL_new ( SSL_CTX ctx)
int ssl_ok ( SSL s)
int SSL_peek ( SSL s,
void *  buf,
int  num 
)
int SSL_pending ( const SSL s)
int SSL_read ( SSL s,
void *  buf,
int  num 
)
int SSL_renegotiate ( SSL s)
int SSL_renegotiate_pending ( SSL s)
int SSL_SESSION_cmp ( const SSL_SESSION a,
const SSL_SESSION b 
)
unsigned long SSL_SESSION_hash ( const SSL_SESSION a)
void SSL_set_accept_state ( SSL s)
void SSL_set_bio ( SSL s,
BIO rbio,
BIO wbio 
)
void ssl_set_cert_masks ( CERT c,
SSL_CIPHER cipher 
)
int SSL_set_cipher_list ( SSL s,
const char *  str 
)

specify the ciphers to be used by the SSL

void SSL_set_connect_state ( SSL s)
int SSL_set_ex_data ( SSL s,
int  idx,
void *  arg 
)
int SSL_set_fd ( SSL s,
int  fd 
)
int SSL_set_generate_session_id ( SSL ssl,
GEN_SESSION_CB  cb 
)
void SSL_set_info_callback ( SSL ssl,
void(*)(const SSL *ssl, int type, int val cb 
)
void SSL_set_msg_callback ( SSL ssl,
void(*)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg cb 
)
int SSL_set_purpose ( SSL s,
int  purpose 
)
void SSL_set_quiet_shutdown ( SSL s,
int  mode 
)
void SSL_set_read_ahead ( SSL s,
int  yes 
)
int SSL_set_rfd ( SSL s,
int  fd 
)
int SSL_set_session_id_context ( SSL ssl,
const unsigned char *  sid_ctx,
unsigned int  sid_ctx_len 
)
void SSL_set_shutdown ( SSL s,
int  mode 
)
SSL_CTX* SSL_set_SSL_CTX ( SSL ssl,
SSL_CTX ctx 
)
int SSL_set_ssl_method ( SSL s,
SSL_METHOD meth 
)
void SSL_set_tmp_dh_callback ( SSL ssl,
DH *(*)(SSL *ssl, int is_export, int keylength)  dh 
)
void SSL_set_tmp_ecdh_callback ( SSL ssl,
EC_KEY *(*)(SSL *ssl, int is_export, int keylength)  ecdh 
)
void SSL_set_tmp_rsa_callback ( SSL ssl,
RSA *(*)(SSL *ssl, int is_export, int keylength)  cb 
)
int SSL_set_trust ( SSL s,
int  trust 
)
void SSL_set_verify ( SSL s,
int  mode,
int(*)(int ok, X509_STORE_CTX *ctx)  callback 
)
void SSL_set_verify_depth ( SSL s,
int  depth 
)
void SSL_set_verify_result ( SSL ssl,
long  arg 
)
int SSL_set_wfd ( SSL s,
int  fd 
)
int SSL_shutdown ( SSL s)
int SSL_state ( const SSL ssl)
int ssl_undefined_const_function ( const SSL s)
int ssl_undefined_function ( SSL s)
int ssl_undefined_void_function ( void  )
void ssl_update_cache ( SSL s,
int  mode 
)
int SSL_version ( const SSL s)
int SSL_want ( const SSL s)
int SSL_write ( SSL s,
const void *  buf,
int  num 
)
STACK_OF ( X509  )
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


Documentación de las variables

Valor inicial:
{
        
        (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
        }
void(*)(const SSL * , int , int ) SSL_get_info_callback(const SSL *ssl)
const char* SSL_version_str = OPENSSL_VERSION_TEXT
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'