diff options
author | Dave Airlie <airlied@gmail.com> | 2011-01-24 17:41:58 -0500 |
---|---|---|
committer | Dave Airlie <airlied@gmail.com> | 2011-01-24 17:41:58 -0500 |
commit | abb72c828878a2c69b2cfb33ac30007c8ecd735e (patch) | |
tree | a95ace4f34d86d55b3307bd53354d335e9f23563 /security/keys/encrypted.h | |
parent | 58bbf018a70c562437eeae121a5d021ba7fe56a5 (diff) | |
parent | 8e934dbf264418afe4d1dff34ce074ecc14280db (diff) |
Merge branch 'drm-intel-fixes-2' of ssh://master.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel into drm-fixes
* 'drm-intel-fixes-2' of ssh://master.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel: (30 commits)
drm/i915: Prevent uninitialised reads during error state capture
drm/i915: Use consistent mappings for OpRegion between ACPI and i915
drm/i915: Handle the no-interrupts case for UMS by polling
drm/i915: Disable high-precision vblank timestamping for UMS
drm/i915: Increase the amount of defense before computing vblank timestamps
drm/i915,agp/intel: Do not clear stolen entries
Remove MAYBE_BUILD_BUG_ON
BUILD_BUG_ON: make it handle more cases
module: fix missing semicolons in MODULE macro usage
param: add null statement to compiled-in module params
module: fix linker error for MODULE_VERSION when !MODULE and CONFIG_SYSFS=n
module: show version information for built-in modules in sysfs
selinux: return -ENOMEM when memory allocation fails
tpm: fix panic caused by "tpm: Autodetect itpm devices"
TPM: Long default timeout fix
trusted keys: Fix a memory leak in trusted_update().
keys: add trusted and encrypted maintainers
encrypted-keys: rename encrypted_defined files to encrypted
trusted-keys: rename trusted_defined files to trusted
drm/i915: Recognise non-VGA display devices
...
Diffstat (limited to 'security/keys/encrypted.h')
-rw-r--r-- | security/keys/encrypted.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/security/keys/encrypted.h b/security/keys/encrypted.h new file mode 100644 index 000000000000..cef5e2f2b7d1 --- /dev/null +++ b/security/keys/encrypted.h | |||
@@ -0,0 +1,54 @@ | |||
1 | #ifndef __ENCRYPTED_KEY_H | ||
2 | #define __ENCRYPTED_KEY_H | ||
3 | |||
4 | #define ENCRYPTED_DEBUG 0 | ||
5 | |||
6 | #if ENCRYPTED_DEBUG | ||
7 | static inline void dump_master_key(const u8 *master_key, size_t master_keylen) | ||
8 | { | ||
9 | print_hex_dump(KERN_ERR, "master key: ", DUMP_PREFIX_NONE, 32, 1, | ||
10 | master_key, master_keylen, 0); | ||
11 | } | ||
12 | |||
13 | static inline void dump_decrypted_data(struct encrypted_key_payload *epayload) | ||
14 | { | ||
15 | print_hex_dump(KERN_ERR, "decrypted data: ", DUMP_PREFIX_NONE, 32, 1, | ||
16 | epayload->decrypted_data, | ||
17 | epayload->decrypted_datalen, 0); | ||
18 | } | ||
19 | |||
20 | static inline void dump_encrypted_data(struct encrypted_key_payload *epayload, | ||
21 | unsigned int encrypted_datalen) | ||
22 | { | ||
23 | print_hex_dump(KERN_ERR, "encrypted data: ", DUMP_PREFIX_NONE, 32, 1, | ||
24 | epayload->encrypted_data, encrypted_datalen, 0); | ||
25 | } | ||
26 | |||
27 | static inline void dump_hmac(const char *str, const u8 *digest, | ||
28 | unsigned int hmac_size) | ||
29 | { | ||
30 | if (str) | ||
31 | pr_info("encrypted_key: %s", str); | ||
32 | print_hex_dump(KERN_ERR, "hmac: ", DUMP_PREFIX_NONE, 32, 1, digest, | ||
33 | hmac_size, 0); | ||
34 | } | ||
35 | #else | ||
36 | static inline void dump_master_key(const u8 *master_key, size_t master_keylen) | ||
37 | { | ||
38 | } | ||
39 | |||
40 | static inline void dump_decrypted_data(struct encrypted_key_payload *epayload) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | static inline void dump_encrypted_data(struct encrypted_key_payload *epayload, | ||
45 | unsigned int encrypted_datalen) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | static inline void dump_hmac(const char *str, const u8 *digest, | ||
50 | unsigned int hmac_size) | ||
51 | { | ||
52 | } | ||
53 | #endif | ||
54 | #endif | ||