From 2f5e9237f51e1e08a2e28e34bd64116d02921481 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Tue, 19 May 2015 22:32:07 -0500 Subject: [PATCH] Changed RSA-PSS algorithm to use the digest size of the hash function for the salt length instead of the maximum salt length per the JWA spec. Fixes #162. --- jwt/algorithms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jwt/algorithms.py b/jwt/algorithms.py index d4033149..9c1a7e80 100644 --- a/jwt/algorithms.py +++ b/jwt/algorithms.py @@ -263,7 +263,7 @@ def sign(self, msg, key): signer = key.signer( padding.PSS( mgf=padding.MGF1(self.hash_alg()), - salt_length=padding.PSS.MAX_LENGTH + salt_length=self.hash_alg.digest_size ), self.hash_alg() ) @@ -276,7 +276,7 @@ def verify(self, msg, key, sig): sig, padding.PSS( mgf=padding.MGF1(self.hash_alg()), - salt_length=padding.PSS.MAX_LENGTH + salt_length=self.hash_alg.digest_size ), self.hash_alg() )