From 71a9c5169a4d650fbdef31b81ae14e35feca1d38 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Fri, 11 Apr 2014 14:48:33 +0200 Subject: Allow decoding PKCS #8 files with ECC parameters from openssl. These files do not contain the curve information with the private key (ECPrivateKey), but they rather contain it in the privateKeyAlgorithm. --- lib/x509/key_decode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/x509/key_decode.c') diff --git a/lib/x509/key_decode.c b/lib/x509/key_decode.c index d14e44e252..89ca157ed2 100644 --- a/lib/x509/key_decode.c +++ b/lib/x509/key_decode.c @@ -182,7 +182,7 @@ _gnutls_x509_read_dsa_params(uint8_t * der, int dersize, */ int _gnutls_x509_read_ecc_params(uint8_t * der, int dersize, - gnutls_pk_params_st * params) + unsigned int * curve) { int ret; ASN1_TYPE spk = ASN1_TYPE_EMPTY; @@ -214,8 +214,8 @@ _gnutls_x509_read_ecc_params(uint8_t * der, int dersize, goto cleanup; } - params->flags = _gnutls_oid_to_ecc_curve(oid); - if (params->flags == GNUTLS_ECC_CURVE_INVALID) { + *curve = _gnutls_oid_to_ecc_curve(oid); + if (*curve == GNUTLS_ECC_CURVE_INVALID) { _gnutls_debug_log("Curve %s is not supported\n", oid); gnutls_assert(); ret = GNUTLS_E_ECC_UNSUPPORTED_CURVE; @@ -270,7 +270,7 @@ int _gnutls_x509_read_pubkey_params(gnutls_pk_algorithm_t algo, case GNUTLS_PK_DSA: return _gnutls_x509_read_dsa_params(der, dersize, params); case GNUTLS_PK_EC: - return _gnutls_x509_read_ecc_params(der, dersize, params); + return _gnutls_x509_read_ecc_params(der, dersize, ¶ms->flags); default: return gnutls_assert_val(GNUTLS_E_UNIMPLEMENTED_FEATURE); } -- cgit v1.2.1