summaryrefslogtreecommitdiff
path: root/lib/ext
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-05-21 19:08:55 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-05-21 19:08:55 +0200
commit8dcf7e8299fed143c2e61500da55b5e5910eb54c (patch)
tree485002767fe5b5aa983385976e489cca1c6f5f91 /lib/ext
parent0283ba941659a1cff403e8ff64d8cbc50cc56efa (diff)
downloadgnutls-8dcf7e8299fed143c2e61500da55b5e5910eb54c.tar.gz
Curve TLS ID is being stored in algorithms/ecc.c.
Diffstat (limited to 'lib/ext')
-rw-r--r--lib/ext/ecc.c39
-rw-r--r--lib/ext/ecc.h2
2 files changed, 3 insertions, 38 deletions
diff --git a/lib/ext/ecc.c b/lib/ext/ecc.c
index 11c00716e4..b417a2bcfd 100644
--- a/lib/ext/ecc.c
+++ b/lib/ext/ecc.c
@@ -33,6 +33,7 @@
#include <ext/ecc.h>
#include <gnutls_state.h>
#include <gnutls_num.h>
+#include <algorithms.h>
/* Maps record size to numbers according to the
* extensions draft.
@@ -110,7 +111,7 @@ _gnutls_supported_ecc_recv_params (gnutls_session_t session,
for (i = 0; i < len; i+=2)
{
- new_type = _gnutls_num_to_ecc (_gnutls_read_uint16(&p[i]));
+ new_type = _gnutls_tls_id_to_ecc_curve (_gnutls_read_uint16(&p[i]));
if (new_type < 0)
continue;
@@ -177,7 +178,7 @@ _gnutls_supported_ecc_send_params (gnutls_session_t session, gnutls_buffer_st* e
for (i = 0; i < len; i++)
{
p =
- _gnutls_ecc_to_num (session->internals.priorities.
+ _gnutls_ecc_curve_get_tls_id (session->internals.priorities.
supported_ecc.priority[i]);
ret = _gnutls_buffer_append_prefix(extdata, 16, p);
if (ret < 0)
@@ -246,40 +247,6 @@ _gnutls_supported_ecc_pf_send_params (gnutls_session_t session, gnutls_buffer_st
return 2;
}
-/* Maps numbers to record sizes according to the
- * extensions draft.
- */
-int
-_gnutls_num_to_ecc (int num)
-{
- switch (num)
- {
- case 23:
- /* sec256r1 */
- return GNUTLS_ECC_CURVE_SECP256R1;
- case 24:
- return GNUTLS_ECC_CURVE_SECP384R1;
- default:
- return GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER;
- }
-}
-
-/* Maps record size to numbers according to the
- * extensions draft.
- */
-int
-_gnutls_ecc_to_num (ecc_curve_t supported_ecc)
-{
- switch (supported_ecc)
- {
- case GNUTLS_ECC_CURVE_SECP256R1:
- return 23;
- case GNUTLS_ECC_CURVE_SECP384R1:
- return 24;
- default:
- return GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER;
- }
-}
/* Returns 0 if the given ECC curve is allowed in the current
* session. A negative error value is returned otherwise.
diff --git a/lib/ext/ecc.h b/lib/ext/ecc.h
index 745a000815..b2c22a478f 100644
--- a/lib/ext/ecc.h
+++ b/lib/ext/ecc.h
@@ -29,8 +29,6 @@
extern extension_entry_st ext_mod_supported_ecc;
extern extension_entry_st ext_mod_supported_ecc_pf;
-int _gnutls_num_to_ecc (int num);
-int _gnutls_ecc_to_num (ecc_curve_t);
int
_gnutls_session_supports_ecc_curve (gnutls_session_t session, int ecc_type);