DEENESPTFRRUARHIKOZHNL
CLASSIC Modul: crypto Rolle: heuristic Konfidenz: 80%

SNIP_CLASSIC_CRYPTO_SECTION_7_2_6_1_Writing_keys_to_NVM

Quelle: SWS_CryptoDriver.pdf (Seite 37) • Ziel-Anforderung: SWS_NvM_00470

Wortlaut

7.2.6.1 Writing keys to NVM [SWS_Crypto_00242] Upstream requirements: SRS_CryptoStack_00061 ⌈The storage of keys resp. their elements shall be initiated only when KEYSETVALID" is started, either by a call to Crypto_KeySetValid or to Crypto_ProcessJob with primitive service CRYPTO_KEYSETVALID or CRYPTO_KEYSETINVALID set. Thus, key element storage in NVM shall not be initiated on a call to Crypto_KeyElementSet or similar operation. The storage operation shall only take place if the validation was successfully finished and the operation returns E_OK (either directly by a synchronous call or asynchronously through the callback).⌋ Rationale: Especially when key elements of a key have interdependencies to one or more other key element(s) of the same key, writing the key element immediately when it is set has the risk, that the key itself can be inconsistent. In addition, the explicit initiation of the operation with KEYSETVALID allows the crypto driver to check the consistency and interdependency of all elements and storing will be denied if the check fails. Also, updating several elements of a key will result in a single write operation to NVM and not multiple times for each key element, which can reduce the total number of write operations to NVM. [SWS_Crypto_00243] Upstream requirements: SRS_CryptoStack_00008, SRS_CryptoStack_00118, SRS_CryptoStack_00120 ⌈On KEYSETVALID operation, writing the data block to NVM will be initiated by a call of the crypto driver to NvM_SetRamBlockStatus(). This is the typical operation when the configuration CryptoNvBlock/CryptoNvBlockProcessing is set to DEFERRED. If CryptoNvBlock/CryptoNvBlockProcessing is set to IMMEDIATE, the Crypto Driver will, besides the call to NvM_SetRamBlockStatus(), also call NvM_WriteBlock() immediately afterwards. This will trigger an immediate write of the NV RAM Block to non-volatile memory.⌋ Note: For proper operation it is recommended to set the parameter NvMBlockUseSetRamBlockStatus and NvMSelectBlockForReadAll of the NVM to TRUE. The value NvMSelectBlockForWriteAll shall be set to TRUE if CryptoNvBlockProcessing is set to DEFERRED. [SWS_Crypto_00244] Upstream requirements: SRS_CryptoStack_00008 ⌈If a call to an NVM service (NvM_SetRamBlockStatus() or NvM_WriteBlock()) returns with E_NOT_OK, or when the callback function Crypto_<vi>_<ai>_NvBlock_Callback_<NvBlock> (see [SWS_Crypto_91026]) indicates with Nvm_RequestResultType that the block write operation has failed, the runtime error CRYPTO_E_RE_NVM_ACCESS_FAILED shall be reported to the DET. In addition, the service call shall be requested again on the next execution of Crypto_MainFunction. The number of retries can be limited by the parameter CryptoNvBlock/CryptoNvBlockFailedRetries.⌋ [SWS_Crypto_00245] Upstream requirements: SRS_CryptoStack_00008 ⌈If a key is currently updated in NV RAM Block and has not yet been written by NVM, then this shall be reflected in the key status with CRYPTO_KEYSTATUS_UPDATE_IN_PROGRESS through the Crypto_KeyGetStatus interface.⌋ [SWS_Crypto_00246] Upstream requirements: SRS_CryptoStack_00008, SRS_CryptoStack_00118 ⌈For each configured CryptoNvBlock the Crypto driver shall provide a separate set of Crypto_<vi>_<ai>_NvBlock_xxx_<NvBlock>() functions (xxx refers to Init, ReadFrom, WriteTo and Callback) (see chapter Callback notification). The short name of the CryptoNvBlock container replaces the tag <NvBlock>. The tags <vi> and <ai> are replaced as described in [SWS_Crypto_00012]. These functions shall be set as callbacks in the respective fields of the NvmBlockDescriptor.⌋

Versionen & Provenienz · Zugeordnete Anforderungen

Diese Angaben zeigt der Versions-Explorer.

Begründung & Zuweisungs-Evidenz

NvM_RequestResultType returned by block write callback.

Dokumenten-Herkunft & Rückverfolgbarkeit

Spezifikations-Dokument SWS_CryptoDriver.pdf
Dokumentseite Seite 37
Ziel-Modul crypto (classic)
Ziel-Anforderung SWS_NvM_00470
Semantische Rolle heuristic
Automatisierungs-Konfidenz 0.80