SE050C2 サポート追加とキー管理の明確化
変更内容: 1. SE050C2 のサポート追加 - se050_scp03_keys.h: SE050C2 は SE050C1 と同じキーを使用 - test_scp03_se050.c: SE050C2 チップ選択追加 - Makefile: SE050C2 の CHIP_ID=2, SE050E2=3 に更新 2. キー管理の明確化 - test_scp03_se050.c に詳細コメント追加 - キーは実行時置き換えではなく、コンパイル時選択を明記 - 異なるキーでテストするには再コンパイルが必要と説明 3. 使い方の明確化 make SE050_CHIP=SE050C0 test_se050 # SE050C0 キー make SE050_CHIP=SE050C1 test_se050 # SE050C1 キー make SE050_CHIP=SE050C2 test_se050 # SE050C2 キー (SE050C1 と同じ) make SE050_CHIP=SE050E2 test_se050 # SE050E2 キー 注記: - 実行時キー置換機能は未実装 - 動的キー切り替えが必要な場合は、se050_session_scp03_set_keys() を使用して実装可能(現状では各テスト関数でコンパイル時キーを直接使用)
This commit is contained in:
@@ -42,10 +42,12 @@ ifeq ($(SE050_CHIP),SE050C0)
|
|||||||
CHIP_ID = 0
|
CHIP_ID = 0
|
||||||
else ifeq ($(SE050_CHIP),SE050C1)
|
else ifeq ($(SE050_CHIP),SE050C1)
|
||||||
CHIP_ID = 1
|
CHIP_ID = 1
|
||||||
else ifeq ($(SE050_CHIP),SE050E2)
|
else ifeq ($(SE050_CHIP),SE050C2)
|
||||||
CHIP_ID = 2
|
CHIP_ID = 2
|
||||||
|
else ifeq ($(SE050_CHIP),SE050E2)
|
||||||
|
CHIP_ID = 3
|
||||||
else
|
else
|
||||||
$(error Invalid SE050_CHIP. Use SE050C0, SE050C1, or SE050E2)
|
$(error Invalid SE050_CHIP. Use SE050C0, SE050C1, SE050C2, or SE050E2)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
|
|||||||
@@ -23,12 +23,20 @@ extern const uint8_t SE050C0_DEK_KEY[16];
|
|||||||
|
|
||||||
/* ============================================================================
|
/* ============================================================================
|
||||||
* SE050C1 Platform SCP03 Keys
|
* SE050C1 Platform SCP03 Keys
|
||||||
|
*
|
||||||
|
* Note: SE050C2 uses the same PlatformSCP03 keys as SE050C1.
|
||||||
|
* See AN12436 for details.
|
||||||
* ============================================================================ */
|
* ============================================================================ */
|
||||||
|
|
||||||
extern const uint8_t SE050C1_ENC_KEY[16];
|
extern const uint8_t SE050C1_ENC_KEY[16];
|
||||||
extern const uint8_t SE050C1_MAC_KEY[16];
|
extern const uint8_t SE050C1_MAC_KEY[16];
|
||||||
extern const uint8_t SE050C1_DEK_KEY[16];
|
extern const uint8_t SE050C1_DEK_KEY[16];
|
||||||
|
|
||||||
|
/* SE050C2 uses same keys as SE050C1 */
|
||||||
|
#define SE050C2_ENC_KEY SE050C1_ENC_KEY
|
||||||
|
#define SE050C2_MAC_KEY SE050C1_MAC_KEY
|
||||||
|
#define SE050C2_DEK_KEY SE050C1_DEK_KEY
|
||||||
|
|
||||||
/* ============================================================================
|
/* ============================================================================
|
||||||
* SE050E2 Platform SCP03 Keys
|
* SE050E2 Platform SCP03 Keys
|
||||||
* ============================================================================ */
|
* ============================================================================ */
|
||||||
|
|||||||
@@ -29,6 +29,17 @@
|
|||||||
|
|
||||||
/* ============================================================================
|
/* ============================================================================
|
||||||
* Chip Selection and Key Mapping
|
* Chip Selection and Key Mapping
|
||||||
|
*
|
||||||
|
* Important: This test uses chip-specific PlatformSCP03 keys at compile time.
|
||||||
|
* The keys are NOT replaced at runtime - they are selected via SE050_CHIP macro.
|
||||||
|
*
|
||||||
|
* To test with different keys:
|
||||||
|
* make SE050_CHIP=SE050C0 test_se050 # Use SE050C0 default keys
|
||||||
|
* make SE050_CHIP=SE050C1 test_se050 # Use SE050C1 default keys
|
||||||
|
* make SE050_CHIP=SE050E2 test_se050 # Use SE050E2 default keys
|
||||||
|
*
|
||||||
|
* For custom keys, modify se050_scp03_keys.h or pass custom keys at runtime
|
||||||
|
* via se050_session_scp03_set_keys() (not implemented in this test).
|
||||||
* ============================================================================ */
|
* ============================================================================ */
|
||||||
|
|
||||||
#ifndef SE050_CHIP
|
#ifndef SE050_CHIP
|
||||||
@@ -38,7 +49,8 @@
|
|||||||
/* Chip type constants */
|
/* Chip type constants */
|
||||||
#define CHIP_SE050C0 0
|
#define CHIP_SE050C0 0
|
||||||
#define CHIP_SE050C1 1
|
#define CHIP_SE050C1 1
|
||||||
#define CHIP_SE050E2 2
|
#define CHIP_SE050C2 2
|
||||||
|
#define CHIP_SE050E2 3
|
||||||
|
|
||||||
#if SE050_CHIP == CHIP_SE050C0
|
#if SE050_CHIP == CHIP_SE050C0
|
||||||
#define CHIP_NAME "SE050C0"
|
#define CHIP_NAME "SE050C0"
|
||||||
@@ -52,6 +64,12 @@
|
|||||||
#define ENC_KEY SE050C1_ENC_KEY
|
#define ENC_KEY SE050C1_ENC_KEY
|
||||||
#define MAC_KEY SE050C1_MAC_KEY
|
#define MAC_KEY SE050C1_MAC_KEY
|
||||||
#define DEK_KEY SE050C1_DEK_KEY
|
#define DEK_KEY SE050C1_DEK_KEY
|
||||||
|
#elif SE050_CHIP == CHIP_SE050C2
|
||||||
|
#define CHIP_NAME "SE050C2"
|
||||||
|
#define SE050_DEFAULT_I2C_ADDR 0x48 /* 7-bit address */
|
||||||
|
#define ENC_KEY SE050C2_ENC_KEY
|
||||||
|
#define MAC_KEY SE050C2_MAC_KEY
|
||||||
|
#define DEK_KEY SE050C2_DEK_KEY
|
||||||
#elif SE050_CHIP == CHIP_SE050E2
|
#elif SE050_CHIP == CHIP_SE050E2
|
||||||
#define CHIP_NAME "SE050E2"
|
#define CHIP_NAME "SE050E2"
|
||||||
#define SE050_DEFAULT_I2C_ADDR 0x48 /* 7-bit address */
|
#define SE050_DEFAULT_I2C_ADDR 0x48 /* 7-bit address */
|
||||||
@@ -59,7 +77,7 @@
|
|||||||
#define MAC_KEY SE050E2_MAC_KEY
|
#define MAC_KEY SE050E2_MAC_KEY
|
||||||
#define DEK_KEY SE050E2_DEK_KEY
|
#define DEK_KEY SE050E2_DEK_KEY
|
||||||
#else
|
#else
|
||||||
#error "Invalid SE050_CHIP. Use SE050C0, SE050C1, or SE050E2"
|
#error "Invalid SE050_CHIP. Use SE050C0, SE050C1, SE050C2, or SE050E2"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ============================================================================
|
/* ============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user