(self)
| 7117 | self.assertEqual(op.recv(512), expected) |
| 7118 | |
| 7119 | def test_hmac_sha1(self): |
| 7120 | # gh-109396: In FIPS mode, Linux 6.5 requires a key |
| 7121 | # of at least 112 bits. Use a key of 152 bits. |
| 7122 | key = b"Python loves AF_ALG" |
| 7123 | data = b"what do ya want for nothing?" |
| 7124 | expected = bytes.fromhex("193dbb43c6297b47ea6277ec0ce67119a3f3aa66") |
| 7125 | with self.create_alg('hash', 'hmac(sha1)') as algo: |
| 7126 | algo.setsockopt(socket.SOL_ALG, socket.ALG_SET_KEY, key) |
| 7127 | op, _ = algo.accept() |
| 7128 | with op: |
| 7129 | op.sendall(data) |
| 7130 | self.assertEqual(op.recv(512), expected) |
| 7131 | |
| 7132 | # Although it should work with 3.19 and newer the test blocks on |
| 7133 | # Ubuntu 15.10 with Kernel 4.2.0-19. |
nothing calls this directly
no test coverage detected