]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
enabled gnutls_privkey_export_pkcs11
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 24 Sep 2014 08:03:13 +0000 (10:03 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 24 Sep 2014 08:06:13 +0000 (10:06 +0200)
lib/gnutls_privkey.c
lib/includes/gnutls/abstract.h
lib/libgnutls.map

index 229797ce7e41a4109c42f659c5f102ac35aea03c..37909db5d2159e5d79a4e87673dd41c8ca99861d 100644 (file)
@@ -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 */
 
 /**
index b581ca107eec99f590610a144719386f2f3359c0..48ac9a793b81ec667f385a7fc4a1786ff9bc2bc9 100644 (file)
@@ -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,
index 59478b9e93fb2661b34bef5c6a08fab3ce38892a..02f4485d66a3bc126439b02445f833f3fa4859cc 100644 (file)
@@ -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;