From cb6e08ac4d39ef9f1f18e8dbb3c6a4b88a6a739f Mon Sep 17 00:00:00 2001 From: Aurora Date: Wed, 28 Sep 2016 13:06:48 +0200 Subject: [PATCH] Remove unused key --- source/crypto.c | 5 ++--- source/crypto.h | 2 +- source/installer.c | 4 ++-- source/screen.c | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/source/crypto.c b/source/crypto.c index 24f07ff..9ab89c0 100755 --- a/source/crypto.c +++ b/source/crypto.c @@ -275,11 +275,10 @@ static void sha(void *res, const void *src, u32 size, u32 mode) static u8 __attribute__((aligned(4))) nandCtr[AES_BLOCK_SIZE]; static u8 nandSlot; static u32 fatStart; -const u8 __attribute__((aligned(4))) key2s[4][AES_BLOCK_SIZE] = { +const u8 __attribute__((aligned(4))) key2s[3][AES_BLOCK_SIZE] = { {0x42, 0x3F, 0x81, 0x7A, 0x23, 0x52, 0x58, 0x31, 0x6E, 0x75, 0x8E, 0x3A, 0x39, 0x43, 0x2E, 0xD0}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3B, 0xF5, 0xF6}, - {0x65, 0x29, 0x3E, 0x12, 0x56, 0x0C, 0x0B, 0xD1, 0xDD, 0xB5, 0x63, 0x1C, 0xB6, 0xD9, 0x52, 0x75}, - {0x07, 0x29, 0x44, 0x38, 0xF8, 0xC9, 0x75, 0x93, 0xAA, 0x0E, 0x4A, 0xB4, 0xAE, 0x84, 0xC1, 0xD8} + {0x65, 0x29, 0x3E, 0x12, 0x56, 0x0C, 0x0B, 0xD1, 0xDD, 0xB5, 0x63, 0x1C, 0xB6, 0xD9, 0x52, 0x75} }; void getNandCtr(void) diff --git a/source/crypto.h b/source/crypto.h index 9a0de7c..80e60ba 100755 --- a/source/crypto.h +++ b/source/crypto.h @@ -80,7 +80,7 @@ #define SHA_1_HASH_SIZE (160 / 8) extern bool isN3DS; -const u8 key2s[4][AES_BLOCK_SIZE]; +const u8 key2s[3][AES_BLOCK_SIZE]; void getNandCtr(void); void ctrNandInit(void); diff --git a/source/installer.c b/source/installer.c index b6cb122..2c39a95 100755 --- a/source/installer.c +++ b/source/installer.c @@ -134,8 +134,8 @@ static inline void installer(bool isA9lh, bool isOtpless) if(isA9lh && !isOtpless) { u32 i; - for(i = 0; i < 4; i++) - if(memcmp((void *)(SECTOR_OFFSET + 0x10), key2s[i], 0x10) == 0) break; + for(i = 0; i < 3; i++) + if(memcmp((void *)(SECTOR_OFFSET + AES_BLOCK_SIZE), key2s[i], AES_BLOCK_SIZE) == 0) break; if(i == 4) shutdown(1, "Error: the OTP hash or the NAND key sector\nare invalid"); if(i == 0) updateA9lh = true; diff --git a/source/screen.c b/source/screen.c index 01feaec..5cbf914 100644 --- a/source/screen.c +++ b/source/screen.c @@ -83,7 +83,7 @@ void clearScreens(void) void initScreens(void) { - void __attribute__((naked)) initSequence(void) + void __attribute__((naked)) ARM11(void) { //Disable interrupts __asm(".word 0xF10C01C0"); @@ -189,7 +189,7 @@ void initScreens(void) if(PDN_GPU_CNT == 1) { - invokeArm11Function(initSequence); + invokeArm11Function(ARM11); //Turn on backlight i2cWriteRegister(I2C_DEV_MCU, 0x22, 0x2A);