mirror of
https://github.com/rvtr/ctr_eFuse.git
synced 2025-11-02 00:11:04 -04:00
ビルドスイッチにファイル出力オプション追加(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:
parent
a9d12cf256
commit
c342aeea90
@ -8,12 +8,14 @@
|
|||||||
# 最終的なビルドスイッチの設定は、以下の通り。
|
# 最終的なビルドスイッチの設定は、以下の通り。
|
||||||
# DEV_CYGWIN = FALSE
|
# DEV_CYGWIN = FALSE
|
||||||
# DEBUG_PRINT = FALSE
|
# DEBUG_PRINT = FALSE
|
||||||
|
# DEBUG_OUTPUT = FALSE
|
||||||
# ECDSA_SHA256 = TRUE
|
# ECDSA_SHA256 = TRUE
|
||||||
# USE_HSM = TRUE
|
# USE_HSM = TRUE
|
||||||
# RESET_HSM = TRUE
|
# RESET_HSM = TRUE
|
||||||
|
|
||||||
DEV_CYGWIN = FALSE
|
DEV_CYGWIN = FALSE
|
||||||
DEBUG_PRINT = FALSE
|
DEBUG_PRINT = FALSE
|
||||||
|
DEBUG_OUTPUT = FALSE
|
||||||
ECDSA_SHA256 = TRUE
|
ECDSA_SHA256 = TRUE
|
||||||
USE_HSM = TRUE
|
USE_HSM = TRUE
|
||||||
RESET_HSM = TRUE
|
RESET_HSM = TRUE
|
||||||
@ -127,6 +129,10 @@ ifeq ($(DEBUG_PRINT),TRUE)
|
|||||||
CFLAGS += -DDEBUG_PRINT
|
CFLAGS += -DDEBUG_PRINT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(DEBUG_OUTPUT),TRUE)
|
||||||
|
CFLAGS += -DDEBUG_OUTPUT_FILE
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(ECDSA_SHA256),TRUE)
|
ifeq ($(ECDSA_SHA256),TRUE)
|
||||||
CFLAGS += -DECDSA_SHA256
|
CFLAGS += -DECDSA_SHA256
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -336,14 +336,14 @@ int GenerateCTRDeviceCert( EC_KEY *pECkey, u32 device_id, u8 bonding_option, u8
|
|||||||
|
|
||||||
#endif // USE_HSM
|
#endif // USE_HSM
|
||||||
|
|
||||||
#ifdef DEBUG_DEVICE_CERT_OUTPUT_FILE
|
#ifdef DEBUG_OUTPUT_FILE
|
||||||
#ifdef ECDSA_SHA256
|
#ifdef ECDSA_SHA256
|
||||||
DebugFileOutput( device_id, "dgst", sha256Buf, 32 );
|
DebugFileOutput( device_id, "dgst", sha256Buf, 32 );
|
||||||
#else // !ECDSA_SHA256
|
#else // !ECDSA_SHA256
|
||||||
DebugFileOutput( device_id, "dgst", sha1Buf, 20 );
|
DebugFileOutput( device_id, "dgst", sha1Buf, 20 );
|
||||||
#endif // ECDSA_SHA256
|
#endif // ECDSA_SHA256
|
||||||
DebugFileOutput( device_id, "sign", deviceCert.eccSignature, 60 );
|
DebugFileOutput( device_id, "sign", deviceCert.eccSignature, 60 );
|
||||||
#endif // DEBUG_DEVICE_CERT_OUTPUT_FILE
|
#endif // DEBUG_OUTPUT_FILE
|
||||||
|
|
||||||
// ECDSA署名検証
|
// 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) );
|
DEBUG_PRINT_ARRAY( "padding1:", (const char *)deviceCert.padding1, sizeof(deviceCert.padding1) );
|
||||||
}
|
}
|
||||||
#endif // DEBUG_PRINT
|
#endif // DEBUG_PRINT
|
||||||
#ifdef DEBUG_DEVICE_CERT_OUTPUT_FILE
|
#ifdef DEBUG_OUTPUT_FILE
|
||||||
DebugFileOutput( device_id, "crt", (const u8 *)&deviceCert, sizeof(CR_DeviceCert) );
|
DebugFileOutput( device_id, "crt", (const u8 *)&deviceCert, sizeof(CR_DeviceCert) );
|
||||||
#endif // DEBUG_DEVICE_CERT_OUTPUT_FILE
|
#endif // DEBUG_OUTPUT_FILE
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if( NCT2 ) EC_KEY_free( NCT2 );
|
if( NCT2 ) EC_KEY_free( NCT2 );
|
||||||
|
|||||||
@ -348,9 +348,9 @@ int cr_generate_id( u32 device_id[CR_NUM_OF_DEVICEID], u8 id_buf[CR_ID_BUF_SIZE]
|
|||||||
// FuseID RAWデータ完成
|
// FuseID RAWデータ完成
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
DEBUG_PRINT_ARRAY( "RAW eFuseID:", (const char *)id_buf, CR_ID_BUF_SIZE );
|
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 );
|
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で暗号化
|
// 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 );
|
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 );
|
DebugFileOutput( device_id[ 0 ], "enc", id_buf, CR_ID_BUF_SIZE );
|
||||||
#endif // DEBUG_EFUSE_ID_OUTPUT_FILE
|
#endif // DEBUG_OUTPUT_FILE
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
// 終了処理
|
// 終了処理
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user