]> granicus.if.org Git - curl/commitdiff
krb5_sspi: Only process challenge when present
authorSteve Holme <steve_holme@hotmail.com>
Sun, 3 Apr 2016 10:45:02 +0000 (11:45 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 3 Apr 2016 10:45:02 +0000 (11:45 +0100)
This wouldn't cause a problem because of the way the function is called,
but prior to this change, we were processing the challenge message when
the credentials were NULL rather than when the challenge message was
populated.

This also brings this part of the Kerberos 5 code in line with the
Negotiate code.

lib/vauth/krb5_sspi.c

index 4ad5f3ac06f9534fa114ef7a0414f31e9ccb2a5b..ee80daee058a1928ace01bb159710fde14a6946e 100644 (file)
@@ -150,9 +150,10 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
 
     memset(krb5->context, 0, sizeof(CtxtHandle));
   }
-  else {
+
+  if(chlg64 && strlen(chlg64)) {
     /* Decode the base-64 encoded challenge message */
-    if(strlen(chlg64) && *chlg64 != '=') {
+    if(*chlg64 != '=') {
       result = Curl_base64_decode(chlg64, &chlg, &chlglen);
       if(result)
         return result;