summaryrefslogtreecommitdiff
path: root/lib/x509/key_decode.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-04-11 14:48:33 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-04-11 14:48:33 +0200
commit71a9c5169a4d650fbdef31b81ae14e35feca1d38 (patch)
tree117dae2e0f577062a5b315ef67006c65020a777f /lib/x509/key_decode.c
parentf923d725222a2ec764e5b99334348327e61bf0f3 (diff)
downloadgnutls-71a9c5169a4d650fbdef31b81ae14e35feca1d38.tar.gz
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.
Diffstat (limited to 'lib/x509/key_decode.c')
-rw-r--r--lib/x509/key_decode.c8
1 files changed, 4 insertions, 4 deletions
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, &params->flags);
default:
return gnutls_assert_val(GNUTLS_E_UNIMPLEMENTED_FEATURE);
}