[gnutls-devel] GnuTLS | Add support for loading Ed25519 keys from PKCS#11 and using them (!1200)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Sat Mar 7 09:22:45 CET 2020




Dmitry Baryshkov started a new discussion on lib/pkcs11_write.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1200#note_301112018

>  		(*a_val)++;
>  
> +		ret = _gnutls_x509_encode_string(ASN1_ETYPE_OCTET_STRING,
> +						 pubkey->params.raw_pub.data,
> +						 pubkey->params.raw_pub.size,
> +						 &ecpoint);
> +		if (ret < 0) {
> +			gnutls_assert();
> +			return ret;
> +		}
> +
>  		a[*a_val].type = CKA_EC_POINT;
> -		a[*a_val].value = pubkey->params.raw_pub.data;
> -		a[*a_val].value_len = pubkey->params.raw_pub.size;
> +		a[*a_val].value = ecpoint.data;
> +		a[*a_val].value_len = ecpoint.size;

Hmm, this changes a format of public key from just `X` value to `OCTET STRING` encoding of `X`. Is this intended? Is it the format used by tokens?

PKCS11 says:

> DER-encoding of the b-bit public key value in little endian order as defined in RFC 8032

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1200#note_301112018
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/20200307/c9b901a8/attachment-0001.html>


More information about the Gnutls-devel mailing list