mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-07-04 08:32:15 +02:00
BisPartition_t was missing SAFE, meaning User and System were using wrong key_source
This commit is contained in:
parent
dba0d62ef7
commit
62ec7c800c
@ -196,15 +196,17 @@ void derive_bis_key(void *dst, BisPartition_t partition_id, u32 target_firmware)
|
|||||||
|
|
||||||
static const u8 bis_kek_source[0x10] = {0x34, 0xC1, 0xA0, 0xC4, 0x82, 0x58, 0xF8, 0xB4, 0xFA, 0x9E, 0x5E, 0x6A, 0xDA, 0xFC, 0x7E, 0x4F};
|
static const u8 bis_kek_source[0x10] = {0x34, 0xC1, 0xA0, 0xC4, 0x82, 0x58, 0xF8, 0xB4, 0xFA, 0x9E, 0x5E, 0x6A, 0xDA, 0xFC, 0x7E, 0x4F};
|
||||||
|
|
||||||
|
const int key_source_idx = (partition_id > 2) ? 2 : partition_id;
|
||||||
switch (partition_id) {
|
switch (partition_id) {
|
||||||
case BisPartition_Calibration:
|
case BisPartition_Calibration:
|
||||||
fusee_generate_specific_aes_key(dst, key_source_for_bis[partition_id][0], false, target_firmware);
|
fusee_generate_specific_aes_key(dst, key_source_for_bis[key_source_idx][0], false, target_firmware);
|
||||||
fusee_generate_specific_aes_key(dst + 0x10, key_source_for_bis[partition_id][1], false, target_firmware);
|
fusee_generate_specific_aes_key(dst + 0x10, key_source_for_bis[key_source_idx][1], false, target_firmware);
|
||||||
break;
|
break;
|
||||||
|
case BisPartition_Safe:
|
||||||
case BisPartition_User:
|
case BisPartition_User:
|
||||||
case BisPartition_System:
|
case BisPartition_System:
|
||||||
fusee_generate_personalized_aes_key_for_bis(dst, bis_kek_source, key_source_for_bis[partition_id][0], target_firmware);
|
fusee_generate_personalized_aes_key_for_bis(dst, bis_kek_source, key_source_for_bis[key_source_idx][0], target_firmware);
|
||||||
fusee_generate_personalized_aes_key_for_bis(dst + 0x10, bis_kek_source, key_source_for_bis[partition_id][1], target_firmware);
|
fusee_generate_personalized_aes_key_for_bis(dst + 0x10, bis_kek_source, key_source_for_bis[key_source_idx][1], target_firmware);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
generic_panic();
|
generic_panic();
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
BisPartition_Calibration = 0,
|
BisPartition_Calibration = 0,
|
||||||
BisPartition_User = 1,
|
BisPartition_Safe = 1,
|
||||||
BisPartition_System = 2
|
BisPartition_User = 2,
|
||||||
|
BisPartition_System = 3
|
||||||
} BisPartition_t;
|
} BisPartition_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user