Skip to content

Fido2ErrorCodes are meant to be sequential enums, not flags #692

Closed

Description

@ejep520

Hi!

The compiler is giving me a strange bit of pop-up advice in VS2026. Because higher-value enum names in Fido2ErrorCode are, mathematically, a bitwise combination of their predecessors (except those landing on prime numbers), I get nonsense like Fido2ErrorCode.InvalidSignCount = Fido2ErrorCode.InvalidRpidHash | Fido2ErrorCode.InvalidSignature, which I think we can agree isn't accurate. Another example is below.

The fix I'd propose would be:

  • Remove the [Flag] decorator from the top of the file or,
  • Assign escalating powers of two to each value, so they can be used as flags.
Image

For the code I'm writing, it doesn't make much difference, but it could confuse more people than just me (and confusing me isn't much of a challenge).

Erik

Activity

  1. self-assigned this
    on Oct 29, 2026
  2. added
    bug
    on Oct 29, 2026
  3. added 2 commits that reference this issue on Oct 29, 2026
    f7ed63c
    0861f92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions