[gnutls-devel] GnuTLS | WIP: GOST key exchange support (!1097)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Tue Nov 5 16:40:59 CET 2019




Dmitry Eremin-Solenikov commented on a discussion on lib/auth/vko_gost.c: https://gitlab.com/gnutls/gnutls/merge_requests/1097#note_240336611

> +	cert_auth_info_t info = _gnutls_get_auth_info(session, GNUTLS_CRD_CERTIFICATE);
> +	gnutls_pcert_st peer_cert;
> +	int has_pcert = 0;
> +	gnutls_datum_t ukm;
> +	gnutls_datum_t cek;
> +	int len;
> +
> +	if (group == NULL)
> +		return gnutls_assert_val(GNUTLS_E_ECC_NO_SUPPORTED_CURVES);
> +
> +	DECR_LEN(data_size, 1);
> +	if (data[0] != (ASN1_TAG_SEQUENCE | ASN1_CLASS_STRUCTURED))
> +		return gnutls_assert_val(GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER);
> +	i += 1;
> +
> +	ret = asn1_get_length_der(&data[i], data_size, &len);

Yes. It's a `GNUTLS.GostR3410-KeyTransport` wrapped in another struct. I did not like an idea of parsing a struct just to parse contents, so I ended up with this kind of code. If you'd prefer, I can add a struct wrapping `GNUTLS.GostR3410-KeyTransport` and parse it's contents to get single item (key transport struct itself).

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1097#note_240336611
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20191105/127fc189/attachment-0001.html>


More information about the Gnutls-devel mailing list