From 18cb0a89d3eb08847fc3ecc8cd9438bb88c7b4fa Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 7 Jun 2011 20:20:17 +0200 Subject: The attached patch ports gnutls to p11-kit. p11-kit is added as a dependency. p11-kit itself has no dependencies outside of basic libc stuff. The source code for p11-kit is available both in git and tarball form. [3] If the gnutls dependency on p11-kit is disabled (via a configure option) then the PKCS#11 support is disabled. This is useful in bare bones embedded systems or places where very minimal dependencies are limited. --- lib/gnutls_pubkey.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/gnutls_pubkey.c') diff --git a/lib/gnutls_pubkey.c b/lib/gnutls_pubkey.c index 6352bbbeed..3199492ac2 100644 --- a/lib/gnutls_pubkey.c +++ b/lib/gnutls_pubkey.c @@ -21,7 +21,6 @@ */ #include -#include #include #include #include @@ -34,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -252,6 +250,7 @@ gnutls_pubkey_get_preferred_hash_algorithm (gnutls_pubkey_t key, return ret; } +#ifdef ENABLE_PKCS11 /** * gnutls_pubkey_import_pkcs11: Imports a public key from a pkcs11 key @@ -305,6 +304,8 @@ gnutls_pubkey_import_pkcs11 (gnutls_pubkey_t key, return 0; } +#endif /* ENABLE_PKCS11 */ + #ifdef ENABLE_OPENPGP /** * gnutls_pubkey_import_openpgp: Imports a public key from an openpgp key @@ -919,6 +920,8 @@ gnutls_pubkey_set_key_usage (gnutls_pubkey_t key, unsigned int usage) return 0; } +#ifdef ENABLE_PKCS11 + /** * gnutls_pubkey_import_pkcs11_url: * @key: A key of type #gnutls_pubkey_t @@ -968,6 +971,8 @@ cleanup: return ret; } +#endif /* ENABLE_PKCS11 */ + /** * gnutls_pubkey_import_rsa_raw: * @key: Is a structure will hold the parameters -- cgit v1.2.1