Blame SOURCES/cups-str4476.patch

87cf9a
diff -up cups-1.6.3/cups/http.c.str4476 cups-1.6.3/cups/http.c
87cf9a
--- cups-1.6.3/cups/http.c.str4476	2013-06-07 02:12:52.000000000 +0100
87cf9a
+++ cups-1.6.3/cups/http.c	2015-06-23 14:05:39.872805417 +0100
87cf9a
@@ -175,6 +175,8 @@ static int		http_write_ssl(http_t *http,
87cf9a
  * Local globals...
87cf9a
  */
87cf9a
 
87cf9a
+static int		tls_options = 0; /* Options for TLS connections */
87cf9a
+
87cf9a
 static const char * const http_fields[] =
87cf9a
 			{
87cf9a
 			  "Accept-Language",
87cf9a
@@ -3722,7 +3724,10 @@ http_send(http_t       *http,	/* I - Con
87cf9a
   if (http->encryption == HTTP_ENCRYPT_REQUIRED && !http->tls)
87cf9a
   {
87cf9a
     httpSetField(http, HTTP_FIELD_CONNECTION, "Upgrade");
87cf9a
-    httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.0,SSL/2.0,SSL/3.0");
87cf9a
+    if (tls_options & _HTTP_TLS_ALLOW_SSL3)
87cf9a
+      httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.1,TLS/1.0,SSL/3.0");
87cf9a
+    else
87cf9a
+      httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.1,TLS/1.0");
87cf9a
   }
87cf9a
 #endif /* HAVE_SSL */
87cf9a
 
87cf9a
@@ -3959,6 +3964,10 @@ http_setup_ssl(http_t *http)		/* I - Con
87cf9a
   context = SSL_CTX_new(SSLv23_client_method());
87cf9a
 
87cf9a
   SSL_CTX_set_options(context, SSL_OP_NO_SSLv2); /* Only use SSLv3 or TLS */
87cf9a
+  if (!(tls_options & _HTTP_TLS_ALLOW_SSL3))
87cf9a
+    SSL_CTX_set_options(context, SSL_OP_NO_SSLv3); /* Don't use SSLv3 */
87cf9a
+  if (!(tls_options & _HTTP_TLS_ALLOW_RC4))
87cf9a
+    SSL_CTX_set_cipher_list(context, "DEFAULT:-RC4");
87cf9a
 
87cf9a
   bio = BIO_new(_httpBIOMethods());
87cf9a
   BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)http);
87cf9a
@@ -4018,7 +4027,16 @@ http_setup_ssl(http_t *http)		/* I - Con
87cf9a
   gnutls_certificate_allocate_credentials(credentials);
87cf9a
 
87cf9a
   gnutls_init(&http->tls, GNUTLS_CLIENT);
87cf9a
-  gnutls_set_default_priority(http->tls);
87cf9a
+  if (!tls_options)
87cf9a
+    gnutls_priority_set_direct(http->tls, "NORMAL:-ARCFOUR-128:-VERS-SSL3.0", NULL);
87cf9a
+  else if ((tls_options & _HTTP_TLS_ALLOW_SSL3) &&
87cf9a
+	   (tls_options & _HTTP_TLS_ALLOW_RC4))
87cf9a
+    gnutls_priority_set_direct(http->tls, "NORMAL", NULL);
87cf9a
+  else if (tls_options & _HTTP_TLS_ALLOW_SSL3)
87cf9a
+    gnutls_priority_set_direct(http->tls, "NORMAL:-ARCFOUR-128", NULL);
87cf9a
+  else
87cf9a
+    gnutls_priority_set_direct(http->tls, "NORMAL:-VERS-SSL3.0", NULL);
87cf9a
+
87cf9a
   gnutls_server_name_set(http->tls, GNUTLS_NAME_DNS, hostname,
87cf9a
                          strlen(hostname));
87cf9a
   gnutls_credentials_set(http->tls, GNUTLS_CRD_CERTIFICATE, *credentials);
87cf9a
@@ -4433,7 +4451,10 @@ http_upgrade(http_t *http)		/* I - Conne
87cf9a
 
87cf9a
   httpClearFields(http);
87cf9a
   httpSetField(http, HTTP_FIELD_CONNECTION, "upgrade");
87cf9a
-  httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.2, TLS/1.1, TLS/1.0, SSL/3.0");
87cf9a
+  if (tls_options & _HTTP_TLS_ALLOW_SSL3)
87cf9a
+    httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.2, TLS/1.1, TLS/1.0, SSL/3.0");
87cf9a
+  else
87cf9a
+    httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.2, TLS/1.1, TLS/1.0");
87cf9a
 
87cf9a
   if ((ret = httpOptions(http, "*")) == 0)
87cf9a
   {
87cf9a
@@ -4764,6 +4785,16 @@ http_write_ssl(http_t     *http,	/* I -
87cf9a
 }
87cf9a
 #endif /* HAVE_SSL */
87cf9a
 
87cf9a
+/*
87cf9a
+ * '_httpTLSSetOptions()' - Set TLS/SSL options.
87cf9a
+ */
87cf9a
+
87cf9a
+void
87cf9a
+_httpTLSSetOptions(int options)
87cf9a
+{
87cf9a
+  tls_options = options;
87cf9a
+}
87cf9a
+
87cf9a
 
87cf9a
 /*
87cf9a
  * End of "$Id: http.c 7850 2008-08-20 00:07:25Z mike $".
87cf9a
diff -up cups-1.6.3/cups/http-private.h.str4476 cups-1.6.3/cups/http-private.h
87cf9a
--- cups-1.6.3/cups/http-private.h.str4476	2015-06-23 14:04:45.244230171 +0100
87cf9a
+++ cups-1.6.3/cups/http-private.h	2015-06-23 14:05:39.873805409 +0100
87cf9a
@@ -140,6 +140,10 @@ extern "C" {
87cf9a
 #define _HTTP_RESOLVE_FQDN	2	/* Resolve to a FQDN */
87cf9a
 #define _HTTP_RESOLVE_FAXOUT	4	/* Resolve FaxOut service? */
87cf9a
 
87cf9a
+/* care - these should be the same values as the CUPSD_SSL_* equivalents */
87cf9a
+#define _HTTP_TLS_ALLOW_RC4	2
87cf9a
+#define _HTTP_TLS_ALLOW_SSL3	4
87cf9a
+
87cf9a
 
87cf9a
 /*
87cf9a
  * Types and functions for SSL support...
87cf9a
@@ -377,6 +381,8 @@ extern const char	*_httpResolveURI(const
87cf9a
 extern int		_httpUpdate(http_t *http, http_status_t *status);
87cf9a
 extern int		_httpWait(http_t *http, int msec, int usessl);
87cf9a
 
87cf9a
+extern void		_httpTLSSetOptions(int options);
87cf9a
+
87cf9a
 
87cf9a
 /*
87cf9a
  * C++ magic...
87cf9a
diff -up cups-1.6.3/cups/usersys.c.str4476 cups-1.6.3/cups/usersys.c
87cf9a
--- cups-1.6.3/cups/usersys.c.str4476	2015-06-23 14:04:45.268229986 +0100
87cf9a
+++ cups-1.6.3/cups/usersys.c	2015-06-23 14:05:39.873805409 +0100
87cf9a
@@ -72,7 +72,8 @@ static void	cups_read_client_conf(cups_f
87cf9a
 #endif /* HAVE_GSSAPI */
87cf9a
 				      const char *cups_anyroot,
87cf9a
 				      const char *cups_expiredroot,
87cf9a
-				      const char *cups_expiredcerts);
87cf9a
+				      const char *cups_expiredcerts,
87cf9a
+				      int ssl_options);
87cf9a
 
87cf9a
 
87cf9a
 /*
87cf9a
@@ -257,6 +258,9 @@ cupsSetEncryption(http_encryption_t e)	/
87cf9a
   _cups_globals_t *cg = _cupsGlobals();	/* Pointer to library globals */
87cf9a
 
87cf9a
 
87cf9a
+  if (cg->encryption == (http_encryption_t)-1)
87cf9a
+    _cupsSetDefaults();
87cf9a
+
87cf9a
   cg->encryption = e;
87cf9a
 
87cf9a
   if (cg->http)
87cf9a
@@ -823,7 +827,36 @@ _cupsSetDefaults(void)
87cf9a
   if (cg->encryption == (http_encryption_t)-1 || !cg->server[0] ||
87cf9a
       !cg->user[0] || !cg->ipp_port)
87cf9a
   {
87cf9a
+   /*
87cf9a
+    * Look for CUPS_SERVERROOT/client.conf...
87cf9a
+    */
87cf9a
+
87cf9a
+    snprintf(filename, sizeof(filename), "%s/client.conf",
87cf9a
+	     cg->cups_serverroot);
87cf9a
+    fp = cupsFileOpen(filename, "r");
87cf9a
+
87cf9a
+   /*
87cf9a
+    * Read the configuration file and apply any environment variables; both
87cf9a
+    * functions handle NULL cups_file_t pointers...
87cf9a
+    */
87cf9a
+
87cf9a
+    cups_read_client_conf(fp, cg, cups_encryption, cups_server, cups_user,
87cf9a
+#ifdef HAVE_GSSAPI
87cf9a
+			  cups_gssservicename,
87cf9a
+#endif /* HAVE_GSSAPI */
87cf9a
+			  cups_anyroot, cups_expiredroot,
87cf9a
+			  cups_expiredcerts, 1);
87cf9a
+
87cf9a
+   /*
87cf9a
+    * Then user defaults, if it is safe to do so...
87cf9a
+    */
87cf9a
+
87cf9a
+#ifdef HAVE_GETEUID
87cf9a
+    if ((geteuid() == getuid() || !getuid()) && getegid() == getgid() &&
87cf9a
+	(home = getenv("HOME")) != NULL)
87cf9a
+#else
87cf9a
     if ((home = getenv("HOME")) != NULL)
87cf9a
+#endif
87cf9a
     {
87cf9a
      /*
87cf9a
       * Look for ~/.cups/client.conf...
87cf9a
@@ -831,33 +864,20 @@ _cupsSetDefaults(void)
87cf9a
 
87cf9a
       snprintf(filename, sizeof(filename), "%s/.cups/client.conf", home);
87cf9a
       fp = cupsFileOpen(filename, "r");
87cf9a
-    }
87cf9a
-    else
87cf9a
-      fp = NULL;
87cf9a
 
87cf9a
-    if (!fp)
87cf9a
-    {
87cf9a
      /*
87cf9a
-      * Look for CUPS_SERVERROOT/client.conf...
87cf9a
+      * Read the configuration file and apply any environment variables; both
87cf9a
+      * functions handle NULL cups_file_t pointers...
87cf9a
       */
87cf9a
 
87cf9a
-      snprintf(filename, sizeof(filename), "%s/client.conf",
87cf9a
-               cg->cups_serverroot);
87cf9a
-      fp = cupsFileOpen(filename, "r");
87cf9a
-    }
87cf9a
-
87cf9a
-   /*
87cf9a
-    * Read the configuration file and apply any environment variables; both
87cf9a
-    * functions handle NULL cups_file_t pointers...
87cf9a
-    */
87cf9a
-
87cf9a
-    cups_read_client_conf(fp, cg, cups_encryption, cups_server, cups_user,
87cf9a
+      cups_read_client_conf(fp, cg, cups_encryption, cups_server, cups_user,
87cf9a
 #ifdef HAVE_GSSAPI
87cf9a
-			  cups_gssservicename,
87cf9a
+			    cups_gssservicename,
87cf9a
 #endif /* HAVE_GSSAPI */
87cf9a
-			  cups_anyroot, cups_expiredroot,
87cf9a
-			  cups_expiredcerts);
87cf9a
-    cupsFileClose(fp);
87cf9a
+			    cups_anyroot, cups_expiredroot,
87cf9a
+			    cups_expiredcerts, 0);
87cf9a
+      cupsFileClose(fp);
87cf9a
+    }
87cf9a
   }
87cf9a
 }
87cf9a
 
87cf9a
@@ -879,7 +899,8 @@ cups_read_client_conf(
87cf9a
 #endif /* HAVE_GSSAPI */
87cf9a
     const char	    *cups_anyroot,	/* I - CUPS_ANYROOT env var */
87cf9a
     const char	    *cups_expiredroot,	/* I - CUPS_EXPIREDROOT env var */
87cf9a
-    const char	    *cups_expiredcerts)	/* I - CUPS_EXPIREDCERTS env var */
87cf9a
+    const char	    *cups_expiredcerts,	/* I - CUPS_EXPIREDCERTS env var */
87cf9a
+    int		     ssl_options)	/* I - Allow setting of SSLOptions? */
87cf9a
 {
87cf9a
   int	linenum;			/* Current line number */
87cf9a
   char	line[1024],			/* Line from file */
87cf9a
@@ -952,6 +973,43 @@ cups_read_client_conf(
87cf9a
       cups_gssservicename = gss_service_name;
87cf9a
     }
87cf9a
 #endif /* HAVE_GSSAPI */
87cf9a
+    else if (ssl_options && !_cups_strcasecmp(line, "SSLOptions") && value)
87cf9a
+    {
87cf9a
+     /*
87cf9a
+      * SSLOptions [AllowRC4] [AllowSSL3] [None]
87cf9a
+      */
87cf9a
+
87cf9a
+      int	options = 0;		/* SSL/TLS options */
87cf9a
+      char	*start,			/* Start of option */
87cf9a
+		*end;			/* End of option */
87cf9a
+
87cf9a
+      for (start = value; *start; start = end)
87cf9a
+      {
87cf9a
+       /*
87cf9a
+	* Find end of keyword...
87cf9a
+	*/
87cf9a
+
87cf9a
+	end = start;
87cf9a
+	while (*end && !_cups_isspace(*end))
87cf9a
+	  end++;
87cf9a
+
87cf9a
+	if (*end)
87cf9a
+	  *end++ = '\0';
87cf9a
+
87cf9a
+       /*
87cf9a
+	* Compare...
87cf9a
+	*/
87cf9a
+
87cf9a
+	if (!_cups_strcasecmp(start, "AllowRC4"))
87cf9a
+	  options |= _HTTP_TLS_ALLOW_RC4;
87cf9a
+	else if (!_cups_strcasecmp(start, "AllowSSL3"))
87cf9a
+	  options |= _HTTP_TLS_ALLOW_SSL3;
87cf9a
+	else if (!_cups_strcasecmp(start, "None"))
87cf9a
+	  options = 0;
87cf9a
+      }
87cf9a
+
87cf9a
+      _httpTLSSetOptions(options);
87cf9a
+    }
87cf9a
   }
87cf9a
 
87cf9a
  /*
87cf9a
diff -up cups-1.6.3/doc/help/ref-client-conf.html.str4476 cups-1.6.3/doc/help/ref-client-conf.html
87cf9a
--- cups-1.6.3/doc/help/ref-client-conf.html.str4476	2013-06-25 15:38:12.000000000 +0100
87cf9a
+++ cups-1.6.3/doc/help/ref-client-conf.html	2015-06-23 14:05:39.873805409 +0100
87cf9a
@@ -76,6 +76,26 @@ present, only the last one is used. This
87cf9a
 
87cf9a
 
87cf9a
 
87cf9a
+

SSLOptions

87cf9a
+
87cf9a
+

Examples

87cf9a
+
87cf9a
+
87cf9a
+SSLOptions None
87cf9a
+SSLOptions AllowSSL3
87cf9a
+SSLOptions AllowRC4
87cf9a
+
87cf9a
+
87cf9a
+

Description

87cf9a
+
87cf9a
+

Sets encryption options (only in /etc/cups/client.conf). By

87cf9a
+default, CUPS only supports encryption using TLS v1.0 or higher using
87cf9a
+known secure cipher suites. The AllowRC4 option enables the
87cf9a
+128-bit RC4 cipher suites, which are required for some older clients
87cf9a
+that do not implement newer ones. The AllowSSL3 option enables
87cf9a
+SSL v3.0, which is required for some older clients that do not support
87cf9a
+TLS v1.0.

87cf9a
+
87cf9a
 

CUPS 1.6/OS X 10.8User

87cf9a
 
87cf9a
 

Examples

87cf9a
diff -up cups-1.6.3/doc/help/ref-cupsd-conf.html.in.str4476 cups-1.6.3/doc/help/ref-cupsd-conf.html.in
87cf9a
--- cups-1.6.3/doc/help/ref-cupsd-conf.html.in.str4476	2013-05-10 17:52:10.000000000 +0100
87cf9a
+++ cups-1.6.3/doc/help/ref-cupsd-conf.html.in	2015-06-23 14:05:39.873805409 +0100
87cf9a
@@ -2011,23 +2011,23 @@ SetEnv MY_ENV_VAR foo
87cf9a
 variable that should be passed to child processes.

87cf9a
 
87cf9a
 
87cf9a
-

SSLListen

87cf9a
+

SSLOptions

87cf9a
 
87cf9a
 

Examples

87cf9a
 
87cf9a
 
87cf9a
-SSLListen 127.0.0.1:443
87cf9a
-SSLListen 192.0.2.1:443
87cf9a
+SSLOptions 127.0.0.1:443
87cf9a
+SSLOptions 192.0.2.1:443
87cf9a
 
87cf9a
 
87cf9a
 

Description

87cf9a
 
87cf9a
-

The SSLListen directive specifies a network

87cf9a
+

The SSLOptions directive specifies a network

87cf9a
 address and port to listen for secure connections. Multiple
87cf9a
-SSLListen directives can be provided to listen on
87cf9a
+SSLOptions directives can be provided to listen on
87cf9a
 multiple addresses.

87cf9a
 
87cf9a
-

The SSLListen directive is similar to the

87cf9a
+

The SSLOptions directive is similar to the

87cf9a
 HREF="#SSLPort">SSLPort directive but allows you
87cf9a
 to restrict access to specific interfaces or networks.

87cf9a
 
87cf9a
@@ -2039,15 +2039,22 @@ to restrict access to specific interface
87cf9a
 
87cf9a
 SSLOptions None
87cf9a
 SSLOptions NoEmptyFragments
87cf9a
+SSLOptions AllowSSL3
87cf9a
+SSLOptions AllowRC4
87cf9a
 
87cf9a
 
87cf9a
 

Description

87cf9a
 
87cf9a
 

The SSLOptions directive specifies additional SSL/TLS

87cf9a
-protocol options to use for encrypted connected. Currently only two
87cf9a
-options are supported - None (the default) for the most
87cf9a
-secure mode and NoEmptyFragments to allow CUPS to work with
87cf9a
-Microsoft Windows with the FIPS conformance mode enabled.

87cf9a
+protocol options to use for encrypted connected. By default, CUPS only
87cf9a
+supports encryption using TLS v1.0 or higher using known secure cipher
87cf9a
+suites. The NoEmptyFragments option allows CUPS to work
87cf9a
+with Microsoft Windows with the FIPS conformance mode
87cf9a
+enabled. The AllowRC4 option enables the 128-bit RC4
87cf9a
+cipher suites, which are required for some older clients that do not
87cf9a
+implement newer ones. The AllowSSL3 option enables SSL
87cf9a
+v3.0, which is required for some older clients that do not support TLS
87cf9a
+v1.0.

87cf9a
 
87cf9a
 
87cf9a
 

SSLPort

87cf9a
diff -up cups-1.6.3/man/client.conf.man.in.str4476 cups-1.6.3/man/client.conf.man.in
87cf9a
--- cups-1.6.3/man/client.conf.man.in.str4476	2013-06-25 15:38:12.000000000 +0100
87cf9a
+++ cups-1.6.3/man/client.conf.man.in	2015-06-23 14:05:39.874805401 +0100
87cf9a
@@ -53,6 +53,15 @@ Specifies the address and optionally the
87cf9a
 server running CUPS 1.3.12 and earlier. \fBNote: Not supported on OS X 10.7 or
87cf9a
 later.\fR
87cf9a
 .TP 5
87cf9a
+SSLOptions \fR[\fIAllowRC4\fR] [\fIAllow SSL3\fR]
87cf9a
+.br
87cf9a
+Sets SSL/TLS protocol options for encrypted connections. By default,
87cf9a
+CUPS only supports encryption using TLS v1.0 or higher using known
87cf9a
+secure cipher suites. The \fIAllowRC4\fR option enables the 128-bit
87cf9a
+RC4 cipher suites, which are required for some older clients that do
87cf9a
+not implement newer ones. The \fIAllowSSL3\fR option enables SSL v3.0,
87cf9a
+which is required for some older clients that do not support TLS v1.0.
87cf9a
+.TP 5
87cf9a
 User name
87cf9a
 .br
87cf9a
 Specifies the default user name to use for requests.
87cf9a
diff -up cups-1.6.3/man/cupsd.conf.man.in.str4476 cups-1.6.3/man/cupsd.conf.man.in
87cf9a
--- cups-1.6.3/man/cupsd.conf.man.in.str4476	2015-06-23 14:04:45.278229909 +0100
87cf9a
+++ cups-1.6.3/man/cupsd.conf.man.in	2015-06-23 14:05:39.874805401 +0100
87cf9a
@@ -480,9 +480,16 @@ Listens on the specified address and por
87cf9a
 .TP 5
87cf9a
 SSLOptions None
87cf9a
 .TP 5
87cf9a
-SSLOptions NoEmptyFragments
87cf9a
+SSLOptions \fR[\fINoEmptyFragments\fR] [\fIAllowRC4\fR] [\fIAllow SSL3\fR]
87cf9a
 .br
87cf9a
-Sets SSL/TLS protocol options for encrypted connections.
87cf9a
+Sets SSL/TLS protocol options for encrypted connections. By default,
87cf9a
+CUPS only supports encryption using TLS v1.0 or higher using known
87cf9a
+secure cipher suites. The \fINoEmptyFragments\fR option allows CUPS to
87cf9a
+work with Microsoft Windows with the FIPS conformance mode
87cf9a
+enabled. The \fIAllowRC4\fR option enables the 128-bit RC4 cipher
87cf9a
+suites, which are required for some older clients that do not
87cf9a
+implement newer ones. The \fIAllowSSL3\fR option enables SSL v3.0,
87cf9a
+which is required for some older clients that do not support TLS v1.0.
87cf9a
 .TP 5
87cf9a
 SSLPort
87cf9a
 .br
87cf9a
diff -up cups-1.6.3/scheduler/conf.c.str4476 cups-1.6.3/scheduler/conf.c
87cf9a
--- cups-1.6.3/scheduler/conf.c.str4476	2015-06-23 14:04:45.298229754 +0100
87cf9a
+++ cups-1.6.3/scheduler/conf.c	2015-06-23 14:05:39.874805401 +0100
87cf9a
@@ -3361,17 +3361,54 @@ read_cupsd_conf(cups_file_t *fp)	/* I -
87cf9a
     else if (!_cups_strcasecmp(line, "SSLOptions"))
87cf9a
     {
87cf9a
      /*
87cf9a
+      * SSLOptions [AllowRC4] [AllowSSL3] [NoEmptyFragments] [None]
87cf9a
+      */
87cf9a
+
87cf9a
+      int	options = 0;	/* SSL/TLS options */
87cf9a
+
87cf9a
+     /*
87cf9a
       * SSLOptions options
87cf9a
       */
87cf9a
 
87cf9a
-      if (!value || !_cups_strcasecmp(value, "none"))
87cf9a
-        SSLOptions = CUPSD_SSL_NONE;
87cf9a
-      else if (!_cups_strcasecmp(value, "noemptyfragments"))
87cf9a
-        SSLOptions = CUPSD_SSL_NOEMPTY;
87cf9a
-      else
87cf9a
-        cupsdLogMessage(CUPSD_LOG_ERROR,
87cf9a
-	                "Unknown value \"%s\" for SSLOptions directive on "
87cf9a
-			"line %d.", value, linenum);
87cf9a
+      if (value)
87cf9a
+      {
87cf9a
+	char	*start,		/* Start of option */
87cf9a
+		*end;		/* End of option */
87cf9a
+
87cf9a
+	for (start = value; *start; start = end)
87cf9a
+	{
87cf9a
+	 /*
87cf9a
+	  * Find end of keyword...
87cf9a
+	  */
87cf9a
+
87cf9a
+	  end = start;
87cf9a
+	  while (*end && !_cups_isspace(*end))
87cf9a
+	    end++;
87cf9a
+
87cf9a
+	  if (*end)
87cf9a
+	    *end++ = '\0';
87cf9a
+
87cf9a
+	 /*
87cf9a
+	  * Compare...
87cf9a
+	  */
87cf9a
+
87cf9a
+	  if (!_cups_strcasecmp(start, "NoEmptyFragments"))
87cf9a
+	    options |= CUPSD_SSL_NOEMPTY;
87cf9a
+	  else if (!_cups_strcasecmp(start, "AllowRC4"))
87cf9a
+	    options |= CUPSD_SSL_ALLOW_RC4;
87cf9a
+	  else if (!_cups_strcasecmp(start, "AllowSSL3"))
87cf9a
+	    options |= CUPSD_SSL_ALLOW_SSL3;
87cf9a
+	  else if (!_cups_strcasecmp(start, "None"))
87cf9a
+	    options = 0;
87cf9a
+	  else
87cf9a
+	    cupsdLogMessage(CUPSD_LOG_ERROR,
87cf9a
+			    "Unknown value \"%s\" for SSLOptions directive on "
87cf9a
+			    "line %d.", start, linenum);
87cf9a
+	}
87cf9a
+      }
87cf9a
+
87cf9a
+      SSLOptions = options;
87cf9a
+      _httpTLSSetOptions (SSLOptions & ~CUPSD_SSL_NOEMPTY);
87cf9a
     }
87cf9a
 #endif /* HAVE_SSL */
87cf9a
     else if (!_cups_strcasecmp(line, "AccessLog") ||
87cf9a
diff -up cups-1.6.3/scheduler/conf.h.str4476 cups-1.6.3/scheduler/conf.h
87cf9a
--- cups-1.6.3/scheduler/conf.h.str4476	2015-06-23 14:04:45.298229754 +0100
87cf9a
+++ cups-1.6.3/scheduler/conf.h	2015-06-23 14:05:39.874805401 +0100
87cf9a
@@ -78,6 +78,8 @@ typedef enum
87cf9a
 
87cf9a
 #define CUPSD_SSL_NONE		0	/* No special options */
87cf9a
 #define CUPSD_SSL_NOEMPTY	1	/* Do not insert empty fragments */
87cf9a
+#define CUPSD_SSL_ALLOW_RC4	2	/* Allow RC4 cipher suites */
87cf9a
+#define CUPSD_SSL_ALLOW_SSL3	4	/* Allow SSL 3.0 */
87cf9a
 
87cf9a
 
87cf9a
 /*
87cf9a
diff -up cups-1.6.3/scheduler/tls-gnutls.c.str4476 cups-1.6.3/scheduler/tls-gnutls.c
87cf9a
--- cups-1.6.3/scheduler/tls-gnutls.c.str4476	2013-06-07 02:12:52.000000000 +0100
87cf9a
+++ cups-1.6.3/scheduler/tls-gnutls.c	2015-06-23 14:05:39.874805401 +0100
87cf9a
@@ -114,7 +114,15 @@ cupsdStartTLS(cupsd_client_t *con)	/* I
87cf9a
 				       ServerKey, GNUTLS_X509_FMT_PEM);
87cf9a
 
87cf9a
   gnutls_init(&con->http.tls, GNUTLS_SERVER);
87cf9a
-  gnutls_set_default_priority(con->http.tls);
87cf9a
+  if (!SSLOptions)
87cf9a
+    gnutls_priority_set_direct(con->http.tls, "NORMAL:-ARCFOUR-128:-VERS-SSL3.0", NULL);
87cf9a
+  else if ((SSLOptions & CUPSD_SSL_ALLOW_SSL3) &&
87cf9a
+	   (SSLOptions & CUPSD_SSL_ALLOW_RC4))
87cf9a
+    gnutls_priority_set_direct(con->http.tls, "NORMAL", NULL);
87cf9a
+  else if (SSLOptions & CUPSD_SSL_ALLOW_SSL3)
87cf9a
+    gnutls_priority_set_direct(con->http.tls, "NORMAL:-ARCFOUR-128", NULL);
87cf9a
+  else
87cf9a
+    gnutls_priority_set_direct(con->http.tls, "NORMAL:-VERS-SSL3.0", NULL);
87cf9a
 
87cf9a
   gnutls_credentials_set(con->http.tls, GNUTLS_CRD_CERTIFICATE, *credentials);
87cf9a
   gnutls_transport_set_ptr(con->http.tls, (gnutls_transport_ptr)HTTP(con));
87cf9a
diff -up cups-1.6.3/scheduler/tls-openssl.c.str4476 cups-1.6.3/scheduler/tls-openssl.c
87cf9a
--- cups-1.6.3/scheduler/tls-openssl.c.str4476	2013-06-07 02:12:52.000000000 +0100
87cf9a
+++ cups-1.6.3/scheduler/tls-openssl.c	2015-06-23 14:05:39.875805393 +0100
87cf9a
@@ -107,6 +107,10 @@ cupsdStartTLS(cupsd_client_t *con)	/* I
87cf9a
   SSL_CTX_set_options(context, SSL_OP_NO_SSLv2); /* Only use SSLv3 or TLS */
87cf9a
   if (SSLOptions & CUPSD_SSL_NOEMPTY)
87cf9a
     SSL_CTX_set_options(context, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
87cf9a
+  if (!(SSLOptions & CUPSD_SSL_ALLOW_SSL3))
87cf9a
+    SSL_CTX_set_options(context, SSL_OP_NO_SSLv3); /* Don't use SSLv3 */
87cf9a
+  if (!(SSLOptions & CUPSD_SSL_ALLOW_RC4))
87cf9a
+    SSL_CTX_set_cipher_list(context, "DEFAULT:-RC4");
87cf9a
   SSL_CTX_use_PrivateKey_file(context, ServerKey, SSL_FILETYPE_PEM);
87cf9a
   SSL_CTX_use_certificate_chain_file(context, ServerCertificate);
87cf9a