ビルドスイッチにファイル出力オプション追加(DEBUG_OUTPUT)

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@192 ff987cc8-cf2f-4642-8568-d52cce064691
This commit is contained in:
kubodera_yuichi 2010-01-28 05:02:52 +00:00
parent a9d12cf256
commit c342aeea90
3 changed files with 16 additions and 10 deletions

View File

@ -7,13 +7,15 @@
# 最終的なビルドスイッチの設定は、以下の通り。
# DEV_CYGWIN = FALSE
# DEBUG_PRINT = FALSE
# DEBUG_PRINT = FALSE
# DEBUG_OUTPUT = FALSE
# ECDSA_SHA256 = TRUE
# USE_HSM = TRUE
# RESET_HSM = TRUE
DEV_CYGWIN = FALSE
DEBUG_PRINT = FALSE
DEBUG_PRINT = FALSE
DEBUG_OUTPUT = FALSE
ECDSA_SHA256 = TRUE
USE_HSM = TRUE
RESET_HSM = TRUE
@ -127,6 +129,10 @@ ifeq ($(DEBUG_PRINT),TRUE)
CFLAGS += -DDEBUG_PRINT
endif
ifeq ($(DEBUG_OUTPUT),TRUE)
CFLAGS += -DDEBUG_OUTPUT_FILE
endif
ifeq ($(ECDSA_SHA256),TRUE)
CFLAGS += -DECDSA_SHA256
endif

View File

@ -336,14 +336,14 @@ int GenerateCTRDeviceCert( EC_KEY *pECkey, u32 device_id, u8 bonding_option, u8
#endif // USE_HSM
#ifdef DEBUG_DEVICE_CERT_OUTPUT_FILE
#ifdef DEBUG_OUTPUT_FILE
#ifdef ECDSA_SHA256
DebugFileOutput( device_id, "dgst", sha256Buf, 32 );
#else // !ECDSA_SHA256
DebugFileOutput( device_id, "dgst", sha1Buf, 20 );
#endif // ECDSA_SHA256
DebugFileOutput( device_id, "sign", deviceCert.eccSignature, 60 );
#endif // DEBUG_DEVICE_CERT_OUTPUT_FILE
#endif // DEBUG_OUTPUT_FILE
// ECDSA署名検証
{
@ -425,9 +425,9 @@ int GenerateCTRDeviceCert( EC_KEY *pECkey, u32 device_id, u8 bonding_option, u8
DEBUG_PRINT_ARRAY( "padding1:", (const char *)deviceCert.padding1, sizeof(deviceCert.padding1) );
}
#endif // DEBUG_PRINT
#ifdef DEBUG_DEVICE_CERT_OUTPUT_FILE
#ifdef DEBUG_OUTPUT_FILE
DebugFileOutput( device_id, "crt", (const u8 *)&deviceCert, sizeof(CR_DeviceCert) );
#endif // DEBUG_DEVICE_CERT_OUTPUT_FILE
#endif // DEBUG_OUTPUT_FILE
end:
if( NCT2 ) EC_KEY_free( NCT2 );

View File

@ -348,9 +348,9 @@ int cr_generate_id( u32 device_id[CR_NUM_OF_DEVICEID], u8 id_buf[CR_ID_BUF_SIZE]
// FuseID RAWデータ完成
//--------------------------------------------------------------
DEBUG_PRINT_ARRAY( "RAW eFuseID:", (const char *)id_buf, CR_ID_BUF_SIZE );
#ifdef DEBUG_EFUSE_ID_OUTPUT_FILE
#ifdef DEBUG_OUTPUT_FILE
DebugFileOutput( device_id[ 0 ], "raw", id_buf, CR_ID_BUF_SIZE );
#endif // DEBUG_EFUSE_ID_OUTPUT_FILE
#endif // DEBUG_OUTPUT_FILE
//--------------------------------------------------------------
// FuseIDバッファ全体をAES or RSAで暗号化
@ -362,9 +362,9 @@ int cr_generate_id( u32 device_id[CR_NUM_OF_DEVICEID], u8 id_buf[CR_ID_BUF_SIZE]
}
DEBUG_PRINT_ARRAY( "ENC eFuseID:", (const char *)id_buf, CR_ID_BUF_SIZE );
#ifdef DEBUG_EFUSE_ID_OUTPUT_FILE
#ifdef DEBUG_OUTPUT_FILE
DebugFileOutput( device_id[ 0 ], "enc", id_buf, CR_ID_BUF_SIZE );
#endif // DEBUG_EFUSE_ID_OUTPUT_FILE
#endif // DEBUG_OUTPUT_FILE
//--------------------------------------------------------------
// 終了処理