From 256a03e5086049ee63d436fd0b07837e1a6c0f18 Mon Sep 17 00:00:00 2001 From: Michael Collis Date: Wed, 21 Sep 2016 19:57:19 -0400 Subject: [PATCH 1/4] Fix typo in Algorithms --- jwt/algorithms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jwt/algorithms.py b/jwt/algorithms.py index 51e8f160..3ca53bce 100644 --- a/jwt/algorithms.py +++ b/jwt/algorithms.py @@ -43,7 +43,7 @@ def get_default_algorithms(): 'RS512': RSAAlgorithm(RSAAlgorithm.SHA512), 'ES256': ECAlgorithm(ECAlgorithm.SHA256), 'ES384': ECAlgorithm(ECAlgorithm.SHA384), - 'ES512': ECAlgorithm(ECAlgorithm.SHA512), + 'ES521': ECAlgorithm(ECAlgorithm.SHA512), 'PS256': RSAPSSAlgorithm(RSAPSSAlgorithm.SHA256), 'PS384': RSAPSSAlgorithm(RSAPSSAlgorithm.SHA384), 'PS512': RSAPSSAlgorithm(RSAPSSAlgorithm.SHA512) From 3bad492698298eb05331cddfd6aa47b87cae7631 Mon Sep 17 00:00:00 2001 From: Michael Collis Date: Wed, 21 Sep 2016 19:59:05 -0400 Subject: [PATCH 2/4] Fix typo in rst --- docs/algorithms.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/algorithms.rst b/docs/algorithms.rst index 69ed5758..93ae91ee 100644 --- a/docs/algorithms.rst +++ b/docs/algorithms.rst @@ -9,7 +9,7 @@ This library currently supports: * HS512 - HMAC using SHA-512 hash algorithm * ES256 - ECDSA signature algorithm using SHA-256 hash algorithm * ES384 - ECDSA signature algorithm using SHA-384 hash algorithm -* ES512 - ECDSA signature algorithm using SHA-512 hash algorithm +* ES521 - ECDSA signature algorithm using SHA-512 hash algorithm * RS256 - RSASSA-PKCS1-v1_5 signature algorithm using SHA-256 hash algorithm * RS384 - RSASSA-PKCS1-v1_5 signature algorithm using SHA-384 hash algorithm * RS512 - RSASSA-PKCS1-v1_5 signature algorithm using SHA-512 hash algorithm From ebd2fb9a3ff91daf272cac13a7b3456a6b40d26f Mon Sep 17 00:00:00 2001 From: Michael Collis Date: Wed, 21 Sep 2016 20:00:02 -0400 Subject: [PATCH 3/4] Fix tests to match --- tests/test_api_jws.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_api_jws.py b/tests/test_api_jws.py index c56ec4b2..4e819bd9 100644 --- a/tests/test_api_jws.py +++ b/tests/test_api_jws.py @@ -544,7 +544,7 @@ def test_encode_decode_with_ecdsa_sha512(self, jws, payload): with open('tests/keys/testkey_ec', 'r') as ec_priv_file: priv_eckey = load_pem_private_key(ensure_bytes(ec_priv_file.read()), password=None, backend=default_backend()) - jws_message = jws.encode(payload, priv_eckey, algorithm='ES512') + jws_message = jws.encode(payload, priv_eckey, algorithm='ES521') with open('tests/keys/testkey_ec.pub', 'r') as ec_pub_file: pub_eckey = load_pem_public_key(ensure_bytes(ec_pub_file.read()), backend=default_backend()) @@ -553,7 +553,7 @@ def test_encode_decode_with_ecdsa_sha512(self, jws, payload): # string-formatted key with open('tests/keys/testkey_ec', 'r') as ec_priv_file: priv_eckey = ec_priv_file.read() - jws_message = jws.encode(payload, priv_eckey, algorithm='ES512') + jws_message = jws.encode(payload, priv_eckey, algorithm='ES521') with open('tests/keys/testkey_ec.pub', 'r') as ec_pub_file: pub_eckey = ec_pub_file.read() From 89f9a9d2940d86868e9600a9e1a4c7bb342d326e Mon Sep 17 00:00:00 2001 From: Michael Collis Date: Mon, 26 Sep 2016 09:54:59 -0400 Subject: [PATCH 4/4] Catch a couple more typos in tests --- tests/test_api_jws.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_api_jws.py b/tests/test_api_jws.py index 4e819bd9..7dde9aa5 100644 --- a/tests/test_api_jws.py +++ b/tests/test_api_jws.py @@ -566,11 +566,11 @@ def test_ecdsa_related_algorithms(self, jws): if has_crypto: assert 'ES256' in jws_algorithms assert 'ES384' in jws_algorithms - assert 'ES512' in jws_algorithms + assert 'ES521' in jws_algorithms else: assert 'ES256' not in jws_algorithms assert 'ES384' not in jws_algorithms - assert 'ES512' not in jws_algorithms + assert 'ES521' not in jws_algorithms def test_skip_check_signature(self, jws): token = ("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"