From 5955f2c920f7b82142b7b5089e289e380b8d971c Mon Sep 17 00:00:00 2001 From: sato_masaki Date: Tue, 19 Feb 2008 12:43:12 +0000 Subject: [PATCH] =?UTF-8?q?BondingOption=E3=81=8CARM9/ARM7=E3=81=AE?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=80=81=E7=BD=B2=E5=90=8D=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=8C=E5=A4=B1=E6=95=97=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=82=82=E5=87=A6=E7=90=86=E3=82=92=E7=B6=9A=E8=A1=8C=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4=E3=80=82?= =?UTF-8?q?(TWL=E7=84=A1=E7=B7=9A=E3=83=95=E3=82=A1=E3=83=BC=E3=83=A0?= =?UTF-8?q?=E3=82=A6=E3=82=A7=E3=82=A2=E9=96=8B=E7=99=BA=E7=94=A8)=20acsig?= =?UTF-8?q?n=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E5=89=8A=E9=99=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@699 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../Launcher/ARM9/src/loadWlanFirm.c | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/build/systemMenu_RED/Launcher/ARM9/src/loadWlanFirm.c b/build/systemMenu_RED/Launcher/ARM9/src/loadWlanFirm.c index 4da32c01..5ff96255 100644 --- a/build/systemMenu_RED/Launcher/ARM9/src/loadWlanFirm.c +++ b/build/systemMenu_RED/Launcher/ARM9/src/loadWlanFirm.c @@ -32,7 +32,6 @@ /* Index of public key for WLAN firm */ #define WLANFIRM_PUBKEY_INDEX 1 -#define USE_ACSIGN 0 /* for experimental purpose */ #define SIGN_LENGTH 128 #define FWBUFFER_SIZE 0x40000 @@ -48,6 +47,11 @@ static void nwmCallback(void* arg); static s32 readFirmwareBinary(u8 *buffer, s32 bufSize); static BOOL verifyWlanfirmSignature(u8* buffer, u32 length); +static inline u16 SCFG_GetBondingOption(void) +{ + return (u16)(*(u8*)(HW_SYS_CONF_BUF+HWi_WSYS08_OFFSET) & HWi_WSYS08_OP_OPT_MASK); +} + void nwmCallback(void* arg) { @@ -196,24 +200,23 @@ BOOL verifyWlanfirmSignature(u8* buffer, u32 length) OS_TPrintf("\n"); /* decrypt according to RSA security */ -#if ( USE_ACSIGN == 1) - ACSign_SetAllocFunc( SYSM_Alloc, SYSM_Free ); -#else signHeap = SYSM_Alloc( SIGNHEAP_SIZE ); SVC_InitSignHeap( &rctx, signHeap, SIGNHEAP_SIZE); -#endif MI_CpuClear8( signDigest, 0x80 ); -#if ( USE_ACSIGN == 1) - ACSign_Decrypto(signDigest, (void*)pSign, (void*)pPubkey); -#else if (FALSE == SVC_DecryptSign( &rctx, signDigest, (const void*)pSign, (const void*)pPubkey )) { - SYSM_Free(signHeap); - return FALSE; + OS_TPrintf("Wlan Firmware authentication has failed.\n"); + /* continue verifying process even though decryption fails + in the case of bonding option = 0x01 (support ARM9/ARM7) */ + if (!( HWi_WSYS08_OP_OP0_MASK == SCFG_GetBondingOption() )) + { + SYSM_Free(signHeap); + return FALSE; + } + OS_TPrintf("But installation continues.\n"); } -#endif SYSM_Free(signHeap); @@ -224,10 +227,17 @@ BOOL verifyWlanfirmSignature(u8* buffer, u32 length) } OS_TPrintf("\n"); - /* verify digest */ - if (FALSE == SVC_CompareSHA1( (const void*)txtDigest, (const void*)signDigest )) + /* + skip comparing SHA1 digests in the case of bonding option = 0x01 (support ARM9/ARM7) + this restriction is for debugging TWL wireless firmware. + */ + if (!( HWi_WSYS08_OP_OP0_MASK == SCFG_GetBondingOption() )) { - return FALSE; + /* verify digest */ + if (FALSE == SVC_CompareSHA1( (const void*)txtDigest, (const void*)signDigest )) + { + return FALSE; + } } #if (MEASURE_VERIFY_SIGN_TIME == 1)