]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix support for Authentication-Info header.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 11 Oct 2018 22:47:19 +0000 (18:47 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 11 Oct 2018 22:47:19 +0000 (18:47 -0400)
cups/http-private.h
cups/http.c
test/run-stp-tests.sh

index eeabaae228bca72607e84d7e8d95e7edb64f2c6d..b2026e02b23fd826ad2435ce43ee9fb5994c864c 100644 (file)
@@ -369,7 +369,9 @@ struct _http_s                              /**** HTTP connection structure ****/
 #  endif /* HAVE_LIBZ */
 
   /**** New in CUPS 2.2.9 ****/
-  char                 algorithm[65],  /* Algorithm from WWW-Authenticate */
+  char                 *authentication_info,
+                                       /* Authentication-Info header */
+                       algorithm[65],  /* Algorithm from WWW-Authenticate */
                        nextnonce[HTTP_MAX_VALUE],
                                        /* Next nonce value from Authentication-Info */
                        opaque[HTTP_MAX_VALUE],
index bfebce6c04ec199d61f4f339d41a9b5d3fb9de21..34b059fb50cc3492b0bc8fcb7e7688d2b1e301df 100644 (file)
@@ -327,6 +327,12 @@ httpClearFields(http_t *http)              /* I - HTTP connection */
       http->server = NULL;
     }
 
+    if (http->authentication_info)
+    {
+      _cupsStrFree(http->authentication_info);
+      http->authentication_info = NULL;
+    }
+
     http->expect = (http_status_t)0;
   }
 }
@@ -971,11 +977,14 @@ httpGetField(http_t       *http,  /* I - HTTP connection */
     case HTTP_FIELD_SERVER :
         return (http->server);
 
+    case HTTP_FIELD_AUTHENTICATION_INFO :
+        return (http->authentication_info);
+
     case HTTP_FIELD_AUTHORIZATION :
         if (http->field_authorization)
        {
         /*
-         * Special case for WWW-Authenticate: as its contents can be
+         * Special case for Authorization: as its contents can be
          * longer than HTTP_MAX_VALUE...
          */
 
@@ -3682,6 +3691,13 @@ http_add_field(http_t       *http,       /* I - HTTP connection */
         http->server = _cupsStrAlloc(value);
         break;
 
+    case HTTP_FIELD_AUTHENTICATION_INFO :
+        if (http->authentication_info)
+          _cupsStrFree(http->authentication_info);
+
+        http->authentication_info = _cupsStrAlloc(value);
+        break;
+
     default :
        strlcpy(http->fields[field], value, HTTP_MAX_VALUE);
        break;
index 04c2f204af2a90e14f1b812b4ca5c7a02106a114..d9fb4b892fd7374b4faeb5a33e03cb8625318b89 100755 (executable)
@@ -893,7 +893,7 @@ fi
 
 # Paged printed on Test3
 count=`$GREP '^Test3 ' $BASE/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
-expected=2
+expected=4
 if test $count != $expected; then
        echo "FAIL: Printer 'Test3' produced $count page(s), expected $expected."
        echo "    <p>FAIL: Printer 'Test3' produced $count page(s), expected $expected.</p>" >>$strfile