123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #ifndef HEADER_CURL_SSLUSE_H
- #define HEADER_CURL_SSLUSE_H
- #include "curl_setup.h"
- #ifdef USE_OPENSSL
- #include <openssl/ossl_typ.h>
- #include <openssl/ssl.h>
- #include "urldata.h"
- struct ossl_ctx {
-
- SSL_CTX* ssl_ctx;
- SSL* ssl;
- X509* server_cert;
- BIO_METHOD *bio_method;
- CURLcode io_result;
- #ifndef HAVE_KEYLOG_CALLBACK
-
- bool keylog_done;
- #endif
- BIT(x509_store_setup);
- BIT(reused_session);
- };
- typedef CURLcode Curl_ossl_ctx_setup_cb(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- void *user_data);
- typedef int Curl_ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid);
- CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx,
- struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct ssl_peer *peer,
- int transport,
- const unsigned char *alpn, size_t alpn_len,
- Curl_ossl_ctx_setup_cb *cb_setup,
- void *cb_user_data,
- Curl_ossl_new_session_cb *cb_new_session,
- void *ssl_user_data);
- #if (OPENSSL_VERSION_NUMBER < 0x30000000L)
- #define SSL_get1_peer_certificate SSL_get_peer_certificate
- #endif
- extern const struct Curl_ssl Curl_ssl_openssl;
- CURLcode Curl_ssl_setup_x509_store(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- SSL_CTX *ssl_ctx);
- CURLcode Curl_ossl_ctx_configure(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- SSL_CTX *ssl_ctx);
- CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- const struct ssl_peer *peer,
- SSL_SESSION *ssl_sessionid);
- CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct ossl_ctx *octx,
- struct ssl_peer *peer);
- #endif
- #endif
|