Skip to content

Validate ARSN security association updates - #543

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-536-537-arsn-validation
Open

sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-536-537-arsn-validation

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #534.
Fixes #536.
Fixes #537.

Make sa_setARSN and sa_setARSNW report rejected updates instead of always returning success, and enforce the missing SA preconditions before mutating anti-replay state.

Changes:

  • reject out-of-range SPIs with CRYPTO_LIB_ERR_SPI_INDEX_OOB
  • reject in-range but uncreated (SA_NONE) entries before mutation
  • require the target SA to provide authentication (ast == 1) before updating ARSN or ARSNW
  • preserve the existing control-SPI rejection
  • return the actual error status instead of falling through to CRYPTO_LIB_SUCCESS

Coverage includes out-of-range and uncreated SPIs, encryption-only SAs, valid authentication-capable ARSN/ARSNW updates, and the existing SA 6 cases. The SA 6 tests now expect the service-type error because SA 6 is encryption-only.

Validation:

  • EP_SA_MGMT.SET_ARSN_REJECTS_UNCREATED_SA
  • EP_SA_MGMT.SET_ARSN_REJECTS_OUT_OF_RANGE_SPI
  • EP_SA_MGMT.SET_ARSNW_REJECTS_NON_AUTHENTICATING_SA
  • EP_SA_MGMT.SET_ARSN_ACCEPTS_AUTHENTICATING_SA
  • EP_SA_MGMT.SET_ARSNW_ACCEPTS_AUTHENTICATING_SA
  • EP_SA_MGMT.SA_6_SET_ARSN
  • EP_SA_MGMT.SA_6_SET_ARSNW
  • git diff --check

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

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