Skip to content

refactor: name the msgFlags authFlag and privFlag tests - #51

Merged
ilyam8 merged 1 commit into
masterfrom
msgflags-predicates
Oct 13, 2026
Merged

ilyam8 merged 1 commit into
masterfrom
msgflags-predicates

Conversation

@ilyam8

@ilyam8 ilyam8 commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Phase 6 (guardrails), first step. The SNMPv3 msgFlags bits were tested at 17 sites in eight spellings
(&AuthNoPriv > 0, != 0, == 0, &AuthPriv > AuthNoPriv, >= AuthPriv, != NoAuthNoPriv, ...), which differ
for a privacy-only value, so a reader could not see which flag a site meant. Two unexported predicates named after the
RFC 3412 flags, authFlag() and privFlag(), replace them; each site keeps its meaning (the authFlag, the privFlag,
both, or neither). No behavior change.

Validation

  • Engine, FIPS 140-only and codec goldens unchanged; a new test pins both predicates over every security level, with
    and without Reportable, the privacy-only value included.
  • 23 mutation probes (the predicate bodies widened, every converted site switched to the other flag): 20 killed; the
    other 3 cannot be told apart by any reachable input (two are excluded by validation and decoding, one only changes
    an error text).
  • Both predicates inline at every call site.
  • go test -race, FIPS 140-only, golangci-lint, cross-builds, govulncheck: pass locally.

Seventeen bit tests on SNMPv3 msgFlags were spelled eight ways that
differ for a privacy-only value. Two unexported predicates named after
the RFC 3412 flags, authFlag and privFlag, replace them, and each site
keeps its meaning: the authFlag, the privFlag, both, or neither.
@ilyam8
ilyam8 marked this pull request as ready for review October 13, 2026 05:25
@ilyam8
ilyam8 added this pull request to stack #53 October 13, 2026 06:17
@ilyam8
ilyam8 merged commit f9066fc into master Oct 13, 2026
21 checks passed
@ilyam8
ilyam8 deleted the msgflags-predicates branch October 13, 2026 14:22
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