Skip to content

Fix #518, return SA transition failures - #528

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-518-sa-transition-errors
Open

Fix #518, return SA transition failures#528
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-518-sa-transition-errors

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Aug 13, 2026

Copy link
Copy Markdown

Return explicit failures from SA START, REKEY, and EXPIRE when the target SA is in the wrong state or the requested SPI is outside the SA table instead of silently reporting success.

Use CRYPTO_LIB_ERROR for invalid transition state, matching existing SA management behavior, and CRYPTO_LIB_ERR_SPI_INDEX_OOB for an invalid SPI. Also guard the REKEY debug-only EKID access so an out-of-range SPI cannot be dereferenced when PDU debugging is enabled.

Add focused regression coverage for invalid-state and out-of-range START, REKEY, and EXPIRE operations, and update the PDU dispatch test to expect the newly surfaced START failure.

Validation: CryptoLib extended-procedure build and full EP test suite pass in the project container; git diff --check passes.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass tests?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?

How do you test these changes?

Return explicit failures from SA START, REKEY, and EXPIRE when the target SA is in the wrong state or the requested SPI is outside the SA table instead of silently reporting success.

Use CRYPTO_LIB_ERROR for invalid transition state, matching existing SA management behavior, and CRYPTO_LIB_ERR_SPI_INDEX_OOB for an invalid SPI. Also guard the REKEY debug-only EKID access so an out-of-range SPI cannot be dereferenced when PDU debugging is enabled.

Add focused regression coverage for invalid-state and out-of-range START, REKEY, and EXPIRE operations, and update the PDU dispatch test to expect the newly surfaced START failure.

Validation: CryptoLib extended-procedure build and full EP test suite pass in the project container; git diff --check passes.

AI assistance: ChatGPT was used for repository inspection, implementation assistance, regression-test construction, CI diagnostics, and diff review.
@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review August 15, 2026 20:12
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.

1 participant