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
);
9 static inline struct key
*request_trusted_key(const char *trusted_desc
,
11 size_t *master_keylen
)
13 return ERR_PTR(-EOPNOTSUPP
);
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
)
42 pr_info("encrypted_key: %s", str
);
43 print_hex_dump(KERN_ERR
, "hmac: ", DUMP_PREFIX_NONE
, 32, 1, digest
,
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
)