Skip to content

Logic fault in supported COSE signature algorithm vlaidaiton #70189

@tolginator

Description

@tolginator

Description

Namespace: System.Security.Cryptography.Code, file: KnownCoseAlgorithms.cs, function: ThrowIfNotSupported.
The logic in the if statement is found to be faulty on code review.

Reproduction Steps

alg=-10. The logical expression computes to false.

Expected behavior

-10 is not a valid signature algorithm, and the function must throw.

Actual behavior

The function does not throw and accepts an unsupported algorithm as valid.

Regression?

N/A

Known Workarounds

None. However, callers of this function appear to throw caught by additional checks, but not all of them were inspected.

Configuration

Configuration agnostic.

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions