STSAFE A120: Reprovisioning is successful, but returns error STSE_INVALID_C_MAC
Maintainer thường phản hồi trong vòng 1 ngày
@Grom- đang làm issue này rồi.
Từ ngày 14/11/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Hello,
in our setup, we allow host key reprovisioning.
These are our provisioning control fields:
provisioningControlFields.change_right = 0; // The control fields can only be set once!
provisioningControlFields.reprovision = 1; // Allow reprovisioning.
provisioningControlFields.plaintext = 0; // Do not allow plain text.
provisioningControlFields.wrapped_anonymous = 1; // We are using DH derived KEK.
provisioningControlFields.wrapped_or_DH_derived_authentication_key = 0xFF; // Do not use private/public keys when starting a KEK session.
Then, we are using host key slot V2 and provision the host session keys with a 128-Bit AES key:
stse_host_key_provisioning_wrapped(context, STSAFEA_AES_128_HOST_KEY, aes128keys, STSE_ECC_KT_NIST_P_384);
Next we activate the command access condition for all commands to STSE_CMD_AC_HOST and set the host encryption flags to STSE_HOST_ENCRYPT_ALL.
Afterwards everything works as expected, the Host C-MAC and R-MAC are used for all commands and Host C-encryption/R-encryption are active for all commands.
But now comes the problem: When we reprovision the device with a call to
stse_host_key_provisioning_wrapped(context, STSAFEA_AES_256_HOST_KEY, aes256keys, STSE_ECC_KT_NIST_P_384);
the return value is STSE_INVALID_C_MAC, indicating that the provisioning failed.
However, this is not the case: the STSAFE has accepted the new keys and is using them.
I have digged a little deeper and found that the CMAC counter is stored in the session object in the device.
When a new host key is provisioned, stsafea_stop_volatile_KEK_session() is called.
It seems that the STSAFE is resetting the internal CMAC when a new host key is sent, however when stsafea_stop_volatile_KEK_session() is called at the end of the reprovisioning process STSELib is using the CMAC value of the current session and the STSAFE uses the resetted value and thus returns STSE_INVALID_C_MAC (last line in stsafea_frame_receive()).
Could you please advise me whether it is safe to ignore the error STSE_INVALID_C_MAC when reprovisioning the host keys with stse_host_key_provisioning_wrapped()?
Or is this a bug in STSELib that must be fixed?
- Ngôn ngữ chính
- C
- Star
- 15
- Fork
- 12
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của STMicroelectronics/STSELib
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
STMicroelectronics/STSELib#115 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Max `pBuffer` size for `stse_data_storage_update_data_zone()` unclear due to hidden overhead bytesĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
STMicroelectronics/STSELib#84 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
# Bug: `stse_perso_info_t` AC status 2-bit mask truncates valid AC valuesCó thể làm lại được @Grom- đã nhận 203 ngày trước và không có pull request nào đang mở. Đang mởbug
STMicroelectronics/STSELib#69 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`stse_platform_Crc16_Accumulate()` is not safeCó thể làm lại được @nils-cercariolo-st đã nhận 191 ngày trước và không có pull request nào đang mở. Đang mở
STMicroelectronics/STSELib#65 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của STMicroelectronics/STSELib
Issue tương tự
-
Symlink in release archive attempts traversalCó thể đã có người làm @Tiancheng-Xu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
redis/hiredis#1388 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Small issues on iMXRT found by ClaudeCó thể đã có người làm @Sarthak-Pandey đã nhận hôm nay. Đang mởArch: arm Area: Networking OS: Linux Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eclipse-cyclonedds/cyclonedds#2474 ·
-
area: docs eco: cpp good first issue help wanted lane: free-agent roadmap size: XS type: docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
arminazimi/evergreen#475 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Issue]: hipsparselt.h C API as shipped now requires C23 -- ONLY because of missing include or guardĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ROCm/rocm-libraries#13736 ·
Maintainer thường phản hồi trong vòng 2 ngày