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