From c342aeea909f4bd400d20981cfc00707eb791eae Mon Sep 17 00:00:00 2001 From: kubodera_yuichi Date: Thu, 28 Jan 2010 05:02:52 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=82=B9=E3=82=A4?= =?UTF-8?q?=E3=83=83=E3=83=81=E3=81=AB=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0(DEBUG=5FOUTPUT)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@192 ff987cc8-cf2f-4642-8568-d52cce064691 --- trunk/Makefile | 10 ++++++++-- trunk/cr_device_cert.c | 8 ++++---- trunk/cr_generate_id.c | 8 ++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/trunk/Makefile b/trunk/Makefile index 083b648..00ea837 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -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 diff --git a/trunk/cr_device_cert.c b/trunk/cr_device_cert.c index 5e21657..4ed63a7 100644 --- a/trunk/cr_device_cert.c +++ b/trunk/cr_device_cert.c @@ -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 ); diff --git a/trunk/cr_generate_id.c b/trunk/cr_generate_id.c index 19db009..6ecf7b1 100644 --- a/trunk/cr_generate_id.c +++ b/trunk/cr_generate_id.c @@ -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繝舌ャ繝輔ぃ蜈ィ菴薙rAES 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 //-------------------------------------------------------------- // 邨ゆコ蜃ヲ逅