Commit a439e438 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

ssl: generalize how the ssl backend identifier is set

Each backend now defines CURL_SSL_BACKEND accordingly. Added the *AXTLS
one which was missing previously.
parent 028a408d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -604,6 +604,7 @@ CURLSSH_AUTH_KEYBOARD 7.16.1
CURLSSH_AUTH_NONE               7.16.1
CURLSSH_AUTH_PASSWORD           7.16.1
CURLSSH_AUTH_PUBLICKEY          7.16.1
CURLSSLBACKEND_AXTLS            7.38.0
CURLSSLBACKEND_CYASSL           7.34.0
CURLSSLBACKEND_DARWINSSL        7.34.0
CURLSSLBACKEND_GNUTLS           7.34.0
+2 −1
Original line number Diff line number Diff line
@@ -2033,7 +2033,8 @@ typedef enum {
  CURLSSLBACKEND_POLARSSL = 6,
  CURLSSLBACKEND_CYASSL = 7,
  CURLSSLBACKEND_SCHANNEL = 8,
  CURLSSLBACKEND_DARWINSSL = 9
  CURLSSLBACKEND_DARWINSSL = 9,
  CURLSSLBACKEND_AXTLS = 10
} curl_sslbackend;

/* Information about the SSL library used and the respective internal SSL
+10 −10
Original line number Diff line number Diff line
@@ -285,6 +285,7 @@ static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info,
      struct curl_tlssessioninfo *tsi = &data->tsi;
      struct connectdata *conn = data->easy_conn;
      unsigned int sockindex = 0;
      void *internals = NULL;

      *tsip = tsi;
      tsi->backend = CURLSSLBACKEND_NONE;
@@ -303,25 +304,24 @@ static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info,

      /* Return the TLS session information from the relevant backend */
#ifdef USE_SSLEAY
      tsi->backend = CURLSSLBACKEND_OPENSSL;
      tsi->internals = conn->ssl[sockindex].ctx;
      internals = conn->ssl[sockindex].ctx;
#endif
#ifdef USE_GNUTLS
      tsi->backend = CURLSSLBACKEND_GNUTLS;
      tsi->internals = conn->ssl[sockindex].session;
      internals = conn->ssl[sockindex].session;
#endif
#ifdef USE_NSS
      tsi->backend = CURLSSLBACKEND_NSS;
      tsi->internals = conn->ssl[sockindex].handle;
      internals = conn->ssl[sockindex].handle;
#endif
#ifdef USE_QSOSSL
      tsi->backend = CURLSSLBACKEND_QSOSSL;
      tsi->internals = conn->ssl[sockindex].handle;
      internals = conn->ssl[sockindex].handle;
#endif
#ifdef USE_GSKIT
      tsi->backend = CURLSSLBACKEND_GSKIT;
      tsi->internals = conn->ssl[sockindex].handle;
      internals = conn->ssl[sockindex].handle;
#endif
      if(internals) {
        tsi->backend = Curl_ssl_backend();
        tsi->internals = internals;
      }
      /* NOTE: For other SSL backends, it is not immediately clear what data
         to return from 'struct ssl_connect_data'; thus, for now we keep the
         backend as CURLSSLBACKEND_NONE in those cases, which should be
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ int Curl_axtls_random(struct SessionHandle *data,
#define curlssl_check_cxn(x) Curl_axtls_check_cxn(x)
#define curlssl_data_pending(x,y) (x=x, y=y, 0)
#define curlssl_random(x,y,z) Curl_axtls_random(x,y,z)

#define CURL_SSL_BACKEND CURLSSLBACKEND_AXTLS
#endif /* USE_AXTLS */
#endif /* HEADER_CURL_AXTLS_H */
+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */
#define curlssl_data_pending(x,y) Curl_darwinssl_data_pending(x, y)
#define curlssl_random(x,y,z) Curl_darwinssl_random(y,z)
#define curlssl_md5sum(a,b,c,d) Curl_darwinssl_md5sum(a,b,c,d)
#define CURL_SSL_BACKEND CURLSSLBACKEND_DARWINSSL

#endif /* USE_DARWINSSL */
#endif /* HEADER_CURL_DARWINSSL_H */
Loading