RAM KEY loading with Crypto_43_HSE RTD v5.0.0

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

RAM KEY loading with Crypto_43_HSE RTD v5.0.0

ソリューションへジャンプ
648件の閲覧回数
strofald
Contributor III

Hello,

I am using Crypto_43_HSE RTD v5.0.0.
I want to load a new RAM_KEY in the HSE.

I configured the RAM Key in the following way:
CryptoKeyType is formed by: CipherProof, KeyMaterial, MacProof.

RAM KEY Key Material is configured as:

strofald_0-1745316998376.png

(no HseKeyFlags are configured)
with the related ram key catalog:

strofald_2-1745317044275.png

accessible by both MU instances 0 and 1.

I am trying to import the RAM Key as an encrypted key, thus by using calculation of M1M2M3. I am able to calculate M1, M2 and M3 correctly (I already checked the correctness by trying to import the NvM catalog keys and the import was successful).
The M1M2M3 values I have are configured according to the following parameters:

new_key=b'\xAB\xAB\xAB\xAB\xAB\xAB\xAB\xAB\xAB\xAB\xAB\xAB\xAB\xAB\xAB\xAB' #key I want to import
auth_key=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F' #my master key
uid="000000000000000000000000000000"
new_key_id=AutosarKeySlots.RAM_KEY (0x0E)
auth_key_id=AutosarKeySlots.MASTER_ECU_KEY (0x01)
counter=1
flags.fid = 0 # all flags set to zero

 

the calculated M1M2M3 values are:
static uint8 sKeyUpdateM1M2M3[64u] __attribute__((aligned)) =
{
/* M1 */
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe1,
/* M2 */
0x2b, 0x11, 0x1e, 0x2d, 0x93, 0xf4, 0x86, 0x56, 0x6b, 0xcb, 0xba, 0x1d, 0x7f, 0x7a, 0x97, 0x97, 0x29, 0x8d, 0x4e, 0xa0, 0x6, 0xa2, 0x80, 0xc1, 0x5d, 0xd2, 0xa3, 0xe5, 0x6f, 0x4f, 0x5b, 0x6,
/* M3 */
0x4c, 0x1b, 0xcb, 0x77, 0x87, 0xb3, 0x9, 0x19, 0xfb, 0x6e, 0x73, 0x9c, 0xa6, 0xab, 0x48, 0xf4,
};
When I try to call the Crypto_43_HSE_KeyElementSet with the cryptoKeyId=CryptoConf_CryptoKey_CryptoKey_SHE_RAM_KEY and by using the M1M2M3 values that I provided above, I get the result code =0x09 that should mean CRYPTO_E_KEY_NOT_VALID, returned upon HSE responding with status code HSE_SRV_RSP_KEY_INVALID.
What could be the cause of this issue? Is there any configuration step that I have missed?
Kind regards

タグ(3)
0 件の賞賛
返信
1 解決策
642件の閲覧回数
strofald
Contributor III

I solved the problem by changing the parameters used to calculate M1M2M3. According to AUTOSAR standard, the RAM Key must have flags and counter set to zero, and it can be updated only by using one of the other KEY_n (KEY1...KEY10) as authentication keys. By doing so, I was able to load the RAM Key correctly.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
643件の閲覧回数
strofald
Contributor III

I solved the problem by changing the parameters used to calculate M1M2M3. According to AUTOSAR standard, the RAM Key must have flags and counter set to zero, and it can be updated only by using one of the other KEY_n (KEY1...KEY10) as authentication keys. By doing so, I was able to load the RAM Key correctly.

0 件の賞賛
返信
646件の閲覧回数
strofald
Contributor III

Also, I just wanted to add that I performed the HSE KeyCatalog formatting just one time at the HSE installation. At startup I only perform the Crypto_43_HSE_Init.

0 件の賞賛
返信