]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vauth: Added check for supported SSPI based authentication mechanisms
authorSteve Holme <steve_holme@hotmail.com>
Thu, 24 Mar 2016 19:03:58 +0000 (19:03 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 21 Aug 2016 09:27:09 +0000 (10:27 +0100)
Completing commit 00417fd66c and 2708d4259b.

lib/vauth/digest_sspi.c
lib/vauth/krb5_sspi.c
lib/vauth/ntlm_sspi.c
lib/vauth/spnego_sspi.c

index 9254385e5908e7db2134983044779ff08d889754..1cc704d5888d1633d49cb77a755ff02183cd3596 100644 (file)
 */
 bool Curl_auth_is_digest_supported(void)
 {
-  /* TODO: Return true for now which maintains compatability with the existing
-     code */
-  return TRUE;
+  PSecPkgInfo SecurityPackage;
+  SECURITY_STATUS status;
+
+  /* Query the security package for Digest */
+  status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST),
+                                              &SecurityPackage);
+
+  return (status == SEC_E_OK ? TRUE : FALSE);
 }
 
 /*
index e046900461436c2fc78bb033cbbdf60be8e9392b..151794e619ae90f5532a2f0f7ab829c821aca98a 100644 (file)
  */
 bool Curl_auth_is_gssapi_supported(void)
 {
-  /* TODO: Return true for now which maintains compatability with the existing
-     code */
-  return TRUE;
+  PSecPkgInfo SecurityPackage;
+  SECURITY_STATUS status;
+
+  /* Query the security package for Kerberos */
+  status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *)
+                                              TEXT(SP_NAME_KERBEROS),
+                                              &SecurityPackage);
+
+  return (status == SEC_E_OK ? TRUE : FALSE);
 }
 
 /*
index 6f446780e0db52939dea12ab84500f6b1a427cfb..c3305176d889728076be30b21ebef61a1f6890ce 100644 (file)
  */
 bool Curl_auth_is_ntlm_supported(void)
 {
-  /* TODO: Return true for now which maintains compatability with the existing
-     code */
-  return TRUE;
+  PSecPkgInfo SecurityPackage;
+  SECURITY_STATUS status;
+
+  /* Query the security package for NTLM */
+  status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NTLM),
+                                              &SecurityPackage);
+
+  return (status == SEC_E_OK ? TRUE : FALSE);
 }
 
 /*
index f83c44632e2267d8a82ff81c34af5d46feec3e56..672b43fa423734bce86521850a92db187f2b8664 100644 (file)
  */
 bool Curl_auth_is_spnego_supported(void)
 {
-  /* TODO: Return true for now which maintains compatability with the existing
-     code */
-  return TRUE;
+  PSecPkgInfo SecurityPackage;
+  SECURITY_STATUS status;
+
+  /* Query the security package for Negotiate */
+  status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *)
+                                              TEXT(SP_NAME_NEGOTIATE),
+                                              &SecurityPackage);
+
+  return (status == SEC_E_OK ? TRUE : FALSE);
 }
 
 /*