diff options
author | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2010-11-23 17:50:34 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-11-28 16:55:25 -0500 |
commit | d00a1c72f7f4661212299e6cb132dfa58030bcdb (patch) | |
tree | 2c873e461f42bbf3aea03b7b2e59cea8f941d841 /include/keys | |
parent | c749ba912e87ccebd674ae24b97462176c63732e (diff) |
keys: add new trusted key-type
Define a new kernel key-type called 'trusted'. Trusted keys are random
number symmetric keys, generated and RSA-sealed by the TPM. The TPM
only unseals the keys, if the boot PCRs and other criteria match.
Userspace can only ever see encrypted blobs.
Based on suggestions by Jason Gunthorpe, several new options have been
added to support additional usages.
The new options are:
migratable= designates that the key may/may not ever be updated
(resealed under a new key, new pcrinfo or new auth.)
pcrlock=n extends the designated PCR 'n' with a random value,
so that a key sealed to that PCR may not be unsealed
again until after a reboot.
keyhandle= specifies the sealing/unsealing key handle.
keyauth= specifies the sealing/unsealing key auth.
blobauth= specifies the sealed data auth.
Implementation of a kernel reserved locality for trusted keys will be
investigated for a possible future extension.
Changelog:
- Updated and added examples to Documentation/keys-trusted-encrypted.txt
- Moved generic TPM constants to include/linux/tpm_command.h
(David Howell's suggestion.)
- trusted_defined.c: replaced kzalloc with kmalloc, added pcrlock failure
error handling, added const qualifiers where appropriate.
- moved to late_initcall
- updated from hash to shash (suggestion by David Howells)
- reduced worst stack usage (tpm_seal) from 530 to 312 bytes
- moved documentation to Documentation directory (suggestion by David Howells)
- all the other code cleanups suggested by David Howells
- Add pcrlock CAP_SYS_ADMIN dependency (based on comment by Jason Gunthorpe)
- New options: migratable, pcrlock, keyhandle, keyauth, blobauth (based on
discussions with Jason Gunthorpe)
- Free payload on failure to create key(reported/fixed by Roberto Sassu)
- Updated Kconfig and other descriptions (based on Serge Hallyn's suggestion)
- Replaced kzalloc() with kmalloc() (reported by Serge Hallyn)
Signed-off-by: David Safford <safford@watson.ibm.com>
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'include/keys')
-rw-r--r-- | include/keys/trusted-type.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/keys/trusted-type.h b/include/keys/trusted-type.h new file mode 100644 index 000000000000..56f82e5c9975 --- /dev/null +++ b/include/keys/trusted-type.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 IBM Corporation | ||
3 | * Author: David Safford <safford@us.ibm.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation, version 2 of the License. | ||
8 | */ | ||
9 | |||
10 | #ifndef _KEYS_TRUSTED_TYPE_H | ||
11 | #define _KEYS_TRUSTED_TYPE_H | ||
12 | |||
13 | #include <linux/key.h> | ||
14 | #include <linux/rcupdate.h> | ||
15 | |||
16 | #define MIN_KEY_SIZE 32 | ||
17 | #define MAX_KEY_SIZE 128 | ||
18 | #define MAX_BLOB_SIZE 320 | ||
19 | |||
20 | struct trusted_key_payload { | ||
21 | struct rcu_head rcu; | ||
22 | unsigned int key_len; | ||
23 | unsigned int blob_len; | ||
24 | unsigned char migratable; | ||
25 | unsigned char key[MAX_KEY_SIZE + 1]; | ||
26 | unsigned char blob[MAX_BLOB_SIZE]; | ||
27 | }; | ||
28 | |||
29 | extern struct key_type key_type_trusted; | ||
30 | |||
31 | #endif /* _KEYS_TRUSTED_TYPE_H */ | ||