Commit 00417fd6 authored by Steve Holme's avatar Steve Holme
Browse files

sasl: Added calls to Curl_auth_is_<mechansism>_supported()

Hooked up the SASL authentication layer to query the new 'is mechanism
supported' functions when deciding what mechanism to use.

For now existing functionality is maintained.
parent 0796a993
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -288,7 +288,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
  }
  }
  else if(conn->bits.user_passwd) {
  else if(conn->bits.user_passwd) {
#if defined(USE_KERBEROS5)
#if defined(USE_KERBEROS5)
    if(enabledmechs & SASL_MECH_GSSAPI) {
    if((enabledmechs & SASL_MECH_GSSAPI) && Curl_auth_is_gssapi_supported()) {
      sasl->mutual_auth = FALSE; /* TODO: Calculate mutual authentication */
      sasl->mutual_auth = FALSE; /* TODO: Calculate mutual authentication */
      mech = SASL_MECH_STRING_GSSAPI;
      mech = SASL_MECH_STRING_GSSAPI;
      state1 = SASL_GSSAPI;
      state1 = SASL_GSSAPI;
@@ -308,7 +308,8 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
    else
    else
#endif
#endif
#ifndef CURL_DISABLE_CRYPTO_AUTH
#ifndef CURL_DISABLE_CRYPTO_AUTH
    if(enabledmechs & SASL_MECH_DIGEST_MD5) {
    if((enabledmechs & SASL_MECH_DIGEST_MD5) &&
       Curl_auth_is_digest_supported()) {
      mech = SASL_MECH_STRING_DIGEST_MD5;
      mech = SASL_MECH_STRING_DIGEST_MD5;
      state1 = SASL_DIGESTMD5;
      state1 = SASL_DIGESTMD5;
      sasl->authused = SASL_MECH_DIGEST_MD5;
      sasl->authused = SASL_MECH_DIGEST_MD5;
@@ -321,7 +322,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
    else
    else
#endif
#endif
#ifdef USE_NTLM
#ifdef USE_NTLM
    if(enabledmechs & SASL_MECH_NTLM) {
    if((enabledmechs & SASL_MECH_NTLM) && Curl_auth_is_ntlm_supported()) {
      mech = SASL_MECH_STRING_NTLM;
      mech = SASL_MECH_STRING_NTLM;
      state1 = SASL_NTLM;
      state1 = SASL_NTLM;
      state2 = SASL_NTLM_TYPE2MSG;
      state2 = SASL_NTLM_TYPE2MSG;