diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2007-11-18 19:52:43 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2007-11-18 19:52:43 +0200 |
commit | 8e6101ade5f67d73cd2f6a4984c3db17739a7dd3 (patch) | |
tree | 571b80909e7455b5e53d10f8263e48b181da1e84 | |
parent | b76ae01ea1334e910a99ced85d0ccf5ae21d0da9 (diff) | |
download | gnutls-8e6101ade5f67d73cd2f6a4984c3db17739a7dd3.tar.gz |
The gnutls_*_convert_priority() functions were deprecated by the
gnutls_set_priority()
-rw-r--r-- | NEWS | 9 | ||||
-rw-r--r-- | lib/gnutls_priority.c | 373 |
2 files changed, 9 insertions, 373 deletions
@@ -12,10 +12,19 @@ preferences of ciphersuite parameters. ** gnutls-cli and gnutls-serv now have a --priority option to set the priority string. +** The gnutls_*_convert_priority() functions were deprecated by +the gnutls_set_priority(). + ** Internal copy of OpenCDK upgraded to version 0.6.6. ** API and ABI modifications: gnutls_set_default_priority2: RENAMED to gnutls_set_priority() +gnutls_mac_convert_priority: REMOVED +gnutls_compression_convert_priority: REMOVED +gnutls_protocol_convert_priority: REMOVED +gnutls_kx_convert_priority: REMOVED +gnutls_cipher_convert_priority: REMOVED +gnutls_certificate_type_convert_priority: REMOVED * Version 2.1.6 (released 2007-11-15) diff --git a/lib/gnutls_priority.c b/lib/gnutls_priority.c index e2a38b5e2f..71e9639738 100644 --- a/lib/gnutls_priority.c +++ b/lib/gnutls_priority.c @@ -646,376 +646,3 @@ break_comma_list (char *etag, while (p != NULL && *elements < max_elements); } -#if defined(__STDC_VERSION__) && __STD_VERSION__ > 199901L -#define _GNUTLS_MAX_PRIO (out_priority_len-1) -#define _GNUTLS_MAX_PRIO_CHECK(x) -#else -#define _GNUTLS_MAX_PRIO 256 -#define _GNUTLS_MAX_PRIO_CHECK(x) if (x>255) return GNUTLS_E_INVALID_REQUEST -#endif - -/** - * gnutls_mac_convert_priority - Converts the priority on the MAC algorithms supported by gnutls. - * @out_priority: is a list of integers to copy priorities to - * @out_priority_len: is the maximum number of integers the previous list can hold - * @prio: is a separated list of algorithms - * @sep: is the separator of the previous list, if zero comma is assumed - * - * Converts the priority on the MAC algorithms supported by gnutls to - * internal integer format - * Priority is higher for elements specified before others. - * Note that the priority is set on the client. The server does - * not use the algorithm's priority except for disabling - * algorithms that were not specified. - * - * The supported algorithms are: MD5, SHA1 - * - * Returns 0 on success. - * - **/ -int -gnutls_mac_convert_priority (int *out_priority, int out_priority_len, - const char *prio, char sep) -{ - char *broken_list[_GNUTLS_MAX_PRIO]; - int broken_list_size, i, j; - char *darg; - int ret; - - _GNUTLS_MAX_PRIO_CHECK (out_priority_len); - - darg = gnutls_strdup (prio); - if (darg == NULL) - { - gnutls_assert (); - return GNUTLS_E_MEMORY_ERROR; - } - - break_comma_list (darg, broken_list, &broken_list_size, - out_priority_len - 1, sep); - - j = 0; - for (i = 0; i < broken_list_size; i++) - { - ret = gnutls_mac_get_id (broken_list[i]); - if (ret != GNUTLS_MAC_UNKNOWN) - { - out_priority[j++] = ret; - continue; - } - - _gnutls_debug_log ("MAC algorithm %s is not known\n", broken_list[i]); - - gnutls_free (darg); - return GNUTLS_E_UNKNOWN_ALGORITHM; - } - out_priority[j] = 0; - - gnutls_free (darg); - return 0; -} - -/** - * gnutls_certificate_type_convert_priority - Converts the priority on the certificate types supported by gnutls. - * @out_priority: is a list of integers to copy priorities to - * @out_priority_len: is the maximum number of integers the previous list can hold - * @prio: is a separated list of algorithms - * @sep: is the separator of the previous list, if zero comma is assumed - * - * Converts the priority on the Certificate types supported by gnutls to - * internal integer format - * Priority is higher for elements specified before others. - * Note that the priority is set on the client. The server does - * not use the algorithm's priority except for disabling - * algorithms that were not specified. - * - * The supported types are: X.509, OPENPGP - * - * Returns 0 on success. - * - **/ -int -gnutls_certificate_type_convert_priority (int *out_priority, - int out_priority_len, - const char *prio, char sep) -{ - char *broken_list[_GNUTLS_MAX_PRIO]; - int broken_list_size, i, j, ret; - char *darg; - - _GNUTLS_MAX_PRIO_CHECK (out_priority_len); - - darg = gnutls_strdup (prio); - if (darg == NULL) - { - gnutls_assert (); - return GNUTLS_E_MEMORY_ERROR; - } - - break_comma_list (darg, broken_list, &broken_list_size, - out_priority_len - 1, sep); - - j = 0; - for (i = 0; i < broken_list_size; i++) - { - ret = gnutls_certificate_type_get_id (broken_list[i]); - if (ret != GNUTLS_CRT_UNKNOWN) - { - out_priority[j++] = ret; - continue; - } - - _gnutls_debug_log ("Certificate type %s is not known\n", - broken_list[i]); - gnutls_free (darg); - return GNUTLS_E_UNKNOWN_ALGORITHM; - } - out_priority[j] = 0; - - gnutls_free (darg); - return 0; -} - -/** - * gnutls_compression_convert_priority - Converts the priority on the compression methods supported by gnutls. - * @out_priority: is a list of integers to copy priorities to - * @out_priority_len: is the maximum number of integers the previous list can hold - * @prio: is a separated list of algorithms - * @sep: is the separator of the previous list, if zero comma is assumed - * - * Converts the priority on the ciphers supported by gnutls to - * internal integer format - * Priority is higher for elements specified before others. - * Note that the priority is set on the client. The server does - * not use the algorithm's priority except for disabling - * algorithms that were not specified. - * - * The supported methods are: NULL, DEFLATE, LZO - * - * Returns 0 on success. - * - **/ -int -gnutls_compression_convert_priority (int *out_priority, int out_priority_len, - const char *prio, char sep) -{ - char *broken_list[_GNUTLS_MAX_PRIO]; - int broken_list_size, i, j; - char *darg; - int ret; - - _GNUTLS_MAX_PRIO_CHECK (out_priority_len); - - darg = gnutls_strdup (prio); - if (darg == NULL) - { - gnutls_assert (); - return GNUTLS_E_MEMORY_ERROR; - } - - break_comma_list (darg, broken_list, &broken_list_size, - out_priority_len - 1, sep); - - j = 0; - for (i = 0; i < broken_list_size; i++) - { - ret = gnutls_compression_get_id (broken_list[i]); - if (ret != GNUTLS_COMP_UNKNOWN) - { - out_priority[j++] = ret; - continue; - } - - _gnutls_debug_log ("Compression algorithm %s is not known\n", - broken_list[i]); - gnutls_free (darg); - return GNUTLS_E_UNKNOWN_COMPRESSION_ALGORITHM; - } - out_priority[j] = 0; - - gnutls_free (darg); - return 0; -} - -/** - * gnutls_protocol_convert_priority - Converts the priority on the protocols supported by gnutls. - * @out_priority: is a list of integers to copy priorities to - * @out_priority_len: is the maximum number of integers the previous list can hold - * @prio: is a separated list of algorithms - * @sep: is the separator of the previous list, if zero comma is assumed - * - * Converts the priority on the protocols supported by gnutls to - * internal integer format - * Priority is higher for elements specified before others. - * Note that the priority is set on the client. The server does - * not use the algorithm's priority except for disabling - * algorithms that were not specified. - * - * The supported protocols are: TLS1.0, TLS1.1, TLS1.2, SSL3.0 - * - * Returns 0 on success. - * - **/ -int -gnutls_protocol_convert_priority (int *out_priority, int out_priority_len, - const char *prio, char sep) -{ - char *broken_list[_GNUTLS_MAX_PRIO]; - int broken_list_size, i, j; - char *darg; - int ret; - - _GNUTLS_MAX_PRIO_CHECK (out_priority_len); - - darg = gnutls_strdup (prio); - if (darg == NULL) - { - gnutls_assert (); - return GNUTLS_E_MEMORY_ERROR; - } - - break_comma_list (darg, broken_list, &broken_list_size, - out_priority_len - 1, sep); - - j = 0; - for (i = 0; i < broken_list_size; i++) - { - ret = gnutls_compression_get_id (broken_list[i]); - if (ret != GNUTLS_VERSION_UNKNOWN) - { - out_priority[j++] = ret; - continue; - } - - _gnutls_debug_log ("Protocol %s is not known\n", broken_list[i]); - gnutls_free (darg); - return GNUTLS_E_UNKNOWN_ALGORITHM; - } - out_priority[j] = 0; - - gnutls_free (darg); - return 0; -} - -/** - * gnutls_kx_convert_priority - Converts the priority on the key exchange algorithms supported by gnutls. - * @out_priority: is a list of integers to copy priorities to - * @out_priority_len: is the maximum number of integers the previous list can hold - * @prio: is a separated list of algorithms - * @sep: is the separator of the previous list, if zero comma is assumed - * - * Converts the priority on the key exchange algorithms supported by gnutls to - * internal integer format - * Priority is higher for elements specified before others. - * Note that the priority is set on the client. The server does - * not use the algorithm's priority except for disabling - * algorithms that were not specified. - * - * The supported algorithms are: RSA, DHE-DSS, DHE-RSA, ANON-DH, RSA-EXPORT, - * SRP, SRP-DSS, SRP-RSA, PSK, DHE-PSK - * - * Returns 0 on success. - * - **/ -int -gnutls_kx_convert_priority (int *out_priority, int out_priority_len, - const char *prio, char sep) -{ - char *broken_list[_GNUTLS_MAX_PRIO]; - int broken_list_size, i, j; - char *darg; - int ret; - - _GNUTLS_MAX_PRIO_CHECK (out_priority_len); - - darg = gnutls_strdup (prio); - if (darg == NULL) - { - gnutls_assert (); - return GNUTLS_E_MEMORY_ERROR; - } - - break_comma_list (darg, broken_list, &broken_list_size, - out_priority_len - 1, sep); - - j = 0; - for (i = 0; i < broken_list_size; i++) - { - ret = gnutls_kx_get_id (broken_list[i]); - if (ret != GNUTLS_KX_UNKNOWN) - { - out_priority[j++] = ret; - continue; - } - - _gnutls_debug_log ("Key exchange algorithm %s is not known\n", - broken_list[i]); - gnutls_free (darg); - return GNUTLS_E_UNKNOWN_ALGORITHM; - } - out_priority[j] = 0; - - gnutls_free (darg); - return 0; -} - -/** - * gnutls_cipher_convert_priority - Converts the priority on the ciphers supported by gnutls. - * @out_priority: is a list of integers to copy priorities to - * @out_priority_len: is the maximum number of integers the previous list can hold - * @prio: is a separated list of algorithms - * @sep: is the separator of the previous list, if zero comma is assumed - * - * Converts the priority on the ciphers supported by gnutls to - * internal integer format. - * Priority is higher for ciphers specified before others. - * Note that the priority is set on the client. The server does - * not use the algorithm's priority except for disabling - * algorithms that were not specified. - * - * The supported algorithms are: NULL, ARCFOUR-128, ARCFOUR-40, 3DES-CBC, - * AES-128-CBC, AES-256-CBC, CAMELIA-128-CBC, CAMELIA-256-CBC - * - * Returns 0 on success. - * - **/ -int -gnutls_cipher_convert_priority (int *out_priority, int out_priority_len, - const char *prio, char sep) -{ - char *broken_list[_GNUTLS_MAX_PRIO]; - int broken_list_size, i, j; - char *darg; - int ret; - - _GNUTLS_MAX_PRIO_CHECK (out_priority_len); - - darg = gnutls_strdup (prio); - if (darg == NULL) - { - gnutls_assert (); - return GNUTLS_E_MEMORY_ERROR; - } - - break_comma_list (darg, broken_list, &broken_list_size, - out_priority_len - 1, sep); - - j = 0; - for (i = 0; i < broken_list_size; i++) - { - ret = gnutls_cipher_get_id (broken_list[i]); - if (ret != GNUTLS_CIPHER_UNKNOWN) - { - out_priority[j++] = ret; - continue; - } - - _gnutls_debug_log ("Cipher %s is not known\n", broken_list[i]); - gnutls_free (darg); - return GNUTLS_E_UNKNOWN_ALGORITHM; - } - out_priority[j] = 0; - - gnutls_free (darg); - return 0; -} |