aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/trusted.h
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2018-10-09 17:48:41 +0100
committerJames Morris <james.morris@microsoft.com>2018-10-26 09:30:47 +0100
commite1ea9f86023e7668604cc6456a818e5e4d0361c9 (patch)
tree7aef92cdad4fcf870507bf42b66a1da0ae9c05e5 /security/keys/trusted.h
parentKEYS: asym_tpm: Implement encryption operation [ver #2] (diff)
downloadlinux-dev-e1ea9f86023e7668604cc6456a818e5e4d0361c9.tar.xz
linux-dev-e1ea9f86023e7668604cc6456a818e5e4d0361c9.zip
KEYS: trusted: Expose common functionality [ver #2]
This patch exposes some common functionality needed to send TPM commands. Several functions from keys/trusted.c are exposed for use by the new tpm key subtype and a module dependency is introduced. In the future, common functionality between the trusted key type and the asym_tpm subtype should be factored out into a common utility library. Signed-off-by: Denis Kenzior <denkenz@gmail.com> Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Marcel Holtmann <marcel@holtmann.org> Reviewed-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: James Morris <james.morris@microsoft.com>
Diffstat (limited to 'security/keys/trusted.h')
-rw-r--r--security/keys/trusted.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/security/keys/trusted.h b/security/keys/trusted.h
index 8d5fe9eafb22..adbcb6817826 100644
--- a/security/keys/trusted.h
+++ b/security/keys/trusted.h
@@ -3,7 +3,7 @@
#define __TRUSTED_KEY_H
/* implementation specific TPM constants */
-#define MAX_BUF_SIZE 512
+#define MAX_BUF_SIZE 1024
#define TPM_GETRANDOM_SIZE 14
#define TPM_OSAP_SIZE 36
#define TPM_OIAP_SIZE 10
@@ -36,6 +36,18 @@ enum {
SRK_keytype = 4
};
+int TSS_authhmac(unsigned char *digest, const unsigned char *key,
+ unsigned int keylen, unsigned char *h1,
+ unsigned char *h2, unsigned char h3, ...);
+int TSS_checkhmac1(unsigned char *buffer,
+ const uint32_t command,
+ const unsigned char *ononce,
+ const unsigned char *key,
+ unsigned int keylen, ...);
+
+int trusted_tpm_send(unsigned char *cmd, size_t buflen);
+int oiap(struct tpm_buf *tb, uint32_t *handle, unsigned char *nonce);
+
#define TPM_DEBUG 0
#if TPM_DEBUG