From: Nikos Mavrogiannopoulos Date: Wed, 24 Sep 2014 08:03:13 +0000 (+0200) Subject: enabled gnutls_privkey_export_pkcs11 X-Git-Tag: gnutls_3_4_0~881 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c770406513dce298d2efac05d63723f10db7d16e;p=thirdparty%2Fgnutls.git enabled gnutls_privkey_export_pkcs11 --- diff --git a/lib/gnutls_privkey.c b/lib/gnutls_privkey.c index 229797ce7e..37909db5d2 100644 --- a/lib/gnutls_privkey.c +++ b/lib/gnutls_privkey.c @@ -419,9 +419,6 @@ int gnutls_privkey_import_pkcs11_url(gnutls_privkey_t key, const char *url) return ret; } -/* This is currently disabled because there is no routine to copy a - * PKCS#11 private key. */ -#if 0 /** * gnutls_privkey_export_pkcs11: * @pkey: The private key @@ -452,7 +449,7 @@ gnutls_privkey_export_pkcs11(gnutls_privkey_t pkey, if (ret < 0) return gnutls_assert_val(ret); - ret = _gnutls_pkcs11_privkey_cpy(*key, pkey->key.openpgp); /* TODO */ + ret = gnutls_pkcs11_privkey_cpy(*key, pkey->key.pkcs11); if (ret < 0) { gnutls_pkcs11_privkey_deinit(*key); *key = NULL; @@ -462,8 +459,6 @@ gnutls_privkey_export_pkcs11(gnutls_privkey_t pkey, return 0; } -#endif - #endif /* ENABLE_PKCS11 */ /** diff --git a/lib/includes/gnutls/abstract.h b/lib/includes/gnutls/abstract.h index b581ca107e..48ac9a793b 100644 --- a/lib/includes/gnutls/abstract.h +++ b/lib/includes/gnutls/abstract.h @@ -294,6 +294,9 @@ int gnutls_privkey_export_x509(gnutls_privkey_t pkey, gnutls_x509_privkey_t * key); int gnutls_privkey_export_openpgp(gnutls_privkey_t pkey, gnutls_openpgp_privkey_t * key); +int +gnutls_privkey_export_pkcs11(gnutls_privkey_t pkey, + gnutls_pkcs11_privkey_t *key); int gnutls_privkey_import_openpgp_raw(gnutls_privkey_t pkey, const gnutls_datum_t * data, diff --git a/lib/libgnutls.map b/lib/libgnutls.map index 59478b9e93..02f4485d66 100644 --- a/lib/libgnutls.map +++ b/lib/libgnutls.map @@ -926,6 +926,7 @@ GNUTLS_3_1_0 { gnutls_certificate_get_crt_raw; gnutls_privkey_generate; gnutls_privkey_export_x509; + gnutls_privkey_export_pkcs11; gnutls_privkey_export_openpgp; gnutls_fips140_mode_enabled; gnutls_record_check_corked;