Repository navigation
refactor: name the msgFlags authFlag and privFlag tests - #51
Merged
Merged
Conversation
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
marked this pull request as ready for review
October 13, 2026 05:25
ilyam8
added this pull request to stack #53
October 13, 2026 06:17
stelfrag
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 differfor 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()andprivFlag(), replace them; each site keeps its meaning (the authFlag, the privFlag,both, or neither). No behavior change.
Validation
and without Reportable, the privacy-only value included.
other 3 cannot be told apart by any reachable input (two are excluded by validation and decoding, one only changes
an error text).
go test -race, FIPS 140-only, golangci-lint, cross-builds, govulncheck: pass locally.