bbmetadata.h
4.05 KB
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
/**********************************************
*
* BbContentMetaData.h
*
* Definition of signed content meta data (like a "content certificate")
* issued for each content.
*
**********************************************/
#ifndef __BB_METADATA_H_
#define __BB_METADATA_H_
#include <PR/bbtypes.h>
/*
* content meta-data defines (CMD) and type flags
*/
/* bytes of opaque content description data. must be a multiple of 512B */
#define BB_CMD_DESC_SIZE (1024*10)
/* CMD content description and type flags */
#define BB_CMD_DESC_COMMON_KEY 1 /* encrypted with common key */
/* CMD content execution flags */
#define BB_CMD_EXEC_COMPRESSED 1 /* boot section of content compressed */
#define BB_CMD_EXEC_RECRYPT 2 /* re-encryption required */
/* CMD hwAccessRights defines */
#define BB_CMD_HWAR_PI_MASK 0x000000ff /* same as PI_ACCESS bit meanings */
#define BB_CMD_HWAR_USB_MASK 0x00000100
#define BB_CMD_HWAR_IRAM_MASK 0x00000200
/* constant that must be the number of bytes to be encrypted in the
* BbContentMetaDataHead struct.
*/
#define BB_CMD_ENCRYPTED_CHUNK_BYTES (sizeof(BbAesKey))
#define BB_CMD_HEAD_SIGNED_BYTES ( sizeof(BbContentMetaDataHead) - \
sizeof(BbRsaSig2048) )
/************************************************
* "header" fields of content meta-data for any published
* content for the BB system. The indicated portions
* will be encrypted when they appear in the bbTicket.
***********************************************/
typedef struct {
/*
* CRL info
*/
u32 unusedPadding;
u32 caCrlVersion;
u32 cpCrlVersion;
/*
* High level content information that is the same in all tickets.
*/
u32 size;
u32 descFlags; /* content description flags, BB_CMD_DESC_* */
BbAesIv commonCmdIv; /* the common key is used to encrypt the "key"
* field, further down in the struct. this iv
* is used in conjunction with that key.
*/
/*
* Content security items that are the same in all tickets.
*/
BbShaHash hash; /* SHA hash of content */
BbAesIv iv; /* initialization vector associated with "key" field
* appearing further down in this struct.
*/
/*
* Content execution information.
*/
u32 execFlags; /* content execution flags, BB_CMD_EXEC_* */
u32 hwAccessRights; /* see BB_CMD_HWAR_*_MASK */
u32 secureKernelRights; /* define flags defining alloweable skapi
* usage. a flag for each ordinal position
* in the skapi call table.
*/
u32 bbid; /* if this field is non zero, this is the only
* bb on which this content executes. if
* it is zero, this field is ignored
*/
/* signer who supplies last field, contentMetaDataSign. */
BbServerName issuer;
/* server design caches portion of this struct above here (information
* that is common for all players). the server design insists the
* content id also appears below, even though it is common for all
* players.
*/
BbContentId id;
BbAesKey key; /* published content key. THE ONLY PORTION OF THE
* cmdh AND TICKET TO BE ENCRYPTED. during content
* publishing "key" is encrypted using the common
* key (virage), and during ticketing "key" is
* encrypted by the ticket server.
*/
/*
* RSA 2048 bit sign on all data upto this point.
*/
BbRsaSig2048 contentMetaDataSign;
} BbContentMetaDataHead;
/************************************************
* BbContentMetaData:
* complete metadata.
***********************************************/
typedef struct {
u8 contentDesc[BB_CMD_DESC_SIZE]; /* large, opaque portion of CMD */
BbContentMetaDataHead head;
} BbContentMetaData;
#endif