]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
added gnutls_check_priority() to check syntax of priority strings.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 18 Nov 2007 18:40:27 +0000 (20:40 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 18 Nov 2007 18:40:27 +0000 (20:40 +0200)
NEWS
doc/gnutls.texi
includes/gnutls/gnutls.h.in
lib/gnutls_priority.c
lib/gnutls_state.h

diff --git a/NEWS b/NEWS
index 8691b723bcb3d2a3bfd5dcdecb62eb02b03ed944..b48a74bcaf63ed2a8d1aa962aae430193292677f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,8 @@ the gnutls_set_priority().
 ** Internal copy of OpenCDK upgraded to version 0.6.6.
 
 ** API and ABI modifications:
+gnutls_check_priority: ADDED
+gnutls_set_priority: ADDED
 gnutls_set_default_priority2: RENAMED to gnutls_set_priority()
 gnutls_mac_convert_priority: REMOVED
 gnutls_compression_convert_priority: REMOVED
index d89c31baba5af891d90f3ba29106e5bf6ab56e3c..aeeecd8b8d76999789248ba8e185e552bc859161 100644 (file)
@@ -2298,7 +2298,6 @@ The following client is a very simple @acronym{SRP} @acronym{TLS}
 client which connects to a server and authenticates using a
 @emph{username} and a @emph{password}. The server may authenticate
 itself using a certificate, and in that case it has to be verified.
-In this example we also show the usage of @ref{gnutls_kx_convert_priority}.
 
 @verbatiminclude examples/ex-client-srp.c
 
index 0251fb43fa8bb6655749674db97734a63502eb98..17d0c1152462022fe8c29b930c1fe2106b21af67 100644 (file)
@@ -517,6 +517,7 @@ extern "C"
 /* if you just want some defaults, use the following.
  */
   int gnutls_set_priority(gnutls_session_t session, const char *priority, char* syntax_error, size_t syntax_error_size);
+  int gnutls_check_priority(const char *priority, char *syntax_error, size_t syntax_error_size);
 
 /* Returns the name of a cipher suite */
   const char *gnutls_cipher_suite_get_name (gnutls_kx_algorithm_t
index 690cc5c5f1ddd5f349ba981559970e9abbc0c90c..867f7c3c651cf9710aa50d3186a11cde63441625 100644 (file)
@@ -610,6 +610,32 @@ error:
 
 }
 
+/**
+  * gnutls_check_priority - Checks for syntax errors the given priority string
+  * @priority: is a string describing priorities
+  * @syntax_error: In case of an error an error string will be copied there.
+  * @syntax_error_size: the length of the previous string.
+  *
+  * Checks for syntax errors the given priority string. The rules are
+  * described in gnutls_set_priority().
+  *
+  * On syntax error GNUTLS_E_INVALID_REQUEST is returned and 0 on success.
+  *
+  **/
+int
+gnutls_check_priority(const char *priority, char *syntax_error, size_t syntax_error_size)
+{
+gnutls_session t;
+int ret;
+
+  gnutls_init(&t, GNUTLS_SERVER);
+  ret = gnutls_set_priority( t, priority, syntax_error, syntax_error_size);
+  gnutls_deinit(t);
+
+  return ret;
+}
+
+
 /* New priority API with strings
  */
 
index ca5e641b52626e2fd8e0873871583939cc059d5f..7a920ee4504993ba685ae0cad5a420a3463ad86d 100644 (file)
@@ -67,4 +67,6 @@ int _gnutls_PRF (gnutls_session_t session,
                 const opaque * seed, int seed_size,
                 int total_bytes, void *ret);
 
+int gnutls_init (gnutls_session_t * session, gnutls_connection_end_t con_end);
+
 #define DEFAULT_CERT_TYPE GNUTLS_CRT_X509