Skip to content

Validate SA rekey encryption key state - #542

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-533-rekey-active-key
Open

sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-533-rekey-active-key

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #533.

Reject SA rekey requests unless the new encryption key exists and is KEY_ACTIVE before mutating the SA.

The current dev implementation of sa_rekey parses a new encryption key ID (ekid), so this change validates that key before assigning it or transitioning the SA to SA_KEYED. The existing nominal rekey fixture now sets its key state explicitly to make the precondition visible.

A regression test verifies that a deactivated key returns CRYPTO_LIB_ERR_KEY_STATE_INVALID, leaves the existing key ID unchanged, and keeps the SA in SA_UNKEYED.

Validation:

  • EP_SA_MGMT.SA_REKEY_REJECTS_INACTIVE_KEY
  • EP_SA_MGMT.SA_6_REKEY_133
  • git diff --check

Focused tests were built and run with CryptoLib's internal key/SA/MC configuration and Homebrew libgcrypt on macOS.

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.

🐛 [BUG] - Conformance - SA Rekey Never Checks That the New Encryption/Authentication Keys Are Active

1 participant