summaryrefslogtreecommitdiff
path: root/cups/http-support.c
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2019-10-15 17:34:21 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2019-10-15 17:34:21 -0400
commitec8beb8952388a3ce650cc1477cd386546ed7318 (patch)
treed0e46ac82a57ee6890f80ba74b7fd705abb8e4ad /cups/http-support.c
parent4c793ee9ce18bf6315de14fea3ccb9d2a66c76b2 (diff)
downloadcups-ec8beb8952388a3ce650cc1477cd386546ed7318.tar.gz
Add support for DigestOptions directive in client.conf (Issue #5647)
Diffstat (limited to 'cups/http-support.c')
-rw-r--r--cups/http-support.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cups/http-support.c b/cups/http-support.c
index 6d8607140..824b8dcf1 100644
--- a/cups/http-support.c
+++ b/cups/http-support.c
@@ -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"))