Skip to content

Commit

Permalink
Added null-check for keys in ValidSymmetricAlgorithm() (#405)
Browse files Browse the repository at this point in the history
* Added null-check for keys in ValidSymmetricAlgorithm()
  • Loading branch information
abatishchev authored Jun 8, 2022
1 parent a898f88 commit 070389b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/JWT/JwtDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ private string Decode(JwtParts jwt)

private void ValidSymmetricAlgorithm(byte[][] keys, string decodedPayload, IJwtAlgorithm algorithm, byte[] bytesToSign, byte[] decodedSignature)
{
if (keys is null)
throw new ArgumentNullException(nameof(keys));
if (!AllKeysHaveValues(keys))
throw new ArgumentOutOfRangeException(nameof(keys));

Expand Down

0 comments on commit 070389b

Please sign in to comment.