From 15c929a0e43861bf1b77c86ac3fbdf41be34301b Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 13 Apr 2020 23:35:52 -0700 Subject: [PATCH] fusee: add support for 10.0.0 --- fusee/fusee-secondary/src/key_derivation.c | 1 + fusee/fusee-secondary/src/nxboot.c | 2 ++ fusee/fusee-secondary/src/package2.c | 2 +- fusee/fusee-secondary/src/package2.h | 6 ++++-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fusee/fusee-secondary/src/key_derivation.c b/fusee/fusee-secondary/src/key_derivation.c index 567490305..1fc808b26 100644 --- a/fusee/fusee-secondary/src/key_derivation.c +++ b/fusee/fusee-secondary/src/key_derivation.c @@ -160,6 +160,7 @@ int derive_nx_keydata(uint32_t target_firmware, const nx_keyblob_t *keyblobs, ui desired_keyblob = MASTERKEY_REVISION_900; /* Fallthrough */ case ATMOSPHERE_TARGET_FIRMWARE_910: + case ATMOSPHERE_TARGET_FIRMWARE_1000: desired_keyblob = MASTERKEY_REVISION_910_CURRENT; break; default: diff --git a/fusee/fusee-secondary/src/nxboot.c b/fusee/fusee-secondary/src/nxboot.c index a10cc566c..35f8c77c7 100644 --- a/fusee/fusee-secondary/src/nxboot.c +++ b/fusee/fusee-secondary/src/nxboot.c @@ -232,6 +232,8 @@ static uint32_t nxboot_get_target_firmware(const void *package1loader) { return ATMOSPHERE_TARGET_FIRMWARE_900; } else if (memcmp(package1loader_header->build_timestamp, "20191021", 8) == 0) { return ATMOSPHERE_TARGET_FIRMWARE_910; + } else if (memcmp(package1loader_header->build_timestamp, "20200303", 8) == 0) { + return ATMOSPHERE_TARGET_FIRMWARE_1000; } else { fatal_error("[NXBOOT] Unable to identify package1!\n"); } diff --git a/fusee/fusee-secondary/src/package2.c b/fusee/fusee-secondary/src/package2.c index 543d962fb..2903b88a2 100644 --- a/fusee/fusee-secondary/src/package2.c +++ b/fusee/fusee-secondary/src/package2.c @@ -232,7 +232,7 @@ static bool package2_validate_metadata(package2_meta_t *metadata, uint8_t data[] /* Perform version checks. */ /* We will be compatible with all package2s released before current, but not newer ones. */ - if (metadata->version_max >= PACKAGE2_MINVER_THEORETICAL && metadata->version_min < PACKAGE2_MAXVER_910_CURRENT) { + if (metadata->version_max >= PACKAGE2_MINVER_THEORETICAL && metadata->version_min < PACKAGE2_MAXVER_1000_CURRENT) { return true; } diff --git a/fusee/fusee-secondary/src/package2.h b/fusee/fusee-secondary/src/package2.h index 9e6206ee3..e2f89f3a4 100644 --- a/fusee/fusee-secondary/src/package2.h +++ b/fusee/fusee-secondary/src/package2.h @@ -39,7 +39,8 @@ #define PACKAGE2_MAXVER_700_800 0xA #define PACKAGE2_MAXVER_810 0xB #define PACKAGE2_MAXVER_900 0xC -#define PACKAGE2_MAXVER_910_CURRENT 0xD +#define PACKAGE2_MAXVER_910_920 0xD +#define PACKAGE2_MAXVER_1000_CURRENT 0xE #define PACKAGE2_MINVER_100 0x3 #define PACKAGE2_MINVER_200 0x4 @@ -52,7 +53,8 @@ #define PACKAGE2_MINVER_700_800 0xB #define PACKAGE2_MINVER_810 0xC #define PACKAGE2_MINVER_900 0xD -#define PACKAGE2_MINVER_910_CURRENT 0xE +#define PACKAGE2_MINVER_910_920 0xE +#define PACKAGE2_MINVER_1000_CURRENT 0xF #define NX_BOOTLOADER_PACKAGE2_LOAD_ADDRESS ((void *)(0xA9800000ull))