1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-22 10:16:39 +00:00

keys: use dev.keys instead of prod.keys under dev units.

This commit is contained in:
Pablo Curiel 2022-02-10 19:05:07 +01:00
parent ffe327b868
commit c99f6776a7
2 changed files with 7 additions and 5 deletions

View file

@ -92,7 +92,8 @@
#define NRO_PATH DEVOPTAB_SDMC_DEVICE APP_BASE_PATH NRO_NAME
#define NRO_TMP_PATH NRO_PATH ".tmp"
#define KEYS_FILE_PATH DEVOPTAB_SDMC_DEVICE HBMENU_BASE_PATH "prod.keys" /* Location used by Lockpick_RCM. */
#define PROD_KEYS_FILE_PATH DEVOPTAB_SDMC_DEVICE HBMENU_BASE_PATH "prod.keys" /* Location used by Lockpick_RCM for retail unit keys. */
#define DEV_KEYS_FILE_PATH DEVOPTAB_SDMC_DEVICE HBMENU_BASE_PATH "dev.keys" /* Location used by Lockpick_RCM for development unit keys. */
#define LOG_FILE_NAME APP_TITLE ".log"
#define LOG_BUF_SIZE 0x400000 /* 4 MiB. */

View file

@ -812,11 +812,12 @@ static bool keysReadKeysFromFile(void)
char *key = NULL, *value = NULL;
char test_name[0x40] = {0};
bool parse_fail = false, eticket_rsa_kek_available = false;
const char *keys_file_path = (utilsIsDevelopmentUnit() ? DEV_KEYS_FILE_PATH : PROD_KEYS_FILE_PATH);
keys_file = fopen(KEYS_FILE_PATH, "rb");
keys_file = fopen(keys_file_path, "rb");
if (!keys_file)
{
LOG_MSG("Unable to open \"%s\" to retrieve keys!", KEYS_FILE_PATH);
LOG_MSG("Unable to open \"%s\" to retrieve keys!", keys_file_path);
return false;
}
@ -887,13 +888,13 @@ static bool keysReadKeysFromFile(void)
if (parse_fail || !key_count)
{
if (!key_count) LOG_MSG("Unable to parse necessary keys from \"%s\"! (keys file empty?).", KEYS_FILE_PATH);
if (!key_count) LOG_MSG("Unable to parse necessary keys from \"%s\"! (keys file empty?).", keys_file_path);
return false;
}
if (!eticket_rsa_kek_available)
{
LOG_MSG("\"eticket_rsa_kek\" unavailable in \"%s\"!", KEYS_FILE_PATH);
LOG_MSG("\"eticket_rsa_kek\" unavailable in \"%s\"!", keys_file_path);
return false;
}