aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/encrypted.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-01-23 12:22:16 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-24 13:27:32 -0500
commit8a327f23e23fa509e6e3c2263ae1cc0a67dec387 (patch)
tree119abf09e1ec9babaf78e6889187f9d54864b118 /security/keys/encrypted.h
parent5a9a8d1a99c617df82339456fbdd30d6ed3a856b (diff)
parentd315777b32a4696feb86f2a0c9e9f39c94683649 (diff)
Merge remote branch 'linus/master' into drm-intel-fixes
Merge with Linus to resolve conflicting fixes for the reusing the stale HEAD value during intel_ring_wait(). Conflicts: drivers/gpu/drm/i915/intel_ringbuffer.c
Diffstat (limited to 'security/keys/encrypted.h')
-rw-r--r--security/keys/encrypted.h54
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
7static 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
13static 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
20static 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
27static 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
36static inline void dump_master_key(const u8 *master_key, size_t master_keylen)
37{
38}
39
40static inline void dump_decrypted_data(struct encrypted_key_payload *epayload)
41{
42}
43
44static inline void dump_encrypted_data(struct encrypted_key_payload *epayload,
45 unsigned int encrypted_datalen)
46{
47}
48
49static inline void dump_hmac(const char *str, const u8 *digest,
50 unsigned int hmac_size)
51{
52}
53#endif
54#endif