Skip to content

Commit

Permalink
Add tests for algos heuristics
Browse files Browse the repository at this point in the history
Signed-off-by: Simo Sorce <simo@redhat.com>
  • Loading branch information
simo5 committed Sep 15, 2022
1 parent 6995447 commit a7b2136
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jwcrypto/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,8 @@ def test_unexpected(self):
with self.assertRaises(TypeError):
jwt.JWT(jwt=sertok, key=key, expected_type='JWE')

jwt.JWT(jwt=sertok, algs=['HS256'], key=key)

key.use = 'sig'
jwt.JWT(jwt=sertok, key=key)
key.use = 'enc'
Expand Down Expand Up @@ -1799,6 +1801,8 @@ def test_unexpected(self):
with self.assertRaises(TypeError):
jwt.JWT(jwt=enctok, key=key, expected_type='JWS')

jwt.JWT(jwt=enctok, algs=['A256KW', 'A256GCM'], key=key)

key.use = 'enc'
jwt.JWT(jwt=enctok, key=key)
key.use = 'sig'
Expand Down

0 comments on commit a7b2136

Please sign in to comment.