From bdb465274f432be7fa8b65822c95e5abbdb773a4 Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Fri, 29 Jan 2016 00:11:41 -0500 Subject: urldata: Error on missing SSL backend-specific connect info --- lib/urldata.h | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'lib/urldata.h') diff --git a/lib/urldata.h b/lib/urldata.h index 929ba96e4..775da1e19 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -275,20 +275,18 @@ struct ssl_connect_data { bool use; ssl_connection_state state; ssl_connect_state connecting_state; -#ifdef USE_OPENSSL +#if defined(USE_OPENSSL) /* these ones requires specific SSL-types */ SSL_CTX* ctx; SSL* handle; X509* server_cert; -#endif /* USE_OPENSSL */ -#ifdef USE_GNUTLS +#elif defined(USE_GNUTLS) gnutls_session_t session; gnutls_certificate_credentials_t cred; #ifdef USE_TLS_SRP gnutls_srp_client_credentials_t srp_client_cred; #endif -#endif /* USE_GNUTLS */ -#ifdef USE_MBEDTLS +#elif defined(USE_MBEDTLS) mbedtls_ctr_drbg_context ctr_drbg; mbedtls_entropy_context entropy; mbedtls_ssl_context ssl; @@ -299,8 +297,7 @@ struct ssl_connect_data { mbedtls_x509_crl crl; mbedtls_pk_context pk; mbedtls_ssl_config config; -#endif /* USE_MBEDTLS */ -#ifdef USE_POLARSSL +#elif defined(USE_POLARSSL) ctr_drbg_context ctr_drbg; entropy_context entropy; ssl_context ssl; @@ -310,27 +307,22 @@ struct ssl_connect_data { x509_crt clicert; x509_crl crl; rsa_context rsa; -#endif /* USE_POLARSSL */ -#ifdef USE_CYASSL +#elif defined(USE_CYASSL) SSL_CTX* ctx; SSL* handle; -#endif /* USE_CYASSL */ -#ifdef USE_NSS +#elif defined(USE_NSS) PRFileDesc *handle; char *client_nickname; struct SessionHandle *data; struct curl_llist *obj_list; PK11GenericObject *obj_clicert; -#endif /* USE_NSS */ -#ifdef USE_GSKIT +#elif defined(USE_GSKIT) gsk_handle handle; int iocport; -#endif -#ifdef USE_AXTLS +#elif defined(USE_AXTLS) SSL_CTX* ssl_ctx; SSL* ssl; -#endif /* USE_AXTLS */ -#ifdef USE_SCHANNEL +#elif defined(USE_SCHANNEL) struct curl_schannel_cred *cred; struct curl_schannel_ctxt *ctxt; SecPkgContext_StreamSizes stream_sizes; @@ -341,13 +333,14 @@ struct ssl_connect_data { CURLcode recv_unrecoverable_err; /* schannel_recv had an unrecoverable err */ bool recv_sspi_close_notify; /* true if connection closed by close_notify */ bool recv_connection_closed; /* true if connection closed, regardless how */ -#endif /* USE_SCHANNEL */ -#ifdef USE_DARWINSSL +#elif defined(USE_DARWINSSL) SSLContextRef ssl_ctx; curl_socket_t ssl_sockfd; bool ssl_direction; /* true if writing, false if reading */ size_t ssl_write_buffered_length; -#endif /* USE_DARWINSSL */ +#elif defined(USE_SSL) +#error "SSL backend specific information missing from ssl_connect_data" +#endif }; struct ssl_config_data { -- cgit v1.2.3