Blame SOURCES/cups-fips-restrict-md5.patch

b03539
diff --git a/cups/http-support.c b/cups/http-support.c
b03539
index a4bc079..9ee2309 100644
b03539
--- a/cups/http-support.c
b03539
+++ b/cups/http-support.c
b03539
@@ -1430,6 +1430,12 @@ _httpSetDigestAuthString(
b03539
     * Use old RFC 2069 Digest method...
b03539
     */
b03539
 
b03539
+    if (cg->digestoptions == _CUPS_DIGESTOPTIONS_DENYMD5)
b03539
+    {
b03539
+      DEBUG_puts("3_httpSetDigestAuthString: MD5 Digest is disabled.");
b03539
+      return (0);
b03539
+    }
b03539
+
b03539
     /* H(A1) = H(username:realm:password) */
b03539
     snprintf(temp, sizeof(temp), "%s:%s:%s", username, http->realm, password);
b03539
     hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
b03539
diff --git a/cups/md5passwd.c b/cups/md5passwd.c
b03539
index 9af5de2..5c9a64e 100644
b03539
--- a/cups/md5passwd.c
b03539
+++ b/cups/md5passwd.c
b03539
@@ -19,6 +19,9 @@
b03539
 /*
b03539
  * 'httpMD5()' - Compute the MD5 sum of the username:group:password.
b03539
  *
b03539
+ * The function was used for HTTP Digest authentication. Since CUPS 2.4.0
b03539
+ * it produces an empty string. Please use @link cupsDoAuthentication@ instead.
b03539
+ *
b03539
  * @deprecated@
b03539
  */
b03539
 
b03539
@@ -28,22 +31,13 @@ httpMD5(const char *username,		/* I - User name */
b03539
         const char *passwd,		/* I - Password string */
b03539
 	char       md5[33])		/* O - MD5 string */
b03539
 {
b03539
-  unsigned char		sum[16];	/* Sum data */
b03539
-  char			line[256];	/* Line to sum */
b03539
-
b03539
-
b03539
- /*
b03539
-  * Compute the MD5 sum of the user name, group name, and password.
b03539
-  */
b03539
+  (void)username;
b03539
+  (void)realm;
b03539
+  (void)passwd;
b03539
 
b03539
-  snprintf(line, sizeof(line), "%s:%s:%s", username, realm, passwd);
b03539
-  cupsHashData("md5", (unsigned char *)line, strlen(line), sum, sizeof(sum));
b03539
+  md5[0] = '\0';
b03539
 
b03539
- /*
b03539
-  * Return the sum...
b03539
-  */
b03539
-
b03539
-  return ((char *)cupsHashString(sum, sizeof(sum), md5, 33));
b03539
+  return (NULL);
b03539
 }
b03539
 
b03539
 
b03539
@@ -52,6 +46,9 @@ httpMD5(const char *username,		/* I - User name */
b03539
  *                    with the server-supplied nonce value, method, and
b03539
  *                    request-uri.
b03539
  *
b03539
+ * The function was used for HTTP Digest authentication. Since CUPS 2.4.0
b03539
+ * it produces an empty string. Please use @link cupsDoAuthentication@ instead.
b03539
+ *
b03539
  * @deprecated@
b03539
  */
b03539
 
b03539
@@ -61,35 +58,22 @@ httpMD5Final(const char *nonce,		/* I - Server nonce value */
b03539
 	     const char *resource,	/* I - Resource path */
b03539
              char       md5[33])	/* IO - MD5 sum */
b03539
 {
b03539
-  unsigned char		sum[16];	/* Sum data */
b03539
-  char			line[1024];	/* Line of data */
b03539
-  char			a2[33];		/* Hash of method and resource */
b03539
-
b03539
+  (void)nonce;
b03539
+  (void)method;
b03539
+  (void)resource;
b03539
 
b03539
- /*
b03539
-  * First compute the MD5 sum of the method and resource...
b03539
-  */
b03539
+  md5[0] = '\0';
b03539
 
b03539
-  snprintf(line, sizeof(line), "%s:%s", method, resource);
b03539
-  cupsHashData("md5", (unsigned char *)line, strlen(line), sum, sizeof(sum));
b03539
-  cupsHashString(sum, sizeof(sum), a2, sizeof(a2));
b03539
-
b03539
- /*
b03539
-  * Then combine A1 (MD5 of username, realm, and password) with the nonce
b03539
-  * and A2 (method + resource) values to get the final MD5 sum for the
b03539
-  * request...
b03539
-  */
b03539
-
b03539
-  snprintf(line, sizeof(line), "%s:%s:%s", md5, nonce, a2);
b03539
-  cupsHashData("md5", (unsigned char *)line, strlen(line), sum, sizeof(sum));
b03539
-
b03539
-  return ((char *)cupsHashString(sum, sizeof(sum), md5, 33));
b03539
+  return (NULL);
b03539
 }
b03539
 
b03539
 
b03539
 /*
b03539
  * 'httpMD5String()' - Convert an MD5 sum to a character string.
b03539
  *
b03539
+ * The function was used for HTTP Digest authentication. Since CUPS 2.4.0
b03539
+ * it produces an empty string. Please use @link cupsDoAuthentication@ instead.
b03539
+ *
b03539
  * @deprecated@
b03539
  */
b03539
 
b03539
@@ -98,5 +82,9 @@ httpMD5String(const unsigned char *sum,	/* I - MD5 sum data */
b03539
               char                md5[33])
b03539
 					/* O - MD5 sum in hex */
b03539
 {
b03539
-  return ((char *)cupsHashString(sum, 16, md5, 33));
b03539
+  (void)sum;
b03539
+
b03539
+  md5[0] = '\0';
b03539
+
b03539
+  return (NULL);
b03539
 }