Two GOST groups will have two curves attached. Add function to retrieve
group by curve, rather than by group id.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
unsigned _gnutls_ecc_curve_is_supported(gnutls_ecc_curve_t);
+gnutls_group_t _gnutls_ecc_curve_get_group(gnutls_ecc_curve_t);
const gnutls_group_entry_st *_gnutls_tls_id_to_group(unsigned num);
const gnutls_group_entry_st * _gnutls_id_to_group(unsigned id);
return ret;
}
+/**
+ * _gnutls_ecc_curve_get_group:
+ * @curve: is an ECC curve
+ *
+ * Returns: the group associated with the named curve or %GNUTLS_GROUP_INVALID.
+ *
+ * Since: 3.6.11
+ */
+gnutls_group_t _gnutls_ecc_curve_get_group(gnutls_ecc_curve_t curve)
+{
+ gnutls_group_t ret = GNUTLS_GROUP_INVALID;
+
+ GNUTLS_ECC_CURVE_LOOP(
+ if (p->id == curve && p->supported && _gnutls_pk_curve_exists(p->id)) {
+ ret = p->group;
+ break;
+ }
+ );
+
+ return ret;
+}