[gnutls-devel] GnuTLS | x509: support encoding of ML-DSA private keys in CHOICE format (!1973)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Jul 4 06:37:57 CEST 2025




Daiki Ueno commented on a discussion on lib/x509/privkey_pkcs8.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1973#note_2602678535

 >  	return ret;
 >  }
 >  
 > +static int decode_ml_dsa_inner_private_key(const gnutls_datum_t *raw_key,
 > +					   size_t raw_pub_size,
 > +					   size_t raw_priv_size,
 > +					   gnutls_x509_privkey_t pkey)
 > +{
 > +	int ret;
 > +	asn1_node inner_asn = NULL;
 > +
 > +	/* libtasn1 doesn't support encoding instructions in CHOICE,
 > +	 * parse it manually */
 > +	if (raw_key->size == 34 && raw_key->data[0] == 0x80 &&
 > +	    raw_key->data[1] == 0x20) {

I'm afraid that would make the control flow complicated as the other alternatives in the CHOICE is handled in the `else` branch. I'd leave it as is.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1973#note_2602678535
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/20250704/fdd95301/attachment-0001.html>


More information about the Gnutls-devel mailing list