Skip to content

Commit

Permalink
Merge pull request #63 from sirosen/fix-cve-2017-11424
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdavis authored Sep 1, 2017
2 parents b54c12a + 5bc7470 commit 7569fdf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sudo: false
# Travis infra requires pinning dist:precise, at least as of 2017-09-01
# detail: https://blog.travis-ci.com/2017-06-21-trusty-updates-2017-Q2-launch
dist: precise
language: python
python:
- "2.6"
Expand Down
1 change: 1 addition & 0 deletions jose/jwk.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def __init__(self, key, algorithm):

invalid_strings = [
b'-----BEGIN PUBLIC KEY-----',
b'-----BEGIN RSA PUBLIC KEY-----',
b'-----BEGIN CERTIFICATE-----',
b'ssh-rsa'
]
Expand Down
4 changes: 4 additions & 0 deletions tests/algorithms/test_HMAC.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ def test_RSA_key(self):
with pytest.raises(JOSEError):
HMACKey(key, ALGORITHMS.HS256)

key = "-----BEGIN RSA PUBLIC KEY-----"
with pytest.raises(JOSEError):
HMACKey(key, ALGORITHMS.HS256)

key = "-----BEGIN CERTIFICATE-----"
with pytest.raises(JOSEError):
HMACKey(key, ALGORITHMS.HS256)
Expand Down

0 comments on commit 7569fdf

Please sign in to comment.