Skip to content

Commit

Permalink
[MakeROM] Fix InitialData generation bugs (#121)
Browse files Browse the repository at this point in the history
* [makerom] Correctly initialize prod initial_data_key_x

* [makerom] Properly select CCI CryptoType when not manually specified.

* [makerom] Bump version to v0.18.2
  • Loading branch information
jakcron committed Apr 17, 2022
1 parent ea52a5d commit e9a830f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions makerom/src/cardinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,15 @@ int SetCardInfoBitmask(cardinfo_hdr *hdr, cci_settings *set)

str = set->rsf->CardInfo.CryptoType;
if(!str) {
if(set->options.useExternalSdkCardInfo)
bitmask |= (3 << 6);
else
bitmask |= 0;
u32 val = 0;
if(set->keys->keyset == pki_DEVELOPMENT) {
val = 3;
}
else{
val = 0;
}

bitmask |= (val << 6);
}
else{
int val = strtol(str,NULL,10);
Expand Down
2 changes: 1 addition & 1 deletion makerom/src/keyset.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int LoadKeysFromResources(keys_struct *keys)
SetNcchKeyX(keys, prod_unfixed_ncch_keyX[i],i);

// CCI
SetCciInitialDataKeyX(keys, dev_initial_data_keyx);
SetCciInitialDataKeyX(keys, prod_initial_data_keyx);

/* RSA Keys */
// CIA
Expand Down
2 changes: 1 addition & 1 deletion makerom/src/ncsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ int GenCciHdr(cci_settings *set)
// Sign Header
if (Rsa2048Key_CanSign(&set->keys->rsa.cciCfa) == false)
{
printf("[NCSD WARNING] Failed to sign header\n");
printf("[NCSD WARNING] Failed to sign header (key was incomplete)\n");
memset(hdr->signature, 0xFF, 0x100);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion makerom/src/user_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ void PrintNoNeedParam(char *arg)

void DisplayBanner(void)
{
printf("CTR MAKEROM v0.18.1 (C) 3DSGuy 2022\n");
printf("CTR MAKEROM v0.18.2 (C) 3DSGuy 2022\n");
printf("Built: %s %s\n\n", __TIME__, __DATE__);
}

Expand Down

0 comments on commit e9a830f

Please sign in to comment.