Skip to content

Commit

Permalink
reversed (un)intentional vandalism
Browse files Browse the repository at this point in the history
I should have known better than to trust someone who hadn't REd the
format from scratch.
  • Loading branch information
3DSGuy committed Sep 23, 2014
1 parent 4fcc466 commit 2e48695
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 70 deletions.
40 changes: 0 additions & 40 deletions makerom/accessdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,23 +307,13 @@ void accessdesc_GetPresetSigData(u8 **accessDescSig, u8 **cxiPubk, u8 **cxiPvtk,
*cxiPubk = (u8*)app_fw1D_prod_hdrpub;
*cxiPvtk = NULL;
}
if(keys->keyset == pki_GATEWAY3DS){
*accessDescSig = (u8*)app_fw1D_prod_acexsig;
*cxiPubk = (u8*)app_fw1D_prod_hdrpub;
*cxiPvtk = (u8*)app_fw1D_prod_hdrpub;
}
break;
case 0x1E:
if(keys->keyset == pki_PRODUCTION){
*accessDescSig = (u8*)app_fw1E_prod_acexsig;
*cxiPubk = (u8*)app_fw1E_prod_hdrpub;
*cxiPvtk = NULL;
}
if(keys->keyset == pki_GATEWAY3DS){
*accessDescSig = (u8*)app_fw1E_prod_acexsig;
*cxiPubk = (u8*)app_fw1E_prod_hdrpub;
*cxiPvtk = (u8*)app_fw1E_prod_hdrpub;
}
break;
case 0x20:
if(keys->keyset == pki_DEVELOPMENT){
Expand All @@ -336,11 +326,6 @@ void accessdesc_GetPresetSigData(u8 **accessDescSig, u8 **cxiPubk, u8 **cxiPvtk,
*cxiPubk = (u8*)app_fw20_prod_hdrpub;
*cxiPvtk = NULL;
}
if(keys->keyset == pki_GATEWAY3DS){
*accessDescSig = (u8*)app_fw20_prod_acexsig;
*cxiPubk = (u8*)app_fw20_prod_hdrpub;
*cxiPvtk = (u8*)app_fw20_prod_hdrpub;
}
break;
case 0x21:
if(keys->keyset == pki_DEVELOPMENT){
Expand All @@ -353,11 +338,6 @@ void accessdesc_GetPresetSigData(u8 **accessDescSig, u8 **cxiPubk, u8 **cxiPvtk,
*cxiPubk = (u8*)app_fw21_prod_hdrpub;
*cxiPvtk = NULL;
}
if(keys->keyset == pki_GATEWAY3DS){
*accessDescSig = (u8*)app_fw21_prod_acexsig;
*cxiPubk = (u8*)app_fw21_prod_hdrpub;
*cxiPvtk = (u8*)app_fw21_prod_hdrpub;
}
break;
case 0x23:
if(keys->keyset == pki_DEVELOPMENT){
Expand All @@ -370,23 +350,13 @@ void accessdesc_GetPresetSigData(u8 **accessDescSig, u8 **cxiPubk, u8 **cxiPvtk,
*cxiPubk = (u8*)app_fw23_prod_hdrpub;
*cxiPvtk = NULL;
}
if(keys->keyset == pki_GATEWAY3DS){
*accessDescSig = (u8*)app_fw23_prod_acexsig;
*cxiPubk = (u8*)app_fw23_prod_hdrpub;
*cxiPvtk = (u8*)app_fw23_prod_hdrpub;
}
break;
case 0x27:
if(keys->keyset == pki_PRODUCTION){
*accessDescSig = (u8*)app_fw27_prod_acexsig;
*cxiPubk = (u8*)app_fw27_prod_hdrpub;
*cxiPvtk = NULL;
}
if(keys->keyset == pki_GATEWAY3DS){
*accessDescSig = (u8*)app_fw27_prod_acexsig;
*cxiPubk = (u8*)app_fw27_prod_hdrpub;
*cxiPvtk = (u8*)app_fw27_prod_hdrpub;
}
break;

}
Expand All @@ -399,23 +369,13 @@ void accessdesc_GetPresetSigData(u8 **accessDescSig, u8 **cxiPubk, u8 **cxiPvtk,
*cxiPubk = (u8*)ecapp_fw20_prod_hdrpub;
*cxiPvtk = NULL;
}
if(keys->keyset == pki_GATEWAY3DS){
*accessDescSig = (u8*)ecapp_fw20_prod_acexsig;
*cxiPubk = (u8*)ecapp_fw20_prod_hdrpub;
*cxiPvtk = (u8*)ecapp_fw20_prod_hdrpub;
}
break;
case 0x23:
if(keys->keyset == pki_PRODUCTION){
*accessDescSig = (u8*)ecapp_fw23_prod_acexsig;
*cxiPubk = (u8*)ecapp_fw23_prod_hdrpub;
*cxiPvtk = NULL;
}
if(keys->keyset == pki_GATEWAY3DS){
*accessDescSig = (u8*)ecapp_fw23_prod_acexsig;
*cxiPubk = (u8*)ecapp_fw23_prod_hdrpub;
*cxiPvtk = (u8*)ecapp_fw23_prod_hdrpub;
}
break;
}
}
Expand Down
25 changes: 0 additions & 25 deletions makerom/keyset.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,31 +170,6 @@ int LoadKeysFromResources(keys_struct *keys)
SetTikCert(keys,(u8*)xsC_ppki_cert);
SetTmdCert(keys,(u8*)cpB_ppki_cert);
}
else if(keys->keyset == pki_GATEWAY3DS){
keys->keysetLoaded = true;
/* AES Keys */
// CIA
if(keys->aes.currentCommonKey > 0xff)
SetCurrentCommonKey(keys,0);

// NCCH
SetNormalKey(keys,(u8*)dev_fixed_ncch_key[0]);
SetSystemFixedKey(keys,(u8*)dev_fixed_ncch_key[0]);

/* RSA Keys */
// CIA
SetTIK_RsaKey(keys,(u8*)xsC_ppki_rsa_priv,(u8*)xsC_ppki_rsa_pub);
SetTMD_RsaKey(keys,(u8*)cpB_ppki_rsa_priv,(u8*)cpB_ppki_rsa_pub);
// CCI/CFA
Set_CCI_CFA_RsaKey(keys,(u8*)prod_ncsd_cfa_priv,(u8*)prod_ncsd_cfa_pub);
// CXI
SetAccessDesc_RsaKey(keys,(u8*)prod_acex_priv,(u8*)prod_acex_pub);

/* Certs */
SetCaCert(keys,(u8*)ca3_ppki_cert);
SetTikCert(keys,(u8*)xsC_ppki_cert);
SetTmdCert(keys,(u8*)cpB_ppki_cert);
}
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion makerom/keyset.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ typedef enum
pki_DEVELOPMENT,
pki_PRODUCTION,
pki_CUSTOM,
pki_GATEWAY3DS
} pki_keyset;

typedef enum
Expand Down
9 changes: 5 additions & 4 deletions makerom/user_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,14 @@ int SetArgument(int argc, int i, char *argv[], user_settings *set)
}
if(strcasecmp(argv[i+1],"test") == 0 || strcasecmp(argv[i+1],"t") == 0)
set->common.keys.keyset = pki_TEST;
//else if(strcasecmp(argv[i+1],"beta") == 0 || strcasecmp(argv[i+1],"b") == 0)
// set->common.keys.keyset = pki_BETA;
else if(strcasecmp(argv[i+1],"debug") == 0 || strcasecmp(argv[i+1],"development") == 0 || strcasecmp(argv[i+1],"d") == 0)
set->common.keys.keyset = pki_DEVELOPMENT;
else if(strcasecmp(argv[i+1],"retail") == 0 || strcasecmp(argv[i+1],"production") == 0 || strcasecmp(argv[i+1],"p") == 0)
set->common.keys.keyset = pki_PRODUCTION;
else if(strcasecmp(argv[i+1],"gw") == 0 || strcasecmp(argv[i+1],"gateway3ds") == 0 || strcasecmp(argv[i+1],"g") == 0)
set->common.keys.keyset = pki_GATEWAY3DS;
//else if(strcasecmp(argv[i+1],"custom") == 0 || strcasecmp(argv[i+1],"c") == 0)
// set->common.keys.keyset = pki_CUSTOM;
else{
fprintf(stderr,"[SETTING ERROR] Unrecognised target '%s'\n",argv[i+1]);
return USR_BAD_ARG;
Expand Down Expand Up @@ -866,11 +868,10 @@ void DisplayHelp(char *app_name)
printf(" -v Verbose output\n");
printf(" -DNAME=VALUE Substitute values in RSF file\n");
printf("KEY OPTIONS:\n");
printf(" -target <t|d|p|g> Target for crypto, defaults to 't'\n");
printf(" -target <t|d|p> Target for crypto, defaults to 't'\n");
printf(" 't' Test(false) Keys & prod Certs\n");
printf(" 'd' Development Keys & Certs\n");
printf(" 'p' Production Keys & Certs\n");
printf(" 'g' Production Keys & Certs for GW3DS only\n");
printf(" -ckeyid <index> Override the automatic common key selection\n");
printf(" -ncchseckey <index> Ncch keyX index ('0'=1.0+, '1'=7.0+)\n");
printf(" -showkeys Display the loaded key chain\n");
Expand Down

0 comments on commit 2e48695

Please sign in to comment.