gpt4 book ai didi

smartcard - EEPROM损坏的症状

转载 作者:行者123 更新时间:2023-12-03 08:08:26 26 4
gpt4 key购买 nike

假设 Java Card 小程序中存在错误:临时字节数组存储在 EEPROM 而不是 RAM 中。此外,假设这个字节数组被每个 APDU 覆盖。

这个错误迟早会损坏卡。

我们可能会出现什么症状?数组中的值不正确而没有任何明确的警告或错误?访问这个数组时抛出一些异常?小程序无法选择?整卡完全没 react ?

卡应该“一劳永逸”地损坏,还是这些故障会越来越频繁地发生?

在我的实验 (J2E145) 中,在 5 000 000 个 APDU 之后出现了第一次故障,其症状是卡根本没有发送 R-APDU 而只是挂掉了。然而,下一个 APDU 再次正常,然后大约 10000 个 APDU 中有 1 个失败(频率增加),最后在 5 100 000 个 APDU 之后,卡永远停止通信。

是否有任何标准规定在 EEPROM 损坏的情况下应该发生什么? (我一直在寻找它,但我没有找到。)

我知道这个问题很广泛,可能取决于特定的芯片(我对 NXP 芯片特别感兴趣),但我认为您的意见、答案和经验可以帮助许多 Java Card 开发人员,他们在他们的代码中发现了一个错误部署后。

最佳答案

我想找到一些非 NDA 信息的最佳方法是针对特定平台的通用标准安全目标。

NXP 硬件平台示例:NXP Secure Smart Card Controllers P5Cx128V0A/P5Cx145V0A, MSO (BSI-DSZ-CC-0645)

  • 来自 TOE 概述:

    The non-volatile EEPROM [...] contains high reliability cells, which guarantee data integrity. [...] Security functionality protects the contents of all memories.

  • 来自安全功能 SF.OPC:

    An exception is forced by the [...] single fault injection detection circuitry. In case minor configuration option "Inverse EEPROM Error Correction" is enabled [...] the probability to detect fault injection errors increases and the error correction logic raises an exception when detecting an error.

  • 来自安全功能 SF.PHY:

    The EEPROM is able to correct a 1-bit error within each byte. [...] The EEPROM corrects errors automatically without user interaction [...]

因此,这个硬件平台能够检测 EEPROM 单元故障,甚至可以自动纠正每个字节中的 1 位错误。对于所有其他检测到的错误,它将引发可由软件处理的异常。

那是针对硬件平台的(没有操作系统/JCRE)。那么让我们看看 JCOP 的安全目标告诉我们什么。我选择了NXP J3A128 and J3A095 Secure Smart Card Controller Rev. 3 (BSI-DSZ-CC-0731) .

  • 来自安全功能 SF.Audit:

    The following reactions by the TOE based on indication of a potential violation of the TSP are possible:

    • Throw an exception
    • Terminate the card (Life cycle state: TERMINATED)
    • Reinitialize the Java Card System (warm reset)
    • [...] The EEPROM is able to correct a 1-bit error within each byte. [...] The EEPROM corrects errors automatically without user interaction [...]
    • Lock the card session (simply stops processing; escape with reset the session/Card tearing)

    Based on these types of response/reaction the events listed above will have the following mapping:

    • EEPROM failure audited through exceptions in the read/write operations and consistency/integrity check: Lock card session
    • self test mechanism on start-up: Lock card session
    • Corruption of check-summed objects: Lock card session
  • 来自安全功能 SF.SecureManagement:

    The TSF run a suite of self-tests during initial start-up (at each power on) to demonstrate the correct operation of the TSF, to verify the integrity of TSF data, and to verify the integrity of stored TSF executable code. This includes checking the EEPROM integrity. If an error is detected, the TOE enters into a secure state (lock card session)

    The TSF monitors user data D.APP_CODE, D.APP_I_DATA, D.PIN, D.APP_KEYs for integrity errors. If an error occurs, the TSF maintain a secure state (lock card session)

所以这个软件平台(再次)能够检测 EEPROM 单元故障,甚至可以自动纠正每个字节中的 1 位错误。对于所有其他检测到 EEPROM 错误,它将“锁定卡 session ”,这意味着它只是停止处理并执行重置。这似乎符合您的观察“症状是卡根本没有发送 R-APDU 就死了”。

关于smartcard - EEPROM损坏的症状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30636485/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com