]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/http-support.c
Add support for DigestOptions directive in client.conf (Issue #5647)
[thirdparty/cups.git] / cups / http-support.c
index 6d86071407edec7ce71d316c7d782b98a747cfbf..824b8dcf1bc1c94681ede52758bbc5f88b9b01a5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * HTTP support routines for CUPS.
  *
- * Copyright 2007-2018 by Apple Inc.
+ * Copyright 2007-2019 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
@@ -1321,6 +1321,7 @@ _httpSetDigestAuthString(
                digest[1024];           /* Digest auth data */
   unsigned char        hash[32];               /* Hash buffer */
   size_t       hashsize;               /* Size of hash */
+  _cups_globals_t *cg = _cupsGlobals();        /* Per-thread globals */
 
 
   DEBUG_printf(("2_httpSetDigestAuthString(http=%p, nonce=\"%s\", method=\"%s\", resource=\"%s\")", (void *)http, nonce, method, resource));
@@ -1363,6 +1364,12 @@ _httpSetDigestAuthString(
       * RFC 2617 Digest with MD5
       */
 
+      if (cg->digestoptions == _CUPS_DIGESTOPTIONS_DENYMD5)
+      {
+       DEBUG_puts("3_httpSetDigestAuthString: MD5 Digest is disabled.");
+       return (0);
+      }
+
       hashalg = "md5";
     }
     else if (!_cups_strcasecmp(http->algorithm, "SHA-256"))