summaryrefslogtreecommitdiffstats
path: root/security/tf_sdk/include/wvdrm_protocol.h
blob: de51fb69463f9bc93e71e586f33dad7801b932d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
 * Copyright (c) 2011 Trusted Logic S.A.
 * All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Trusted Logic S.A. ("Confidential Information"). You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered
 * into with Trusted Logic S.A.
 *
 * TRUSTED LOGIC S.A. MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
 * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
 * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TRUSTED LOGIC S.A. SHALL
 * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
 * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */
#ifndef   __WVDRM_PROTOCOL_H__
#define   __WVDRM_PROTOCOL_H__

#include <common_secure_driver_protocol.h>

/* 45544DF9-B1DF-9BEE-D0B9-0C98CE3B41F6 */
#define WVDRM_UUID {0x45544DF9, 0xB1DF, 0x9BEE, {0xD0, 0xB9, 0x0C, 0x98, 0xCE, 0x3B, 0x41, 0xF6}}

/*
 * Persistently install the DRM "key box" previously wrapped
 * with WRAP_KEYBOX
 *
 * Param #0: MEMREF_INPUT:
 *    The encrypted keybox
 */
#define WVDRM_INSTALL_KEYBOX 0x00001000

/*
 * Test if a keybox is provisioned and optionnally get its key data
 *
 * #0:
 *   - NONE: for testing if the keybox is valid (returns S_ERROR_ITEM_NOT_FOUND if not)
 *   - MEMREF_OUTPUT: to actually get the key data
 */
#define WVDRM_GET_KEY_DATA 0x00001001

/*
 * Generate random data
 *
 * #0:
 *   - MEMREF_OUTPUT: buffer to fill with random data
 */
#define WVDRM_GET_RANDOM 0x00001002

/*
 * Get the device ID
 *
 * #0: MEMREF_OUTPUT: filled with the device ID
 */
#define WVDRM_GET_DEVICE_ID 0x00001003

/*
 * Optionnally decrypt a keybox with a transport key
 * and wrap it with a device specific key. The result
 * can be later passed to INSTALL_KEYBOX
 *
 * #0: MEMREF_INPUT: the input keybox
 *      - either in cleartext if param #2 is NONE
 *      - or encrypted with the key in param #2
 * #1: MEMREF_OUTPUT: the resulting wrapped key box
 * #2:
 *     - NONE: param#0 is the clear-text keybox
 *     - MEMREF_INPUT: a transport key, in which case
 *       param#0 is the encryption with AES-CBC-128 of the
 *       keybox with an IV filled with zeros
 */
#define WVDRM_WRAP_KEYBOX 0x00001004

/*
 * Unwrap an asset key. The asset key is stored in transient memory
 * but available globally to all sessons. There can be only one asset key
 * at a time.
 *
 * #0: MEMREF_INPUT
 */
#define WVDRM_SET_ENTITLEMENT_KEY 0x00002000

/*
 * Decrypt the ECM (Entitlement Control Message = content key) using the asset key.
 * Store the flags associated with the ECM. These flags will be later used, e.g.,
 * to activate HDCP protection. Also returns the flags.
 *
 * #0: MEMREF_INPUT
 * #1: VALUE_OUTPUT: a=flags
 *
 */
#define WVDRM_DERIVE_CONTROL_WORD 0x00002001

/*
 * Decrypt a chunk of content from a non-secure buffer into
 * a secure buffer opaquely referred to as an offset within
 * the Decrypted-Encoded-Buffer part of the carveout.
 *
 * #0: MEMREF_INPUT: the encrypted content
 * #1: VALUE_INPUT:
 *     [in]  a=physical address of the ION handle, b=size of the handle
 * #2: MEMREF_INOUT: the IV
 * #3: VALUE_INOUT:
 *     [in]  a=offset from the physical address of the ION handle, b=max size
 *     [out] b=actual size or required size
 */
#define WVDRM_DECRYPT_VIDEO 0x00002002

/*
 * Decrypt a chunk of content into a non-secure buffer. This
 * must be used only for audio content.
 *
 * #0: MEMREF_INPUT: the encrypted content
 * #1: MEMREF_OUTPUT: the decrypted content
 * #2: MEMREF_INOUT: the IV
 */
#define WVDRM_DECRYPT_AUDIO 0x00002003

/*
 * Enter in secure playback.
 */
#define WVDRM_ENTER_SECURE_PLAYBACK COMMON_SECURE_DRIVER_ENTER_SECURE_PLAYBACK

/*
 * Exit in secure playback.
 */
#define WVDRM_EXIT_SECURE_PLAYBACK COMMON_SECURE_DRIVER_EXIT_SECURE_PLAYBACK

#endif /* __WVDRM_PROTOCOL_H__ */