]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Added SIGN-ALL, CTYPE-ALL, COMP-ALL, and VERS-TLS-ALL priority strings.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 16 Nov 2010 14:17:43 +0000 (15:17 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 16 Nov 2010 14:18:46 +0000 (15:18 +0100)
NEWS
lib/gnutls_priority.c

diff --git a/NEWS b/NEWS
index 65e721eee1fac62716c8b18bdabba8a0fc082d8c..e444fc3525f011885294356cf405da5c093a8cd5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,10 @@ See the end for copying conditions.
 
 * Version 2.11.5 (unreleased)
 
+** libgnutls: Added Added SIGN-ALL, CTYPE-ALL, COMP-ALL, and VERS-TLS-ALL
+as priority strings. Those allow to set all the supported algorithms
+at once.
+
 ** p11tool: Introduced. It allows manipulating pkcs 11 tokens.
 
 ** gnutls-cli: Print channel binding only in verbose mode.
index d7c6831ac5a0530a4306677078c448bb506c108a..5d6e4947ab07dcd0b330c0da9a33946be03e89c3 100644 (file)
@@ -552,7 +552,9 @@ gnutls_priority_set (gnutls_session_t session, gnutls_priority_t priority)
  * To avoid collisions in order to specify a compression algorithm in
  * this string you have to prefix it with "COMP-", protocol versions
  * with "VERS-", signature algorithms with "SIGN-" and certificate types with "CTYPE-". All other
- * algorithms don't need a prefix.
+ * algorithms don't need a prefix. The keywords "SIGN-ALL", "CTYPE-ALL", "COMP-ALL",
+ * and "VERS-TLS-ALL"  can be used to add all the support signature types, certificate
+ * types, compression methods and supported TLS version numbers.
  *
  * Examples:
  * "NORMAL:!AES-128-CBC" means normal ciphers except for AES-128.
@@ -560,7 +562,7 @@ gnutls_priority_set (gnutls_session_t session, gnutls_priority_t priority)
  * "EXPORT:!VERS-TLS1.0:+COMP-DEFLATE" means that export ciphers are
  * enabled, TLS 1.0 is disabled, and libz compression enabled.
  *
- * "NONE:+VERS-TLS1.0:+AES-128-CBC:+RSA:+SHA1:+COMP-NULL:+SIGN-RSA-SHA1", "NORMAL",
+ * "NONE:+VERS-TLS-ALL:+AES-128-CBC:+RSA:+SHA1:+COMP-NULL:+SIGN-RSA-SHA1", "NORMAL",
  * "%COMPAT".
  *
  * Returns: On syntax error %GNUTLS_E_INVALID_REQUEST is returned,
@@ -680,39 +682,67 @@ gnutls_priority_init (gnutls_priority_t * priority_cache,
            fn (&(*priority_cache)->kx, algo);
          else if (strncasecmp (&broken_list[i][1], "VERS-", 5) == 0)
            {
-             if ((algo =
-                  gnutls_protocol_get_id (&broken_list[i][6])) !=
-                 GNUTLS_VERSION_UNKNOWN)
-               fn (&(*priority_cache)->protocol, algo);
-             else
-               goto error;
+             if (strncasecmp (&broken_list[i][1], "VERS-TLS-ALL", 12) == 0)
+               {
+                 _set_priority (&(*priority_cache)->protocol, protocol_priority);
+               }
+             else 
+               {
+                 if ((algo =
+                      gnutls_protocol_get_id (&broken_list[i][6])) !=
+                     GNUTLS_VERSION_UNKNOWN)
+                    fn (&(*priority_cache)->protocol, algo);
+                  else
+                   goto error;
+                }
            }                   /* now check if the element is something like -ALGO */
          else if (strncasecmp (&broken_list[i][1], "COMP-", 5) == 0)
            {
-             if ((algo =
-                  gnutls_compression_get_id (&broken_list[i][6])) !=
-                 GNUTLS_COMP_UNKNOWN)
-               fn (&(*priority_cache)->compression, algo);
-             else
-               goto error;
+             if (strncasecmp (&broken_list[i][1], "COMP-ALL", 8) == 0)
+               {
+                 _set_priority (&(*priority_cache)->compression, comp_priority);
+               }
+             else 
+               {
+                 if ((algo =
+                      gnutls_compression_get_id (&broken_list[i][6])) !=
+                      GNUTLS_COMP_UNKNOWN)
+                    fn (&(*priority_cache)->compression, algo);
+                  else
+                    goto error;
+                }
            }                   /* now check if the element is something like -ALGO */
          else if (strncasecmp (&broken_list[i][1], "CTYPE-", 6) == 0)
            {
-             if ((algo =
-                  gnutls_certificate_type_get_id (&broken_list[i][7])) !=
-                 GNUTLS_CRT_UNKNOWN)
-               fn (&(*priority_cache)->cert_type, algo);
-             else
-               goto error;
+             if (strncasecmp (&broken_list[i][1], "CTYPE-ALL", 9) == 0)
+               {
+                 _set_priority (&(*priority_cache)->cert_type, cert_type_priority);
+               }
+             else 
+               {
+                 if ((algo =
+                      gnutls_certificate_type_get_id (&broken_list[i][7])) !=
+                      GNUTLS_CRT_UNKNOWN)
+                    fn (&(*priority_cache)->cert_type, algo);
+                  else
+                    goto error;
+                }
            }                   /* now check if the element is something like -ALGO */
          else if (strncasecmp (&broken_list[i][1], "SIGN-", 5) == 0)
            {
-             if ((algo =
-                  gnutls_sign_get_id (&broken_list[i][6])) !=
-                 GNUTLS_SIGN_UNKNOWN)
-               fn (&(*priority_cache)->sign_algo, algo);
-             else
-               goto error;
+             if (strncasecmp (&broken_list[i][1], "SIGN-ALL", 8) == 0)
+               {
+                 _set_priority (&(*priority_cache)->sign_algo, sign_priority_default);
+               }
+             else 
+               {
+                 if ((algo =
+                      gnutls_sign_get_id (&broken_list[i][6])) !=
+                      GNUTLS_SIGN_UNKNOWN)
+                   fn (&(*priority_cache)->sign_algo, algo);
+                  else
+                    goto error;
+                }
            }                   /* now check if the element is something like -ALGO */
          else
            goto error;