diff options
author | Simon Josefsson <simon@josefsson.org> | 2007-11-28 10:16:59 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2007-11-28 10:16:59 +0100 |
commit | ce1655d565d1144b61877e8bc8c9c50a93f29d15 (patch) | |
tree | 1529ca8cbd9d273a16d3d64eedd0f4e422168915 | |
parent | 7dccd290cc1fb31c0398b57f1bd91dc01d340089 (diff) | |
download | gnutls-ce1655d565d1144b61877e8bc8c9c50a93f29d15.tar.gz |
Re-add gnutls_set_default_priority and gnutls_set_default_export_priority.
-rw-r--r-- | includes/gnutls/compat.h | 7 | ||||
-rw-r--r-- | includes/gnutls/gnutls.h.in | 5 | ||||
-rw-r--r-- | lib/gnutls_priority.c | 49 |
3 files changed, 54 insertions, 7 deletions
diff --git a/includes/gnutls/compat.h b/includes/gnutls/compat.h index cf1c089dfe..ee23e49ad2 100644 --- a/includes/gnutls/compat.h +++ b/includes/gnutls/compat.h @@ -19,13 +19,6 @@ #define _GNUTLS_GCC_ATTR_DEPRECATED #endif -#define gnutls_set_default_priority(x) \ - (gnutls_priority_set_direct (x, "NORMAL", NULL, 0), \ - GNUTLS_E_SUCCESS) -#define gnutls_set_default_export_priority(x) \ - (gnutls_priority_set_direct ( x, "EXPORT", NULL, 0), \ - GNUTLS_E_SUCCESS) - #define gnutls_cipher_algorithm gnutls_cipher_algorithm_t #define gnutls_kx_algorithm gnutls_kx_algorithm_t #define gnutls_paramsype gnutls_paramsype_t diff --git a/includes/gnutls/gnutls.h.in b/includes/gnutls/gnutls.h.in index 1a6871192a..317dcd24cf 100644 --- a/includes/gnutls/gnutls.h.in +++ b/includes/gnutls/gnutls.h.in @@ -518,6 +518,11 @@ extern "C" int gnutls_priority_set(gnutls_session_t session, gnutls_priority_t); int gnutls_priority_set_direct(gnutls_session_t session, const char *priority, char* syntax_error, size_t syntax_error_size); + /* for compatibility + */ + int gnutls_set_default_priority (gnutls_session_t session); + int gnutls_set_default_export_priority (gnutls_session_t session); + /* Returns the name of a cipher suite */ const char *gnutls_cipher_suite_get_name (gnutls_kx_algorithm_t kx_algorithm, diff --git a/lib/gnutls_priority.c b/lib/gnutls_priority.c index afa36ad691..f9d3fd4e18 100644 --- a/lib/gnutls_priority.c +++ b/lib/gnutls_priority.c @@ -680,3 +680,52 @@ break_comma_list (char *etag, while (p != NULL && *elements < max_elements); } +/** + * gnutls_set_default_priority - Sets some default priority on the cipher suites supported by gnutls. + * @session: is a #gnutls_session_t structure. + * + * Sets some default priority on the ciphers, key exchange methods, + * macs and compression methods. + * + * This is the same as calling: + * + * gnutls_priority_set_direct (session, "EXPORT", NULL, 0); + * + * This function is kept around for backwards compatibility, but + * because of its wide use it is still fully supported. If you wish + * to allow users to provide a string that specify which ciphers to + * use (which is recommended), you should use + * gnutls_priority_set_direct() or gnutls_priority_set() instead. + * + * Returns 0 on success. + **/ +int +gnutls_set_default_priority (gnutls_session_t session) +{ + return gnutls_priority_set_direct (session, "NORMAL", NULL, 0); +} + +/** + * gnutls_set_default_export_priority - Sets some default priority on the cipher suites supported by gnutls. + * @session: is a #gnutls_session_t structure. + * + * Sets some default priority on the ciphers, key exchange methods, macs + * and compression methods. This function also includes weak algorithms. + * + * This is the same as calling: + * + * gnutls_priority_set_direct (session, "EXPORT", NULL, 0); + * + * This function is kept around for backwards compatibility, but + * because of its wide use it is still fully supported. If you wish + * to allow users to provide a string that specify which ciphers to + * use (which is recommended), you should use + * gnutls_priority_set_direct() or gnutls_priority_set() instead. + * + * Returns 0 on success. + **/ +int +gnutls_set_default_export_priority (gnutls_session_t session) +{ + return gnutls_priority_set_direct (session, "EXPORT", NULL, 0); +} |