Skip to content

Implement SHE GET_ID command with client side request, server side handler, and tests#450

Draft
AlexLanzano wants to merge 1 commit into
wolfSSL:mainfrom
AlexLanzano:she-get-id
Draft

Implement SHE GET_ID command with client side request, server side handler, and tests#450
AlexLanzano wants to merge 1 commit into
wolfSSL:mainfrom
AlexLanzano:she-get-id

Conversation

@AlexLanzano

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 13, 2026 17:01
@AlexLanzano AlexLanzano self-assigned this Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the AUTOSAR SHE CMD_GET_ID command across the wolfHSM client/server messaging layer, exposing a client API to request module identity and implementing the server-side handler to return UID, status (SREG), and an identity CMAC.

Changes:

  • Added WH_SHE_GET_ID to the SHE action enum and introduced GET_ID request/response message types plus translation helpers.
  • Implemented client APIs (wh_Client_SheGetId*) and server handler (_GetId) including SREG composition refactoring via _BuildSreg.
  • Added end-to-end and server-direct tests covering MAC verification, truncated request handling, empty MASTER_ECU_KEY fallback-to-zero-key behavior, and pre-secure-boot allowance; updated docs accordingly.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
wolfhsm/wh_message.h Adds WH_SHE_GET_ID action identifier.
wolfhsm/wh_message_she.h Defines GET_ID request/response structs and translation function prototypes.
wolfhsm/wh_client_she.h Adds public client API declarations and documentation for CMD_GET_ID.
src/wh_server_she.c Implements server-side GET_ID handler, refactors SREG building into _BuildSreg, and updates state-gating/dispatch.
src/wh_message_she.c Implements GET_ID request/response translation functions.
src/wh_client_she.c Implements client request/response helpers and blocking wh_Client_SheGetId.
test/wh_test_she.c Adds end-to-end GET_ID validation and server-direct GET_ID cases (empty key + pre-boot) plus req-size truncation test.
test/wh_test_check_struct_padding.c Includes new GET_ID message structs in padding/struct compilation coverage.
test-refactor/server/wh_test_she_server.c Adds GET_ID truncated request test in refactor suite.
test-refactor/misc/wh_test_check_struct_padding.c Includes new GET_ID message structs in refactor padding coverage.
test-refactor/client-server/wh_test_she.c Adds end-to-end GET_ID identity+MAC verification in refactor client-server test.
docs/src/5-Features.md Documents wh_Client_SheGetId in the SHE client API feature list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants