| 223 | digest = hashlib.new(name, usedforsecurity=False) |
| 224 | |
| 225 | def test_usedforsecurity_true(self): |
| 226 | hashlib.new("sha256", usedforsecurity=True) |
| 227 | if self.is_fips_mode: |
| 228 | self.skipTest("skip in FIPS mode") |
| 229 | for cons in self.hash_constructors: |
| 230 | cons(usedforsecurity=True) |
| 231 | cons(b'', usedforsecurity=True) |
| 232 | hashlib.new("md5", usedforsecurity=True) |
| 233 | hashlib.md5(usedforsecurity=True) |
| 234 | if self._hashlib is not None: |
| 235 | self._hashlib.new("md5", usedforsecurity=True) |
| 236 | self._hashlib.openssl_md5(usedforsecurity=True) |
| 237 | |
| 238 | def test_usedforsecurity_false(self): |
| 239 | hashlib.new("sha256", usedforsecurity=False) |