Home | History | Annotate | Download | only in ssl

Lines Matching refs:ssl

1 /*! \file ssl/ssl_lib.c
2 * \brief Version independent SSL functions.
7 * This package is an SSL implementation written
9 * The implementation was written so as to conform with Netscapes SSL.
14 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
167 (int (*)(SSL *,int))ssl_undefined_function,
168 (int (*)(SSL *, unsigned char *, int))ssl_undefined_function,
170 (int (*)(SSL *, unsigned char *, unsigned char *, int))ssl_undefined_function,
171 (int (*)(SSL*, int))ssl_undefined_function,
172 (int (*)(SSL *, const char*, int, unsigned char *))ssl_undefined_function,
174 (int (*)(SSL *, int, unsigned char *))ssl_undefined_function,
180 (int (*)(SSL *, unsigned char *, size_t, const char *,
185 int SSL_clear(SSL *s)
257 /** Used to change an SSL_CTXs default SSL method type */
275 SSL *SSL_new(SSL_CTX *ctx)
277 SSL *s;
290 s=(SSL *)OPENSSL_malloc(sizeof(SSL));
292 memset(s,0,sizeof(SSL));
306 * parameters for the per-SSL copy, ssl_cert_new would be
412 int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx,
420 ssl->sid_ctx_length=sid_ctx_len;
421 memcpy(ssl->sid_ctx,sid_ctx,sid_ctx_len);
434 int SSL_set_generate_session_id(SSL *ssl, GEN_SESSION_CB cb)
437 ssl->generate_session_id = cb;
442 int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
449 * use by this SSL. */
455 r.ssl_version = ssl->version;
471 p = lh_SSL_SESSION_retrieve(ssl->ctx->sessions, &r);
481 int SSL_set_purpose(SSL *s, int purpose)
491 int SSL_set_trust(SSL
501 int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm)
503 return X509_VERIFY_PARAM_set1(ssl->param, vpm);
506 void SSL_free(SSL *s)
515 REF_PRINT("SSL",s);
611 void SSL_set_bio(SSL *s,BIO *rbio,BIO *wbio)
631 BIO *SSL_get_rbio(const SSL *s)
634 BIO *SSL_get_wbio(const SSL *s)
637 int SSL_get_fd(const SSL *s)
642 int SSL_get_rfd(const SSL *s)
654 int SSL_get_wfd(const SSL *s)
667 int SSL_set_fd(SSL *s,int fd)
686 int SSL_set_wfd(SSL *s,int fd)
708 int SSL_set_rfd(SSL *s,int fd)
736 size_t SSL_get_finished(const SSL *s, void *buf, size_t count)
751 size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count)
766 int SSL_get_verify_mode(const SSL *s)
771 int SSL_get_verify_depth(const SSL *s)
776 int (*SSL_get_verify_callback(const SSL *s))(int,X509_STORE_CTX *)
796 void SSL_set_verify(SSL *s,int mode,
804 void SSL_set_verify_depth(SSL *s,int depth)
809 void SSL_set_read_ahead(SSL *s,int yes)
814 int SSL_get_read_ahead(const SSL *s)
819 int SSL_pending(const SSL *s)
831 X509 *SSL_get_peer_certificate(const SSL *s)
847 STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s)
864 void SSL_copy_session_id(SSL *t,const SSL *f)
868 /* Do we need to to SSL locking? */
911 int SSL_check_private_key(const SSL *ssl)
913 if (ssl == NULL)
918 if (ssl->cert == NULL)
923 if (ssl->cert->key->x509 == NULL)
928 if (ssl->cert->key->privatekey == NULL)
933 return(X509_check_private_key(ssl->cert->key->x509,
934 ssl->cert->key->privatekey));
937 int SSL_accept(SSL *s)
946 int SSL_connect(SSL *s)
955 long SSL_get_default_timeout(const SSL *s)
960 int SSL_read(SSL *s,void *buf,int num)
976 int SSL_peek(SSL *s,void *buf,int num)
991 int SSL_write(SSL *s,const void *buf,int num)
1008 int SSL_shutdown(SSL *s)
1028 int SSL_renegotiate(SSL *s)
1038 int SSL_renegotiate_abbreviated(SSL *s)
1048 int SSL_renegotiate_pending(SSL *s)
1055 long SSL_ctrl(SSL *s,int cmd,long larg,void *parg)
1113 long SSL_callback_ctrl(SSL *s, int cmd, void (*fp)(void))
1118 s->msg_callback = (void (*)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg))(fp);
1215 ctx->msg_callback = (void (*)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg))(fp);
1246 /** return a STACK of the ciphers available for the SSL and in order of
1248 SSL *s)
1265 /** return a STACK of the ciphers available for the SSL and in order of
1267 STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *s)
1285 const char *SSL_get_cipher_list(const SSL *s,int n)
1323 /** specify the ciphers to be used by the SSL */
1324 int SSL_set_cipher_list(SSL *s,const char *str)
1341 /** specify the ciphers to be used by the SSL */
1342 int SSL_set_cipher_lists(SSL *s,STACK_OF(SSL_CIPHER) *sk)
1368 char *SSL_get_shared_ciphers(const SSL *s,char *buf,int len)
1403 int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p,
1456 STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
1528 const char *SSL_get_servername(const SSL *s, const int type)
1538 int SSL_get_servername_type(const SSL *s)
1620 void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data, unsigned *len)
1634 * not be modified, but one should assume that the SSL* keeps a reference to
1639 void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *ctx, int (*cb) (SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg), void *arg)
1655 void SSL_CTX_set_next_proto_select_cb(SSL_CTX *ctx, int (*cb) (SSL *s, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg), void *arg)
1663 int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
1704 * ssl.h. */
2256 int ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s)
2328 CERT_PKEY *ssl_get_server_send_pkey(const SSL *s)
2390 X509 *ssl_get_server_send_cert(const SSL *s)
2399 EVP_PKEY *ssl_get_sign_pkey(SSL *s,const SSL_CIPHER *cipher, const EVP_MD **pmd)
2431 void ssl_update_cache(SSL *s,int mode)
2463 const SSL_METHOD *SSL_get_ssl_method(SSL *s)
2468 int SSL_set_ssl_method(SSL *s, const SSL_METHOD *meth)
2495 int SSL_get_error(const SSL *s,int i)
2582 int SSL_do_handshake(SSL *s)
2603 void SSL_set_accept_state(SSL *s)
2615 void SSL_set_connect_state(SSL *s)
2627 int ssl_undefined_function(SSL *s)
2639 int ssl_undefined_const_function(const SSL *s)
2667 const char *SSL_get_version(const SSL *s)
2677 const char* SSL_authentication_method(const SSL* ssl)
2679 if (ssl->cert != NULL && ssl->cert->rsa_tmp != NULL)
2681 switch (ssl->version)
2686 return SSL_CIPHER_authentication_method(ssl->s3->tmp.new_cipher);
2690 SSL *SSL_dup(SSL *s)
2694 SSL *ret;
2821 void ssl_clear_cipher_ctx(SSL *s)
2850 X509 *SSL_get_certificate(const SSL *s)
2861 EVP_PKEY *SSL_get_privatekey(SSL *s)
2869 const SSL_CIPHER *SSL_get_current_cipher(const SSL *s)
2876 const void *SSL_get_current_compression(SSL *s)
2880 const void *SSL_get_current_expansion(SSL *s)
2886 const COMP_METHOD *SSL_get_current_compression(SSL *s)
2893 const COMP_METHOD *SSL_get_current_expansion(SSL *s)
2901 int ssl_init_wbio_buffer(SSL *s,int push)
2937 void ssl_free_wbio_buffer(SSL *s)
2963 void SSL_set_quiet_shutdown(SSL *s,int mode)
2968 int SSL_get_quiet_shutdown(const SSL *s)
2973 void SSL_set_shutdown(SSL *s,int mode)
2978 int SSL_get_shutdown(const SSL *s)
2983 int SSL_version(const SSL *s)
2988 SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl)
2990 return(ssl->ctx);
2993 SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx)
2995 if (ssl->ctx == ctx)
2996 return ssl->ctx;
2999 ctx = ssl->initial_ctx;
3001 if (ssl->cert != NULL)
3002 ssl_cert_free(ssl->cert);
3003 ssl->cert = ssl_cert_dup(ctx->cert);
3005 if (ssl->ctx != NULL)
3006 SSL_CTX_free(ssl->ctx); /* decrement reference count */
3007 ssl->ctx = ctx;
3008 return(ssl->ctx);
3024 void SSL_set_info_callback(SSL *ssl,
3025 void (*cb)(const SSL *ssl,int type,int val))
3027 ssl->info_callback=cb;
3032 void (*SSL_get_info_callback(const SSL *ssl))(const SSL * /*ssl*/,int /*type*/,int /*val*/)
3034 return ssl->info_callback;
3037 int SSL_state(const SSL *ssl)
3039 return(ssl->state);
3042 void SSL_set_state(SSL *ssl, int state)
3044 ssl->state = state;
3047 void SSL_set_verify_result(SSL *ssl,long arg)
3049 ssl->verify_result=arg;
3052 long SSL_get_verify_result(const SSL *ssl)
3054 return(ssl->verify_result);
3064 int SSL_set_ex_data(SSL *s,int idx,void *arg)
3069 void *SSL_get_ex_data(const SSL *s,int idx)
3091 int ssl_ok(SSL *s)
3108 int SSL_want(const SSL *s)
3115 * \param ctx the SSL context.
3120 void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,RSA *(*cb)(SSL *ssl,
3127 void SSL_set_tmp_rsa_callback(SSL *ssl,RSA *(*cb)(SSL *ssl,
3131 SSL_callback_ctrl(ssl,SSL_CTRL_SET_TMP_RSA_CB,(void (*)(void))cb);
3138 * \param ssl the SSL session.
3146 RSA *cb(SSL *ssl,int is_export,int keylength)
3152 * \param ctx the SSL context.
3157 void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,DH *(*dh)(SSL *ssl,int is_export,
3163 void SSL_set_tmp_dh_callback(SSL *ssl,DH *(*dh)(SSL *ssl,int is_export,
3166 SSL_callback_ctrl(ssl,SSL_CTRL_SET_TMP_DH_CB,(void (*)(void))dh);
3171 void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx,EC_KEY *(*ecdh)(SSL *ssl,int is_export,
3177 void SSL_set_tmp_ecdh_callback(SSL *ssl,EC_KEY *(*ecdh)(SSL *ssl,int is_export,
3180 SSL_callback_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH_CB,(void (*)(void))ecdh);
3205 int SSL_use_psk_identity_hint(SSL *s, const char *identity_hint)
3231 const char *SSL_get_psk_identity_hint(const SSL *s)
3238 const char *SSL_get_psk_identity(const SSL *s)
3245 void SSL_set_psk_client_callback(SSL *s,
3246 unsigned int (*cb)(SSL *ssl, const char *hint,
3254 unsigned int (*cb)(SSL *ssl, const char *hint,
3261 void SSL_set_psk_server_callback(SSL *s,
3262 unsigned int (*cb)(SSL *ssl, const char *identity,
3269 unsigned int (*cb)(SSL *ssl, const char *identity,
3276 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))
3280 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))
3282 SSL_callback_ctrl(ssl, SSL_CTRL_SET_MSG_CALLBACK, (void (*)(void))cb);
3285 int SSL_cutthrough_complete(const SSL *s)
3291 (SSL_get_mode((SSL*)s) & SSL_MODE_HANDSHAKE_CUTTHROUGH) && /* cutthrough enabled */
3318 void SSL_set_debug(SSL *s, int debug)
3323 int SSL_cache_hit(SSL *s)