diff options
author | Alexandru Mihai <92.alexandru.mihai@gmail.com> | 2015-06-22 23:47:47 +0300 |
---|---|---|
committer | Alexandru Mihai <92.alexandru.mihai@gmail.com> | 2015-06-22 23:47:47 +0300 |
commit | 85c13a786fb9fd48e8d5da4dc700e4cc2ece6136 (patch) | |
tree | 3cb1046a296d62686f2e6286a5560c9dc0a0fe47 | |
parent | 3df27db421fbd8c54741a54772853378895b773d (diff) | |
download | pyjwt-85c13a786fb9fd48e8d5da4dc700e4cc2ece6136.tar.gz |
Added test for verify signature with empty algo
-rw-r--r-- | tests/test_api_jws.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_api_jws.py b/tests/test_api_jws.py index 9395ae8..797e510 100644 --- a/tests/test_api_jws.py +++ b/tests/test_api_jws.py @@ -270,6 +270,16 @@ class TestJWS: assert 'Signature verification' in str(exc.value) + def test_verify_signature_with_algo_none_throws_exception(self, jws, payload): + example_jws = ( + b'e30' + b'.eyJhIjo1fQ' + b'.KEh186CjVw_Q8FadjJcaVnE7hO5Z9nHBbU8TgbhHcBY' + ) + + with pytest.raises(InvalidAlgorithmError) as exc: + jws.decode(example_jws, 'secret') + def test_invalid_crypto_alg(self, jws, payload): with pytest.raises(NotImplementedError): jws.encode(payload, 'secret', algorithm='HS1024') |