python-pkcs1
python-pkcs1 copied to clipboard
Hash is not passed from PSS methods to MGF1
The mgf1 method takes hash_class argument with default sha1 value.
https://github.com/bdauvergne/python-pkcs1/blob/2492f80b3a72aafd5b0045b5d40bd9adddc14d22/pkcs1/mgf.py#L5
The PSS encode method also takes hash_class argument, but does not pass it down to the `mgf1:
https://github.com/bdauvergne/python-pkcs1/blob/2492f80b3a72aafd5b0045b5d40bd9adddc14d22/pkcs1/emsa_pss.py#L43
Fix: pass the hash_class from top methods (like PSS encode and verify) to mgf1.