summaryrefslogtreecommitdiff
path: root/lib/tpm.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-01-02 19:10:51 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-01-02 19:22:26 +0100
commited6c834986178fd3d4930340190a704a54c93552 (patch)
treef5760b6ec5af3bdd95d320a65f04a3905f9dada9 /lib/tpm.c
parent0fcbd34c953304dd06ebd49389af4b78575bd55b (diff)
downloadgnutls-ed6c834986178fd3d4930340190a704a54c93552.tar.gz
If trousers is not present define the TPM functions but have them return GNUTLS_E_UNIMPLEMENTED_FEATURE.
Diffstat (limited to 'lib/tpm.c')
-rw-r--r--lib/tpm.c83
1 files changed, 82 insertions, 1 deletions
diff --git a/lib/tpm.c b/lib/tpm.c
index c8f6769bab..9d1820ac5a 100644
--- a/lib/tpm.c
+++ b/lib/tpm.c
@@ -30,8 +30,10 @@
#include <gnutls/gnutls.h>
#include <gnutls/abstract.h>
#include <gnutls/tpm.h>
-
#include <gnutls_int.h>
+
+#ifdef HAVE_TROUSERS
+
#include <gnutls_errors.h>
#include <pkcs11_int.h>
#include <x509/common.h>
@@ -1606,3 +1608,82 @@ err_cc:
tpm_close_session(&s);
return ret;
}
+#else /* HAVE_TROUSERS */
+int
+gnutls_privkey_import_tpm_raw (gnutls_privkey_t pkey,
+ const gnutls_datum_t * fdata,
+ gnutls_tpmkey_fmt_t format,
+ const char *srk_password,
+ const char *key_password,
+ unsigned int flags)
+{
+ return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+}
+
+int
+gnutls_privkey_import_tpm_url (gnutls_privkey_t pkey,
+ const char* url,
+ const char *srk_password,
+ const char *key_password,
+ unsigned int flags)
+{
+ return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+}
+
+int
+gnutls_pubkey_import_tpm_raw (gnutls_pubkey_t pkey,
+ const gnutls_datum_t * fdata,
+ gnutls_tpmkey_fmt_t format,
+ const char *srk_password,
+ unsigned int flags)
+{
+ return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+}
+
+int
+gnutls_pubkey_import_tpm_url (gnutls_pubkey_t pkey,
+ const char* url,
+ const char *srk_password,
+ unsigned int flags)
+{
+ return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+}
+
+int
+gnutls_tpm_privkey_generate (gnutls_pk_algorithm_t pk, unsigned int bits,
+ const char* srk_password,
+ const char* key_password,
+ gnutls_tpmkey_fmt_t format,
+ gnutls_x509_crt_fmt_t pub_format,
+ gnutls_datum_t* privkey,
+ gnutls_datum_t* pubkey,
+ unsigned int flags)
+{
+ return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+}
+
+void
+gnutls_tpm_key_list_deinit (gnutls_tpm_key_list_t list)
+{
+ return;
+}
+
+int
+gnutls_tpm_key_list_get_url (gnutls_tpm_key_list_t list, unsigned int idx, char** url, unsigned int flags)
+{
+ return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+}
+
+int
+gnutls_tpm_get_registered (gnutls_tpm_key_list_t *list)
+{
+ return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+}
+
+int
+gnutls_tpm_privkey_delete (const char* url, const char* srk_password)
+{
+ return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+}
+#endif /* HAVE_TROUSERS */
+