Difference between revisions of "Ticket"

From iQueBrew
Jump to navigation Jump to search
Line 1: Line 1:
An iQue '''Ticket''' is used to store data about a piece of content and per-console information. It is contained inside the ticket file after the CMD data.
+
A '''ticket''' is used to store data about an associated app and per-console information, such as encryption keys and whether or not the app is time-limited.
 +
 
 +
== Format ==
 +
 
 +
A ticket consists of two parts: the [[CMD|content metadata]] for the app, and a ticket head.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 10: Line 14:
 
|-
 
|-
 
| 0x00
 
| 0x00
 +
| 0x29AC
 +
| -
 +
| [[CMD]]
 +
| Content metadata for the associated app
 +
|-
 +
| 0x29AC
 
| 0x04
 
| 0x04
| bytes
+
| uint32
| console_id
+
| bbId
| console id that this ticket is for
+
| ID of the console this ticket is for
 
|-
 
|-
| 0x04
+
| 0x29B0
 
| 0x02
 
| 0x02
| int16
+
| uint16
| ticket_id
+
| tid
| if bit 15 set then this is a trial ticket
+
| ticket ID; if bit 15 is set, then it is a trial ticket
 
|-
 
|-
| 0x06
+
| 0x29B2
 
| 0x02
 
| 0x02
 
| uint16
 
| uint16
| limit_enum
+
| code
| 0 or 2 = time, 1 = number of launches
+
| What type of trial limitation: 0 or 2 = time, 1 = number of launches
 
|-
 
|-
| 0x08
+
| 0x29B4
 
| 0x02
 
| 0x02
| int16
+
| uint16
| limit_value
+
| limit
| number of minutes, or number of launches
+
| number of minutes, or number of launches, before limit is reached
 
|-
 
|-
| 0x0A
+
| 0x29B6
 
| 0x02
 
| 0x02
| int16
+
| uint16
| padding
+
| reserved
| IV used to encrypt titlekey (with common key)                  
+
| padding                  
 
|-
 
|-
| 0x0C
+
| 0x29B8
 
| 0x04
 
| 0x04
| int32
+
| uint32
 +
| tsCrlVersion
 
| ticket_crl_version
 
| ticket_crl_version
|
 
 
|-
 
|-
 +
| 0x29BC
 
| 0x10
 
| 0x10
| 0x10
+
| uint8[16]
| bytes
+
| cmdIv
| titlekey_iv
+
| titlekey_iv; IV used to re-encrypt title key (with ECDH key)
| IV used to encrypt titlekey (with ecdh key)
 
 
|-
 
|-
| 0x20
+
| 0x29CC
 
| 0x40
 
| 0x40
| int32
+
| uint8[64]
| ecc_pubkey
+
| serverKey
| used with console's ECC privkey to derive unique titlekey encryption key via ECDH     
+
| ecc_pubkey; used with console's ECC private key to derive unique title key encryption key via ECDH     
 
|-
 
|-
| 0x60
+
| 0x2A0C
 
| 0x40
 
| 0x40
| bytes
+
| uint8[64]
| signer
+
| issuer
| certificate used to sign the ticket
+
| signer; certificate used to sign the ticket
 
|-
 
|-
| 0xA0
+
| 0x2A4C
 
| 0x100
 
| 0x100
| bytes
+
| uint8[256]
| signature
+
| ticketSign
| RSA-2048, over rest of tik+all of CMD
+
| RSA-2048 signature over all of the above ''and'' the CMD

Revision as of 10:53, 15 June 2018

A ticket is used to store data about an associated app and per-console information, such as encryption keys and whether or not the app is time-limited.

Format

A ticket consists of two parts: the content metadata for the app, and a ticket head.

Offset Length Type Description Information
0x00 0x29AC - CMD Content metadata for the associated app
0x29AC 0x04 uint32 bbId ID of the console this ticket is for
0x29B0 0x02 uint16 tid ticket ID; if bit 15 is set, then it is a trial ticket
0x29B2 0x02 uint16 code What type of trial limitation: 0 or 2 = time, 1 = number of launches
0x29B4 0x02 uint16 limit number of minutes, or number of launches, before limit is reached
0x29B6 0x02 uint16 reserved padding
0x29B8 0x04 uint32 tsCrlVersion ticket_crl_version
0x29BC 0x10 uint8[16] cmdIv titlekey_iv; IV used to re-encrypt title key (with ECDH key)
0x29CC 0x40 uint8[64] serverKey ecc_pubkey; used with console's ECC private key to derive unique title key encryption key via ECDH
0x2A0C 0x40 uint8[64] issuer signer; certificate used to sign the ticket
0x2A4C 0x100 uint8[256] ticketSign RSA-2048 signature over all of the above and the CMD