Skip to content

Commit

Permalink
Changed RSA-PSS algorithm to use the digest size of the hash function…
Browse files Browse the repository at this point in the history
… for the salt length instead of the maximum salt length per the JWA spec. Fixes #162.
  • Loading branch information
mark-adams committed May 20, 2015
1 parent 37077e4 commit 2f5e923
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jwt/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand All @@ -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()
)
Expand Down

0 comments on commit 2f5e923

Please sign in to comment.