HWセキュア情報を先、HWノーマル情報を後で書き込むように変更。(移行可能なユニークID新設への対応)

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@1502 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
kamikawa 2008-05-23 10:33:46 +00:00
parent 6366d977fd
commit 317a657116
4 changed files with 51 additions and 57 deletions

View File

@ -193,23 +193,12 @@ void HWInfoWriterMain( void )
// HW情報全体のライト // HW情報全体のライト
static void WriteHWInfoFile( u8 region, BOOL isDisableWireless ) static void WriteHWInfoFile( u8 region, BOOL isDisableWireless )
{ {
static const u16 *pMsgNormalWriting = (const u16 *)L"Writing Normal File...";
static const u16 *pMsgSecureWriting = (const u16 *)L"Writing Secure File..."; static const u16 *pMsgSecureWriting = (const u16 *)L"Writing Secure File...";
static const u16 *pMsgNormalWriting = (const u16 *)L"Writing Normal File...";
static const u16 *pMsgHWIDSignWriting = (const u16 *)L"Writing HWID Sign File..."; static const u16 *pMsgHWIDSignWriting = (const u16 *)L"Writing HWID Sign File...";
static const u16 *pMsgSucceeded = (const u16 *)L"Succeeded!"; static const u16 *pMsgSucceeded = (const u16 *)L"Succeeded!";
static const u16 *pMsgFailed = (const u16 *)L"Failed!"; static const u16 *pMsgFailed = (const u16 *)L"Failed!";
// -------------------------------------
// ノーマルファイルのライト
// -------------------------------------
(void)PutStringUTF16( MSG_X * 8, MSG_Y * 8, TXT_COLOR_BLACK, pMsgNormalWriting );
if( HWI_WriteHWNormalInfoFile() ) {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, MSG_Y * 8, TXT_COLOR_BLUE, pMsgSucceeded );
}else {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, MSG_Y * 8, TXT_COLOR_RED, pMsgFailed );
}
// ------------------------------------- // -------------------------------------
// セキュアファイルのライト // セキュアファイルのライト
// ------------------------------------- // -------------------------------------
@ -221,6 +210,17 @@ static void WriteHWInfoFile( u8 region, BOOL isDisableWireless )
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, ( MSG_Y + 2 ) * 8, TXT_COLOR_RED, pMsgFailed ); (void)PutStringUTF16( ( MSG_X + 20 ) * 8, ( MSG_Y + 2 ) * 8, TXT_COLOR_RED, pMsgFailed );
} }
// -------------------------------------
// ノーマルファイルのライト (移行可能なユニークIDのためセキュアファイルの後でライトする
// -------------------------------------
(void)PutStringUTF16( MSG_X * 8, MSG_Y * 8, TXT_COLOR_BLACK, pMsgNormalWriting );
if( HWI_WriteHWNormalInfoFile() ) {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, MSG_Y * 8, TXT_COLOR_BLUE, pMsgSucceeded );
}else {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, MSG_Y * 8, TXT_COLOR_RED, pMsgFailed );
}
// ------------------------------------- // -------------------------------------
// HWID署名ファイルのライト // HWID署名ファイルのライト
// ------------------------------------- // -------------------------------------
@ -248,22 +248,12 @@ static void WriteHWInfoFile( u8 region, BOOL isDisableWireless )
// HWInfoファイルの削除 // HWInfoファイルの削除
static void DeleteHWInfoFile( void ) static void DeleteHWInfoFile( void )
{ {
static const u16 *pMsgNormalDeleting = (const u16 *)L"Deleting Normal File...";
static const u16 *pMsgSecureDeleting = (const u16 *)L"Deteting Secure File..."; static const u16 *pMsgSecureDeleting = (const u16 *)L"Deteting Secure File...";
static const u16 *pMsgNormalDeleting = (const u16 *)L"Deleting Normal File...";
static const u16 *pMsgHWIDSignDeleting = (const u16 *)L"Deteting HWID Sign File."; static const u16 *pMsgHWIDSignDeleting = (const u16 *)L"Deteting HWID Sign File.";
static const u16 *pMsgSucceeded = (const u16 *)L"Succeeded!"; static const u16 *pMsgSucceeded = (const u16 *)L"Succeeded!";
static const u16 *pMsgFailed = (const u16 *)L"Failed!"; static const u16 *pMsgFailed = (const u16 *)L"Failed!";
// -------------------------------------
// ノーマルファイルの削除
// -------------------------------------
(void)PutStringUTF16( MSG_X * 8, MSG_Y * 8, TXT_COLOR_BLACK, pMsgNormalDeleting );
if( HWI_DeleteHWNormalInfoFile() ) {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, MSG_Y * 8, TXT_COLOR_BLUE, pMsgSucceeded );
}else {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, MSG_Y * 8, TXT_COLOR_RED, pMsgFailed );
}
// ------------------------------------- // -------------------------------------
// セキュアファイルの削除 // セキュアファイルの削除
// ------------------------------------- // -------------------------------------
@ -274,6 +264,16 @@ static void DeleteHWInfoFile( void )
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, ( MSG_Y + 2 ) * 8, TXT_COLOR_RED, pMsgFailed ); (void)PutStringUTF16( ( MSG_X + 20 ) * 8, ( MSG_Y + 2 ) * 8, TXT_COLOR_RED, pMsgFailed );
} }
// -------------------------------------
// ノーマルファイルの削除
// -------------------------------------
(void)PutStringUTF16( MSG_X * 8, MSG_Y * 8, TXT_COLOR_BLACK, pMsgNormalDeleting );
if( HWI_DeleteHWNormalInfoFile() ) {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, MSG_Y * 8, TXT_COLOR_BLUE, pMsgSucceeded );
}else {
(void)PutStringUTF16( ( MSG_X + 20 ) * 8, MSG_Y * 8, TXT_COLOR_RED, pMsgFailed );
}
// ------------------------------------- // -------------------------------------
// HWID署名ファイルの削除 // HWID署名ファイルの削除
// ------------------------------------- // -------------------------------------

View File

@ -24,7 +24,7 @@
#include "hwi.h" #include "hwi.h"
// define data------------------------------------------ // define data------------------------------------------
#ifdef FIRM_USE_PRODUCT_KEYS // Œ®IðƒXƒCƒbƒ` #ifdef FIRM_USE_PRODUCT_KEYS // Œ®IðƒXƒCƒbƒ`
#define HWINFO_PRIVKEY_PATH "rom:key/private_HWInfo.der" // 製品用秘密鍵 #define HWINFO_PRIVKEY_PATH "rom:key/private_HWInfo.der" // 製品用秘密鍵
#else #else
#define HWINFO_PRIVKEY_PATH "rom:key/private_HWInfo_dev.der" // 開発用秘密鍵 #define HWINFO_PRIVKEY_PATH "rom:key/private_HWInfo_dev.der" // 開発用秘密鍵
@ -197,7 +197,14 @@ static BOOL ReadHWInfoFile( void )
{ {
LCFGReadResult retval; LCFGReadResult retval;
BOOL result = TRUE; BOOL result = TRUE;
OSTick start = OS_GetTick();
retval = LCFGi_THW_ReadSecureInfo();
if( retval == LCFG_TSF_READ_RESULT_SUCCEEDED ) {
OS_TPrintf( "HW Secure Info read succeeded.\n" );
}else {
result = FALSE;
OS_TPrintf( "HW Secure Info read failed.\n" );
}
retval = LCFGi_THW_ReadNormalInfo(); retval = LCFGi_THW_ReadNormalInfo();
if( retval == LCFG_TSF_READ_RESULT_SUCCEEDED ) { if( retval == LCFG_TSF_READ_RESULT_SUCCEEDED ) {
@ -207,35 +214,22 @@ static BOOL ReadHWInfoFile( void )
OS_TPrintf( "HW Normal Info read failed.\n" ); OS_TPrintf( "HW Normal Info read failed.\n" );
} }
// OS_TPrintf( "HW Normal Info read time = %dms\n", OS_TicksToMilliSeconds( OS_GetTick() - start ) );
start = OS_GetTick();
retval = LCFGi_THW_ReadSecureInfo();
if( retval == LCFG_TSF_READ_RESULT_SUCCEEDED ) {
OS_TPrintf( "HW Secure Info read succeeded.\n" );
}else {
result = FALSE;
OS_TPrintf( "HW Secure Info read failed.\n" );
}
// OS_TPrintf( "HW Secure Info read time = %dms\n", OS_TicksToMilliSeconds( OS_GetTick() - start ) );
return result; return result;
} }
// HWInfoファイルのベリファイ // HWInfoファイルのベリファイ
static void VerifyHWInfo( void ) static void VerifyHWInfo( void )
{ {
if( VerifyData( (const u8 *)LCFG_THW_GetNormalInfo(), (const u8 *)LCFG_THW_GetDefaultNormalInfo(), sizeof(LCFGTWLHWNormalInfo) ) ) {
OS_TPrintf( "HW normal Info verify succeeded.\n" );
}else {
OS_TPrintf( "HW normal Info verify failed.\n" );
}
if( VerifyData( (const u8 *)LCFG_THW_GetSecureInfo(), (const u8 *)LCFG_THW_GetDefaultSecureInfo(), sizeof(LCFGTWLHWSecureInfo) ) ) { if( VerifyData( (const u8 *)LCFG_THW_GetSecureInfo(), (const u8 *)LCFG_THW_GetDefaultSecureInfo(), sizeof(LCFGTWLHWSecureInfo) ) ) {
OS_TPrintf( "HW secure Info verify succeeded.\n" ); OS_TPrintf( "HW secure Info verify succeeded.\n" );
}else { }else {
OS_TPrintf( "HW secure Info verify failed.\n" ); OS_TPrintf( "HW secure Info verify failed.\n" );
} }
if( VerifyData( (const u8 *)LCFG_THW_GetNormalInfo(), (const u8 *)LCFG_THW_GetDefaultNormalInfo(), sizeof(LCFGTWLHWNormalInfo) ) ) {
OS_TPrintf( "HW normal Info verify succeeded.\n" );
}else {
OS_TPrintf( "HW normal Info verify failed.\n" );
}
} }
// メモリ上のデータベリファイ // メモリ上のデータベリファイ
@ -270,7 +264,7 @@ BOOL HWI_ModifyLanguage( u8 region )
if (!ReadTWLSettings()) if (!ReadTWLSettings())
{ {
result = FALSE; result = FALSE;
OS_TPrintf( "HW Normal Info read failed.\n" ); OS_TPrintf( "Read TWLSettings failed.\n" );
} }
if( langBitmap & ( 0x0001 << nowLanguage ) ) { if( langBitmap & ( 0x0001 << nowLanguage ) ) {

View File

@ -284,28 +284,28 @@ void* HWInfoProcess2(void)
BOOL WriteHWInfoFile( u8 region, BOOL wirelessForceOff ) BOOL WriteHWInfoFile( u8 region, BOOL wirelessForceOff )
{ {
static const char *pMsgNormalWriting = "Writing Normal File...";
static const char *pMsgSecureWriting = "Writing Secure File..."; static const char *pMsgSecureWriting = "Writing Secure File...";
static const char *pMsgNormalWriting = "Writing Normal File...";
static const char *pMsgSignWriting = "Writing Sign File..."; static const char *pMsgSignWriting = "Writing Sign File...";
static const char *pMsgSucceeded = "Success!\n"; static const char *pMsgSucceeded = "Success!\n";
static const char *pMsgFailed = "Failed!\n"; static const char *pMsgFailed = "Failed!\n";
u32 installedSoftBoxCount = 0; u32 installedSoftBoxCount = 0;
BOOL result = TRUE; BOOL result = TRUE;
// ノーマルファイルのライト // セキュアファイルのライト
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgNormalWriting ); kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSecureWriting );
if( HWI_WriteHWNormalInfoFile() ) { if( HWI_WriteHWSecureInfoFile( region, NULL, wirelessForceOff ) ) {
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded ); kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else { }else {
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed ); kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );
result = FALSE; result = FALSE;
} }
// セキュアファイルのライト // ノーマルファイルのライト(移行可能なユニークIDのためにセキュアファイルの後で書き込む
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSecureWriting ); kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgNormalWriting );
if( HWI_WriteHWSecureInfoFile( region, NULL, wirelessForceOff ) ) { // とりあえず無線は有効で。 if( HWI_WriteHWNormalInfoFile() ) {
kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded ); kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else { }else {
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed ); kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );

View File

@ -61,24 +61,24 @@ BOOL DeleteHWInfoFile( void );
BOOL WriteHWInfoFile( u8 region, BOOL wirelessForceOff ) BOOL WriteHWInfoFile( u8 region, BOOL wirelessForceOff )
{ {
static const char *pMsgNormalWriting = "Writing Normal File...";
static const char *pMsgSecureWriting = "Writing Secure File..."; static const char *pMsgSecureWriting = "Writing Secure File...";
static const char *pMsgNormalWriting = "Writing Normal File...";
static const char *pMsgSignWriting = "Writing Sign File..."; static const char *pMsgSignWriting = "Writing Sign File...";
static const char *pMsgSucceeded = "Success!\n"; static const char *pMsgSucceeded = "Success!\n";
static const char *pMsgFailed = "Failed!\n"; static const char *pMsgFailed = "Failed!\n";
u32 installedSoftBoxCount = 0; u32 installedSoftBoxCount = 0;
BOOL result = TRUE; BOOL result = TRUE;
// ノーマルファイルのライト // セキュアファイルのライト
if( HWI_WriteHWNormalInfoFile() ) { if( HWI_WriteHWSecureInfoFile( region, NULL, wirelessForceOff ) ) { // とりあえず無線は有効で。
// kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded ); // kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else { }else {
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed ); kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );
result = FALSE; result = FALSE;
} }
// セキュアファイルのライト // ノーマルファイルのライト(移行可能なユニークIDのためにセキュアファイルの後で書き込む
if( HWI_WriteHWSecureInfoFile( region, NULL, wirelessForceOff ) ) { // とりあえず無線は有効で。 if( HWI_WriteHWNormalInfoFile() ) {
// kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded ); // kamiFontPrintfConsoleEx(CONSOLE_ORANGE, pMsgSucceeded );
}else { }else {
kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed ); kamiFontPrintfConsoleEx(CONSOLE_RED, pMsgFailed );