diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-11 10:07:07 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-03-11 10:07:07 -0400 |
commit | d70ed95d37e3ce5f86ed8018e5051ad3aed9fe3a (patch) | |
tree | 9a4db45e3866d1e9e0b7a864cd27292528102c8d | |
parent | 08712cfb25227472d2586164b941f495d4c3b901 (diff) | |
download | cryptography-d70ed95d37e3ce5f86ed8018e5051ad3aed9fe3a.tar.gz cryptography-d70ed95d37e3ce5f86ed8018e5051ad3aed9fe3a.tar.bz2 cryptography-d70ed95d37e3ce5f86ed8018e5051ad3aed9fe3a.zip |
make attributes of MGF1 private since that's our general convention
-rw-r--r-- | cryptography/hazmat/primitives/asymmetric/padding.py | 4 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_rsa.py | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/cryptography/hazmat/primitives/asymmetric/padding.py b/cryptography/hazmat/primitives/asymmetric/padding.py index 62b32dd2..f1c886bf 100644 --- a/cryptography/hazmat/primitives/asymmetric/padding.py +++ b/cryptography/hazmat/primitives/asymmetric/padding.py @@ -33,7 +33,7 @@ class MGF1(object): if not isinstance(algorithm, interfaces.HashAlgorithm): raise TypeError("Expected instance of interfaces.HashAlgorithm.") - self.algorithm = algorithm + self._algorithm = algorithm if (not isinstance(salt_length, six.integer_types) and not salt_length is self.MAX_LENGTH): @@ -42,4 +42,4 @@ class MGF1(object): if not salt_length is self.MAX_LENGTH and salt_length < 0: raise ValueError("salt_length must be zero or greater") - self.salt_length = salt_length + self._salt_length = salt_length diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index c4955478..114dc415 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -577,11 +577,11 @@ class TestMGF1(object): algorithm = hashes.SHA1() salt_length = algorithm.digest_size mgf = padding.MGF1(algorithm, salt_length) - assert mgf.algorithm == algorithm - assert mgf.salt_length == salt_length + assert mgf._algorithm == algorithm + assert mgf._salt_length == salt_length def test_valid_mgf1_parameters_maximum(self): algorithm = hashes.SHA1() mgf = padding.MGF1(algorithm, padding.MGF1.MAX_LENGTH) - assert mgf.algorithm == algorithm - assert mgf.salt_length == padding.MGF1.MAX_LENGTH + assert mgf._algorithm == algorithm + assert mgf._salt_length == padding.MGF1.MAX_LENGTH |