usb: Netlogic: Use CPU_XLR in place of NLM_XLR
[zen-stable.git] / security / keys / encrypted-keys / encrypted.h
blobb6ade8945250c0b3f13913c56ee5b9686a3f39d1
1 #ifndef __ENCRYPTED_KEY_H
2 #define __ENCRYPTED_KEY_H
4 #define ENCRYPTED_DEBUG 0
5 #ifdef CONFIG_TRUSTED_KEYS
6 extern struct key *request_trusted_key(const char *trusted_desc,
7 u8 **master_key, size_t *master_keylen);
8 #else
9 static inline struct key *request_trusted_key(const char *trusted_desc,
10 u8 **master_key,
11 size_t *master_keylen)
13 return ERR_PTR(-EOPNOTSUPP);
15 #endif
17 #if ENCRYPTED_DEBUG
18 static inline void dump_master_key(const u8 *master_key, size_t master_keylen)
20 print_hex_dump(KERN_ERR, "master key: ", DUMP_PREFIX_NONE, 32, 1,
21 master_key, master_keylen, 0);
24 static inline void dump_decrypted_data(struct encrypted_key_payload *epayload)
26 print_hex_dump(KERN_ERR, "decrypted data: ", DUMP_PREFIX_NONE, 32, 1,
27 epayload->decrypted_data,
28 epayload->decrypted_datalen, 0);
31 static inline void dump_encrypted_data(struct encrypted_key_payload *epayload,
32 unsigned int encrypted_datalen)
34 print_hex_dump(KERN_ERR, "encrypted data: ", DUMP_PREFIX_NONE, 32, 1,
35 epayload->encrypted_data, encrypted_datalen, 0);
38 static inline void dump_hmac(const char *str, const u8 *digest,
39 unsigned int hmac_size)
41 if (str)
42 pr_info("encrypted_key: %s", str);
43 print_hex_dump(KERN_ERR, "hmac: ", DUMP_PREFIX_NONE, 32, 1, digest,
44 hmac_size, 0);
46 #else
47 static inline void dump_master_key(const u8 *master_key, size_t master_keylen)
51 static inline void dump_decrypted_data(struct encrypted_key_payload *epayload)
55 static inline void dump_encrypted_data(struct encrypted_key_payload *epayload,
56 unsigned int encrypted_datalen)
60 static inline void dump_hmac(const char *str, const u8 *digest,
61 unsigned int hmac_size)
64 #endif
65 #endif