makerom v0.5

This commit is contained in:
3DSGuy
2014-04-01 14:08:00 +08:00
parent 510988b07a
commit 26772b49c8
45 changed files with 5630 additions and 4132 deletions
+51 -34
View File
@@ -3,14 +3,25 @@
typedef enum
{
keyset_DEBUG,
keyset_RETAIL,
} keysets;
RSA_1024_KEY_SIZE = 0x80,
RSA_2048_KEY_SIZE = 0x100,
RSA_4096_KEY_SIZE = 0x200,
} rsa_keysize;
typedef enum
{
pki_TEST,
pki_BETA,
pki_DEVELOPMENT,
pki_PRODUCTION,
pki_CUSTOM,
} pki_keyset;
typedef enum
{
not_preset,
app,
ec_app,
dlp,
demo,
} fixed_accessdesc_type;
@@ -19,55 +30,61 @@ typedef enum
typedef struct
{
keysets keyset;
char *keydir;
pki_keyset keyset;
bool dumpkeys;
struct
{
fixed_accessdesc_type PresetType;
u32 TargetFirmware;
} AccessDescSign;
fixed_accessdesc_type presetType;
u32 targetFirmware;
} accessDescSign;
struct
{
// CIA
u8 **CommonKey;
u8 CurrentCommonKey;
u8 **commonKey;
u16 currentCommonKey;
// NCCH Keys
u8 *NormalKey;
u8 *SystemFixedKey;
u8 *UnFixedKey;
u8 *normalKey;
u8 *systemFixedKey;
bool supportUnFixedKeys;
u8 *ncchKeyX0;
u8 *ncchKeyX1;
u8 *unFixedKey0;
u8 *unFixedKey1;
} aes;
struct
{
bool FalseSign;
bool isFalseSign;
// CIA RSA
u8 *TMD_Priv;
u8 *TMD_Pub;
u8 *TIK_Priv;
u8 *TIK_Pub;
u8 *cpPvt; //cpPvt
u8 *cpPub;
u8 *xsPvt;
u8 *xsPub;
// CFA
u8 *CFA_Priv;
u8 *CFA_Pub;
// CCI
u8 *CCI_Priv;
u8 *CCI_Pub;
// CCI/CFA
u8 *cciCfaPvt;
u8 *cciCfaPub;
// CXI
bool RequiresPresignedDesc;
u8 *AccessDesc_Priv;
u8 *AccessDesc_Pub;
bool requiresPresignedDesc;
u8 *acexPvt;
u8 *acexPub;
u8 *cxiHdrPub;
u8 *cxiHdrPvt;
} rsa;
struct
{
// CIA
u8 *ca_cert;
u8 *tik_cert;
u8 *tmd_cert;
u8 *caCert;
u8 *xsCert;
u8 *cpCert;
} certs;
} keys_struct;
@@ -75,9 +92,9 @@ typedef struct
// Public Prototypes
void InitKeys(keys_struct *keys);
void SetKeys(keys_struct *keys);
int SetKeys(keys_struct *keys);
void FreeKeys(keys_struct *keys);
int SetCommonKey(keys_struct *keys, u8 *CommonKey, u8 Index);
int SetCurrentCommonKey(keys_struct *keys, u8 Index);
int SetSystemFixedKey(keys_struct *keys, u8 *SystemFixedKey);
int SetcommonKey(keys_struct *keys, u8 *commonKey, u8 Index);
int SetcurrentCommonKey(keys_struct *keys, u8 Index);
int SetsystemFixedKey(keys_struct *keys, u8 *systemFixedKey);