diff --git a/build/libraries_sysmenu/sysmenu/ARM9/src/title.c b/build/libraries_sysmenu/sysmenu/ARM9/src/title.c index 1bac42a3..5eaa0bf0 100644 --- a/build/libraries_sysmenu/sysmenu/ARM9/src/title.c +++ b/build/libraries_sysmenu/sysmenu/ARM9/src/title.c @@ -26,7 +26,7 @@ #define SYSTEM_APP_KEY_OFFSET 1 // ファームから送られてくるSYSTEMアプリキーのためのオフセット #define LAUNCHER_KEY_OFFSET 0 // ファームから送られてくるLauncherキーのためのオフセット -#define ROM_HEADER_HASH_OFFSET (0x10) // 署名からROMヘッダハッシュを取り出すためのオフセット +#define ROM_HEADER_HASH_OFFSET (0x0) // 署名からROMヘッダハッシュを取り出すためのオフセット #define SIGN_HEAP_ADDR 0x023c0000 // 署名計算のためのヒープ領域開始アドレス #define SIGN_HEAP_SIZE 0x1000 // 署名計算のためのヒープサイズ @@ -675,7 +675,7 @@ static AuthResult SYSMi_AuthenticateTWLHeader( TitleProperty *pBootTitle ) const u8 *key; u32 hi; u8 keynum; - u8 buf[0x80]; + SignatureData sigbuf; u8 calculated_hash[SVC_SHA1_DIGEST_SIZE]; SVCSignHeapContext con; int l; @@ -733,9 +733,9 @@ static AuthResult SYSMi_AuthenticateTWLHeader( TitleProperty *pBootTitle ) } #endif // 署名を鍵で復号 - MI_CpuClear8( buf, 0x80 ); + MI_CpuClear8( &sigbuf, sizeof(sigbuf) ); SVC_InitSignHeap( &con, (void *)SIGN_HEAP_ADDR, SIGN_HEAP_SIZE );// ヒープの初期化 - if( !SVC_DecryptSign( &con, buf, head->signature, key )) + if( !SVC_DecryptSign( &con, sigbuf.digest, head->signature, key )) { OS_TPrintf("Authenticate failed: Sign decryption failed.\n"); if(!b_dev) return AUTH_RESULT_AUTHENTICATE_FAILED; @@ -743,7 +743,7 @@ static AuthResult SYSMi_AuthenticateTWLHeader( TitleProperty *pBootTitle ) // ヘッダのハッシュ(SHA1)計算 SVC_CalcSHA1( calculated_hash, (const void*)head, TWL_ROM_HEADER_HASH_CALC_DATA_LEN ); // 署名のハッシュ値とヘッダのハッシュ値を比較 - if(!SVC_CompareSHA1((const void *)(&buf[ROM_HEADER_HASH_OFFSET]), (const void *)calculated_hash)) + if(!SVC_CompareSHA1(sigbuf.digest, (const void *)calculated_hash)) { OS_TPrintf("Authenticate failed: Sign check failed.\n"); if(!b_dev) return AUTH_RESULT_AUTHENTICATE_FAILED; diff --git a/tools/bin/makegcdfirm.exe b/tools/bin/makegcdfirm.exe index 9881d2e3..b6357b24 100644 Binary files a/tools/bin/makegcdfirm.exe and b/tools/bin/makegcdfirm.exe differ diff --git a/tools/bin/makenandfirm.exe b/tools/bin/makenandfirm.exe index e3092c79..a504a9b9 100644 Binary files a/tools/bin/makenandfirm.exe and b/tools/bin/makenandfirm.exe differ diff --git a/tools/bin/makenorfirm.exe b/tools/bin/makenorfirm.exe index d341d47c..38721908 100644 Binary files a/tools/bin/makenorfirm.exe and b/tools/bin/makenorfirm.exe differ diff --git a/tools/bin/makerom.TWL.shop.exe b/tools/bin/makerom.TWL.shop.exe index 44f5f7ba..391084d7 100644 Binary files a/tools/bin/makerom.TWL.shop.exe and b/tools/bin/makerom.TWL.shop.exe differ diff --git a/tools/bin/makerom.TWL.sys.exe b/tools/bin/makerom.TWL.sys.exe index d8c15fe2..20746b96 100644 Binary files a/tools/bin/makerom.TWL.sys.exe and b/tools/bin/makerom.TWL.sys.exe differ