Difference between revisions of "AMPXI:VerifyDSiWareFooter"

From 3dbrew
Jump to navigation Jump to search
m
Line 8: Line 8:
 
| Header code [0x004301C8]
 
| Header code [0x004301C8]
 
|-
 
|-
| 1
+
| 1-2
| TWL TitleID lower word, from the [[DSiWare_Exports|header]].
+
| u64, TWL Title ID (from [[DSiWare_Exports|header]])
|-
 
| 2
 
| TWL TitleID upper word, from the header.
 
 
|-
 
|-
 
| 3
 
| 3
| Data buffer size. When the running NATIVE_FIRM only supports [[DSiWare_Exports|DSiWare]] exports format v1, the max size for this is 0xC0, otherwise the max size is 0x1C0.
+
| Data size
 
|-
 
|-
 
| 4
 
| 4
| ECDSA signature buffer size, must be 0x3C.
+
| ECDSA signature size (must be 0x3C)
 
|-
 
|-
 
| 5
 
| 5
| [[CTCert]] buffer size, must be 0x180.
+
| [[CTCert]] size (must be 0x180)
 
|-
 
|-
 
| 6
 
| 6
| APCert buffer size, must be 0x180.
+
| APCert size (must be 0x180)
 
|-
 
|-
 
| 7
 
| 7
| u8 [[DSiWare_Exports|DSiWare]] export section index
+
| u8, [[DSiWare_Exports|DSiWare]] export section index
 
|-
 
|-
 
| 8
 
| 8
| <nowiki>(DataBufSize<<8) | 0x4</nowiki>
+
| <nowiki>(DataSize << 8) | 0x4</nowiki>
 
|-
 
|-
 
| 9
 
| 9
| DataBuf ptr, this buffer contains the hashes from the [[DSiWare_Exports|footer]].
+
| Data pointer (contains hashes from [[DSiWare_Exports|footer]])
 
|-
 
|-
 
| 10
 
| 10
| <nowiki>(SigBufSize<<8) | 0x14</nowiki>
+
| <nowiki>(ECDSASignatureSize << 8) | 0x14</nowiki>
 
|-
 
|-
 
| 11
 
| 11
| ECDSA signature ptr, this signs the above data-buffer.
+
| ECDSA signature pointer (signs data)
 
|-
 
|-
 
| 12
 
| 12
| <nowiki>(CTCertSize<<8) | 0x24</nowiki>
+
| <nowiki>(CTCertSize << 8) | 0x24</nowiki>
 
|-
 
|-
 
| 13
 
| 13
| [[CTCert]] buffer ptr, from the footer.
+
| [[CTCert]] pointer (from [[DSiWare_Exports|footer]])
 
|-
 
|-
 
| 14
 
| 14
| <nowiki>(APCertSize<<8) | 0x34</nowiki>
+
| <nowiki>(APCertSize << 8) | 0x34</nowiki>
 
|-
 
|-
 
| 15
 
| 15
| APCert buffer ptr, from the footer.
+
| APCert pointer (from [[DSiWare_Exports|footer]])
 
|}
 
|}
  
Line 61: Line 58:
 
|-
 
|-
 
| 0
 
| 0
| Header code
+
| Header code [0x00430040]
 
|-
 
|-
 
| 1
 
| 1
Line 69: Line 66:
 
=Description=
 
=Description=
 
This verifies the ECDSA signature and certificates from the [[DSiWare_Exports|DSiWare]] export footer. The input CTCert is verified with a DER stored in NATIVE_FIRM, separate DERs are used for retail and dev/debug.
 
This verifies the ECDSA signature and certificates from the [[DSiWare_Exports|DSiWare]] export footer. The input CTCert is verified with a DER stored in NATIVE_FIRM, separate DERs are used for retail and dev/debug.
 +
 +
When the running NATIVE_FIRM only supports [[DSiWare_Exports|DSiWare]] exports format v1, the max data size is 0xC0, otherwise the max size is 0x1C0.

Revision as of 02:57, 10 January 2016

Request

Index Word Description
0 Header code [0x004301C8]
1-2 u64, TWL Title ID (from header)
3 Data size
4 ECDSA signature size (must be 0x3C)
5 CTCert size (must be 0x180)
6 APCert size (must be 0x180)
7 u8, DSiWare export section index
8 (DataSize << 8) | 0x4
9 Data pointer (contains hashes from footer)
10 (ECDSASignatureSize << 8) | 0x14
11 ECDSA signature pointer (signs data)
12 (CTCertSize << 8) | 0x24
13 CTCert pointer (from footer)
14 (APCertSize << 8) | 0x34
15 APCert pointer (from footer)

Response

Index Word Description
0 Header code [0x00430040]
1 Result code

Description

This verifies the ECDSA signature and certificates from the DSiWare export footer. The input CTCert is verified with a DER stored in NATIVE_FIRM, separate DERs are used for retail and dev/debug.

When the running NATIVE_FIRM only supports DSiWare exports format v1, the max data size is 0xC0, otherwise the max size is 0x1C0.