| 243 | raise |
| 244 | |
| 245 | def test_usedforsecurity_true(self): |
| 246 | hashlib.new("sha256", usedforsecurity=True) |
| 247 | if self.is_fips_mode: |
| 248 | self.skipTest("skip in FIPS mode") |
| 249 | for cons in self.hash_constructors: |
| 250 | cons(usedforsecurity=True) |
| 251 | cons(b'', usedforsecurity=True) |
| 252 | hashlib.new("md5", usedforsecurity=True) |
| 253 | hashlib.md5(usedforsecurity=True) |
| 254 | if self._hashlib is not None: |
| 255 | self._hashlib.new("md5", usedforsecurity=True) |
| 256 | self._hashlib.openssl_md5(usedforsecurity=True) |
| 257 | |
| 258 | def test_usedforsecurity_false(self): |
| 259 | hashlib.new("sha256", usedforsecurity=False) |