Unverified Commit e66cca04 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

vtls: use unified "supports" bitfield member in backends

... instead of previous separate struct fields, to make it easier to
extend and change individual backends without having to modify them all.

closes #2547
parent f8d608f3
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1748,7 +1748,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
     * Set a SSL_CTX callback
     */
#ifdef USE_SSL
    if(Curl_ssl->have_ssl_ctx)
    if(Curl_ssl->supports & SSLSUPP_SSL_CTX)
      data->set.ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback);
    else
#endif
@@ -1759,7 +1759,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
     * Set a SSL_CTX callback parameter pointer
     */
#ifdef USE_SSL
    if(Curl_ssl->have_ssl_ctx)
    if(Curl_ssl->supports & SSLSUPP_SSL_CTX)
      data->set.ssl.fsslctxp = va_arg(param, void *);
    else
#endif
@@ -1778,7 +1778,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
    break;
  case CURLOPT_CERTINFO:
#ifdef USE_SSL
    if(Curl_ssl->have_certinfo)
    if(Curl_ssl->supports & SSLSUPP_CERTINFO)
      data->set.ssl.certinfo = (0 != va_arg(param, long)) ? TRUE : FALSE;
    else
#endif
@@ -1790,7 +1790,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
     * Specify file name of the public key in DER format.
     */
#ifdef USE_SSL
    if(Curl_ssl->have_pinnedpubkey)
    if(Curl_ssl->supports & SSLSUPP_PINNEDPUBKEY)
      result = Curl_setstropt(&data->set.str[STRING_SSL_PINNEDPUBLICKEY_ORIG],
                              va_arg(param, char *));
    else
@@ -1803,7 +1803,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
     * Specify file name of the public key in DER format.
     */
#ifdef USE_SSL
    if(Curl_ssl->have_pinnedpubkey)
    if(Curl_ssl->supports & SSLSUPP_PINNEDPUBKEY)
      result = Curl_setstropt(&data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY],
                              va_arg(param, char *));
    else
@@ -1831,7 +1831,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
     * certificates which have been prepared using openssl c_rehash utility.
     */
#ifdef USE_SSL
    if(Curl_ssl->have_ca_path)
    if(Curl_ssl->supports & SSLSUPP_CA_PATH)
      /* This does not work on windows. */
      result = Curl_setstropt(&data->set.str[STRING_SSL_CAPATH_ORIG],
                              va_arg(param, char *));
@@ -1845,7 +1845,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
     * CA certificates which have been prepared using openssl c_rehash utility.
     */
#ifdef USE_SSL
    if(Curl_ssl->have_ca_path)
    if(Curl_ssl->supports & SSLSUPP_CA_PATH)
      /* This does not work on windows. */
      result = Curl_setstropt(&data->set.str[STRING_SSL_CAPATH_PROXY],
                              va_arg(param, char *));
+1 −1
Original line number Diff line number Diff line
@@ -2740,7 +2740,7 @@ static CURLcode parse_proxy(struct Curl_easy *data,
    proxyptr = proxy; /* No xxx:// head: It's a HTTP proxy */

#ifdef USE_SSL
  if(!Curl_ssl->support_https_proxy)
  if(!(Curl_ssl->supports & SSLSUPP_HTTPS_PROXY))
#endif
    if(proxytype == CURLPROXY_HTTPS) {
      failf(data, "Unsupported proxy \'%s\', libcurl is built without the "
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
@@ -399,7 +399,7 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
#ifdef USE_SSL
  Curl_ssl_version(ssl_buffer, sizeof(ssl_buffer));
  version_info.ssl_version = ssl_buffer;
  if(Curl_ssl->support_https_proxy)
  if(Curl_ssl->supports & SSLSUPP_HTTPS_PROXY)
    version_info.features |= CURL_VERSION_HTTPS_PROXY;
  else
    version_info.features &= ~CURL_VERSION_HTTPS_PROXY;
+2 −8
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 2010, DirecTV, Contact: Eric Hu, <ehu@directv.com>.
 * Copyright (C) 2010 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 2010 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
@@ -703,13 +703,7 @@ static void *Curl_axtls_get_internals(struct ssl_connect_data *connssl,

const struct Curl_ssl Curl_ssl_axtls = {
  { CURLSSLBACKEND_AXTLS, "axtls" }, /* info */

  0, /* have_ca_path */
  0, /* have_certinfo */
  0, /* have_pinnedpubkey */
  0, /* have_ssl_ctx */
  0, /* support_https_proxy */

  0, /* no fancy stuff */
  sizeof(struct ssl_backend_data),

  /*
+2 −7
Original line number Diff line number Diff line
@@ -994,15 +994,10 @@ static void *Curl_cyassl_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_cyassl = {
  { CURLSSLBACKEND_WOLFSSL, "WolfSSL" }, /* info */

  0, /* have_ca_path */
  0, /* have_certinfo */
#ifdef KEEP_PEER_CERT
  1, /* have_pinnedpubkey */
#else
  0, /* have_pinnedpubkey */
  SSLSUPP_PINNEDPUBKEY |
#endif
  1, /* have_ssl_ctx */
  0, /* support_https_proxy */
  SSLSUPP_SSL_CTX

  sizeof(struct ssl_backend_data),

Loading