[gnutls-devel] [PATCH] gnutls_x509_privkey_import: add missing algorithm setting for DSA keys

Jan Vcelak jan.vcelak at nic.cz
Thu Feb 25 16:43:36 CET 2016


The algorithm number was set only in the private key structure, not in
the nested structure with parameters. This made certain operations to
fail (e.g., copying the key into a PKCS #11 token).

Signed-off-by: Jan Vcelak <jan.vcelak at nic.cz>
---
 lib/x509/privkey_pkcs8.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/x509/privkey_pkcs8.c b/lib/x509/privkey_pkcs8.c
index 8b1471c..ca43865 100644
--- a/lib/x509/privkey_pkcs8.c
+++ b/lib/x509/privkey_pkcs8.c
@@ -1326,6 +1326,7 @@ _decode_pkcs8_dsa_key(ASN1_TYPE pkcs8_asn, gnutls_x509_privkey_t pkey)
 		goto error;
 	}
 
+	pkey->params.algo = GNUTLS_PK_DSA;
 	pkey->params.params_nr = DSA_PRIVATE_PARAMS;
 
 	ret = 0;
-- 
2.5.0




More information about the Gnutls-devel mailing list