How to use test_test method in tempest

Best Python code snippet using tempest_python

test_probes.py

Source:test_probes.py Github

copy

Full Screen

...145 b"\x00\x00")146assert len(MAKE_12_PFS_HELLO_EMPTY_STR) == 144,\147 len(MAKE_12_PFS_HELLO_EMPTY_STR)148class TestNormalHandshake(unittest.TestCase):149 def test_test(self):150 probe = NormalHandshake()151 sock = MockSock()152 probe.test(sock)153 self.assertEqual(sock.sent_data,154 [MAKE_HELLO_EMPTY_EXT])155class TestNormalHandshakePFS(unittest.TestCase):156 def test_test(self):157 probe = NormalHandshakePFS()158 sock = MockSock()159 probe.test(sock)160 self.assertEqual(sock.sent_data,161 [MAKE_PFS_HELLO_EMPTY_EXT])162class TestNormalHandshake11(unittest.TestCase):163 def test_test(self):164 probe = NormalHandshake11()165 sock = MockSock()166 probe.test(sock)167 self.assertEqual(sock.sent_data,168 [MAKE_11_HELLO_EMPTY_STR])169class TestNormalHandshake11PFS(unittest.TestCase):170 def test_test(self):171 probe = NormalHandshake11PFS()172 sock = MockSock()173 probe.test(sock)174 self.assertEqual(sock.sent_data,175 [MAKE_11_PFS_HELLO_EMPTY_STR])176class TestNormalHandshake12(unittest.TestCase):177 def test_test(self):178 probe = NormalHandshake12()179 sock = MockSock()180 probe.test(sock)181 self.assertEqual(sock.sent_data,182 [MAKE_12_HELLO_EMPTY_STR])183class TestNormalHandshake12PFS(unittest.TestCase):184 def test_test(self):185 probe = NormalHandshake12PFS()186 sock = MockSock()187 probe.test(sock)188 self.assertEqual(sock.sent_data,189 [MAKE_12_PFS_HELLO_EMPTY_STR])190class Test(unittest.TestCase):191 def test_test(self):192 probe = NormalHandshake12PFSw13()193 sock = MockSock()194 probe.test(sock)195 self.assertEqual(sock.sent_data,196 [b"\x16\x03\x01\x00\x8b"197 b"\x01\x00\x00\x87"198 b"\x03\x04" +199 RANDOM_STR +200 b"\x00"201 b"\x00^" +202 DEFAULT_PFS_CIPHERS_STR +203 b"\x01\x00"204 b"\x00\x00"])205class TestInvalidSessionID(unittest.TestCase):206 def test_test(self):207 probe = InvalidSessionID()208 sock = MockSock()209 probe.test(sock)210 self.assertEqual(sock.sent_data,211 [b'\x16\x03\x01\x00c'212 b'\x01\x00\x00_'213 b'\x03\01' +214 RANDOM_STR +215 b'\x28' +216 b'0123456789' * 4 +217 b'\x00\x0e' +218 DEFAULT_CIPHERS_STR +219 b'\x01\x00'220 b'\x00\x00'])221class TestInvalidSessionID12(unittest.TestCase):222 def test_test(self):223 probe = InvalidSessionID12()224 sock = MockSock()225 probe.test(sock)226 self.assertEqual(sock.sent_data,227 [b'\x16\x03\x01\x00{'228 b'\x01\x00\x00w'229 b'\x03\03' +230 RANDOM_STR +231 b'\x28' +232 b'0123456789' * 4 +233 b'\x00&' +234 DEFAULT_12_CIPHERS_STR +235 b'\x01\x00'236 b'\x00\x00'])237class TestInvalidSessionID12PFS(unittest.TestCase):238 def test_test(self):239 probe = InvalidSessionID12PFS()240 sock = MockSock()241 probe.test(sock)242 self.maxDiff = None243 self.assertEqual(sock.sent_data,244 [b'\x16\x03\x01\x00\xb3'245 b'\x01\x00\x00\xaf'246 b'\x03\03' +247 RANDOM_STR +248 b'\x28' +249 b'0123456789' * 4 +250 b'\x00^' +251 DEFAULT_PFS_CIPHERS_STR +252 b'\x01\x00'253 b'\x00\x00'])254class TestInvalidCiphersLength(unittest.TestCase):255 def test_test(self):256 probe = InvalidCiphersLength()257 sock = MockSock()258 probe.test(sock)259 self.assertEqual(sock.sent_data,260 [b'\x16\x03\x01\x00<'261 b'\x01\x00\x008'262 b'\x03\01' +263 RANDOM_STR +264 b'\x00'265 b'\x00\x0f' +266 DEFAULT_CIPHERS_STR + b'\x00'267 b'\x01\x00'268 b'\x00\x00'])269class TestInvalidCiphersLength12(unittest.TestCase):270 def test_test(self):271 probe = InvalidCiphersLength12()272 sock = MockSock()273 probe.test(sock)274 self.maxDiff = None275 self.assertEqual(sock.sent_data,276 [b'\x16\x03\x01\x00T'277 b'\x01\x00\x00P'278 b'\x03\03' +279 RANDOM_STR +280 b'\x00'281 b"\x00'" +282 DEFAULT_12_CIPHERS_STR + b'\x00'283 b'\x01\x00'284 b'\x00\x00'])285class TestInvalidCiphersLength12PFS(unittest.TestCase):286 def test_test(self):287 probe = InvalidCiphersLength12PFS()288 sock = MockSock()289 probe.test(sock)290 self.maxDiff = None291 self.assertEqual(sock.sent_data,292 [b'\x16\x03\x01\x00\x8c'293 b'\x01\x00\x00\x88'294 b'\x03\03' +295 RANDOM_STR +296 b'\x00'297 b'\x00_' +298 DEFAULT_PFS_CIPHERS_STR + b'\x00'299 b'\x01\x00'300 b'\x00\x00'])301class TestInvalidExtLength(unittest.TestCase):302 def test_test(self):303 probe = InvalidExtLength()304 sock = MockSock()305 probe.test(sock)306 self.assertEqual(sock.sent_data,307 [b'\x16\x03\x01\x00:'308 b'\x01\x00\x006'309 b'\x03\x01' +310 RANDOM_STR +311 b'\x00'312 b'\x00\x0e' +313 DEFAULT_CIPHERS_STR +314 b'\x01\x00'315 b'\x00'])316class TestInvalidExtLength12(unittest.TestCase):317 def test_test(self):318 probe = InvalidExtLength12()319 sock = MockSock()320 probe.test(sock)321 self.assertEqual(sock.sent_data,322 [b'\x16\x03\x01\x00R'323 b'\x01\x00\x00N'324 b'\x03\x03' +325 RANDOM_STR +326 b'\x00'327 b'\x00&' +328 DEFAULT_12_CIPHERS_STR +329 b'\x01\x00'330 b'\x00'])331class TestInvalidExtLength12PFS(unittest.TestCase):332 def test_test(self):333 probe = InvalidExtLength12PFS()334 sock = MockSock()335 probe.test(sock)336 self.assertEqual(sock.sent_data,337 [b"\x16\x03\x01\x00\x8a"338 b"\x01\x00\x00\x86"339 b"\x03\x03" +340 RANDOM_STR +341 b"\x00"342 b"\x00^" +343 DEFAULT_PFS_CIPHERS_STR +344 b"\x01\x00"345 b"\x00"])346class TestExtensionsUnderflow(unittest.TestCase):347 def test_test(self):348 probe = ExtensionsUnderflow()349 sock = MockSock()350 probe.test(sock)351 self.assertEqual(sock.sent_data,352 [b'\x16\x03\x01\x00@'353 b'\x01\x00\x00<'354 b'\x03\x01' +355 RANDOM_STR +356 b'\x00'357 b'\x00\x0e' +358 DEFAULT_CIPHERS_STR +359 b'\x01\x00'360 b'\x00\x01'361 b'\xff\x01'362 b'\x00\x01'363 b'\x00'])364class TestExtensionsUnderflow12(unittest.TestCase):365 def test_test(self):366 probe = ExtensionsUnderflow12()367 sock = MockSock()368 probe.test(sock)369 self.assertEqual(sock.sent_data,370 [b'\x16\x03\x01\x00X'371 b'\x01\x00\x00T'372 b'\x03\x03' +373 RANDOM_STR +374 b'\x00'375 b'\x00&' +376 DEFAULT_12_CIPHERS_STR +377 b'\x01\x00'378 b'\x00\x01'379 b'\xff\x01'380 b'\x00\x01'381 b'\x00'])382class TestExtensionsUnderflow12PFS(unittest.TestCase):383 def test_test(self):384 probe = ExtensionsUnderflow12PFS()385 sock = MockSock()386 probe.test(sock)387 self.maxDiff = None388 self.assertEqual(sock.sent_data,389 [b"\x16\x03\x01\x00\x90"390 b"\x01\x00\x00\x8c"391 b"\x03\x03" +392 RANDOM_STR +393 b"\x00"394 b"\x00^" +395 DEFAULT_PFS_CIPHERS_STR +396 b"\x01\x00"397 b'\x00\x01'398 b'\xff\x01'399 b'\x00\x01'400 b'\x00'])401class TestEmptyCompression(unittest.TestCase):402 def test_test(self):403 probe = EmptyCompression()404 sock = MockSock()405 probe.test(sock)406 self.assertEqual(sock.sent_data,407 [b'\x16\x03\x01\x00:'408 b'\x01\x00\x006'409 b'\x03\x01' +410 RANDOM_STR +411 b'\x00'412 b'\x00\x0e' +413 DEFAULT_CIPHERS_STR +414 b'\x00'415 b'\x00\x00'])416class TestEmptyCompression12(unittest.TestCase):417 def test_test(self):418 probe = EmptyCompression12()419 sock = MockSock()420 probe.test(sock)421 self.assertEqual(sock.sent_data,422 [b'\x16\x03\x01\x00R'423 b'\x01\x00\x00N'424 b'\x03\x03' +425 RANDOM_STR +426 b'\x00'427 b'\x00&' +428 DEFAULT_12_CIPHERS_STR +429 b'\x00'430 b'\x00\x00'])431class TestEmptyCompression12PFS(unittest.TestCase):432 def test_test(self):433 probe = EmptyCompression12PFS()434 sock = MockSock()435 probe.test(sock)436 self.assertEqual(sock.sent_data,437 [b"\x16\x03\x01\x00\x8a"438 b"\x01\x00\x00\x86"439 b"\x03\x03" +440 RANDOM_STR +441 b"\x00"442 b"\x00^" +443 DEFAULT_PFS_CIPHERS_STR +444 b"\x00"445 b"\x00\x00"])446class TestCompressOnly(unittest.TestCase):447 def test_test(self):448 probe = CompressOnly()449 sock = MockSock()450 probe.test(sock)451 self.assertEqual(sock.sent_data,452 [b'\x16\x03\x01\x00<'453 b'\x01\x00\x008'454 b'\x03\x01' +455 RANDOM_STR +456 b'\x00'457 b'\x00\x0e' +458 DEFAULT_CIPHERS_STR +459 b'\x02\x01\x40'460 b'\x00\x00'])461class TestCompressOnly12(unittest.TestCase):462 def test_test(self):463 probe = CompressOnly12()464 sock = MockSock()465 probe.test(sock)466 self.assertEqual(sock.sent_data,467 [b'\x16\x03\x01\x00T'468 b'\x01\x00\x00P'469 b'\x03\x03' +470 RANDOM_STR +471 b'\x00'472 b'\x00&' +473 DEFAULT_12_CIPHERS_STR +474 b'\x02\x01\x40'475 b'\x00\x00'])476class TestCompressOnly12PFS(unittest.TestCase):477 def test_test(self):478 probe = CompressOnly12PFS()479 sock = MockSock()480 probe.test(sock)481 self.assertEqual(sock.sent_data,482 [b"\x16\x03\x01\x00\x8c"483 b"\x01\x00\x00\x88"484 b"\x03\x03" +485 RANDOM_STR +486 b"\x00"487 b"\x00^" +488 DEFAULT_PFS_CIPHERS_STR +489 b"\x02\x01\x40"490 b"\x00\x00"])491class TestDoubleClientHello(unittest.TestCase):492 def test_test(self):493 probe = DoubleClientHello()494 sock = MockSock()495 probe.test(sock)496 self.assertEqual(sock.sent_data,497 [MAKE_HELLO_EMPTY_EXT, MAKE_HELLO_EMPTY_EXT])498class TestDoubleClientHello12(unittest.TestCase):499 def test_test(self):500 probe = DoubleClientHello12()501 sock = MockSock()502 probe.test(sock)503 self.assertEqual(sock.sent_data,504 [MAKE_12_HELLO_EMPTY_STR,505 MAKE_12_HELLO_EMPTY_STR])506class TestDoubleClientHello12PFS(unittest.TestCase):507 def test_test(self):508 probe = DoubleClientHello12PFS()509 sock = MockSock()510 probe.test(sock)511 self.assertEqual(sock.sent_data,512 [MAKE_12_PFS_HELLO_EMPTY_STR,513 MAKE_12_PFS_HELLO_EMPTY_STR])514class TestChangeCipherSpec(unittest.TestCase):515 def test_test(self):516 probe = ChangeCipherSpec()517 sock = MockSock()518 probe.test(sock)519 self.assertEqual(sock.sent_data,520 [MAKE_HELLO_EMPTY_EXT,521 b'\x14\x03\x01\x00\x01'522 b'\x01'])523class TestChangeCipherSpec12(unittest.TestCase):524 def test_test(self):525 probe = ChangeCipherSpec12()526 sock = MockSock()527 probe.test(sock)528 self.assertEqual(sock.sent_data,529 [MAKE_12_HELLO_EMPTY_STR,530 b'\x14\x03\x03\x00\x01'531 b'\x01'])532class TestChangeCipherSpec12PFS(unittest.TestCase):533 def test_test(self):534 probe = ChangeCipherSpec12PFS()535 sock = MockSock()536 probe.test(sock)537 self.assertEqual(sock.sent_data,538 [MAKE_12_PFS_HELLO_EMPTY_STR,539 b'\x14\x03\x03\x00\x01'540 b'\x01'])541class TestHelloRequest(unittest.TestCase):542 def test_test(self):543 probe = HelloRequest()544 sock = MockSock()545 probe.test(sock)546 self.assertEqual(sock.sent_data,547 [MAKE_HELLO_EMPTY_EXT,548 b'\x16\x03\x01\x00\x04'549 b'\x00\x00\x00\x00'])550class TestHelloRequest12(unittest.TestCase):551 def test_test(self):552 probe = HelloRequest12()553 sock = MockSock()554 probe.test(sock)555 self.assertEqual(sock.sent_data,556 [MAKE_12_HELLO_EMPTY_STR,557 b'\x16\x03\x03\x00\x04'558 b'\x00\x00\x00\x00'])559class TestHelloRequest12PFS(unittest.TestCase):560 def test_test(self):561 probe = HelloRequest12PFS()562 sock = MockSock()563 probe.test(sock)564 self.assertEqual(sock.sent_data,565 [MAKE_12_PFS_HELLO_EMPTY_STR,566 b'\x16\x03\x03\x00\x04'567 b'\x00\x00\x00\x00'])568class TestEmptyChangeCipherSpec(unittest.TestCase):569 def test_test(self):570 probe = EmptyChangeCipherSpec()571 sock = MockSock()572 probe.test(sock)573 self.assertEqual(sock.sent_data,574 [MAKE_HELLO_EMPTY_EXT,575 b'\x14\x03\x01\x00\x00'])576class TestEmptyChangeCipherSpec12(unittest.TestCase):577 def test_test(self):578 probe = EmptyChangeCipherSpec12()579 sock = MockSock()580 probe.test(sock)581 self.assertEqual(sock.sent_data,582 [MAKE_12_HELLO_EMPTY_STR,583 b'\x14\x03\x03\x00\x00'])584class TestEmptyChangeCipherSpec12PFS(unittest.TestCase):585 def test_test(self):586 probe = EmptyChangeCipherSpec12PFS()587 sock = MockSock()588 probe.test(sock)589 self.assertEqual(sock.sent_data,590 [MAKE_12_PFS_HELLO_EMPTY_STR,591 b'\x14\x03\x03\x00\x00'])592class TestBadHandshakeMessage(unittest.TestCase):593 def test_test(self):594 probe = BadHandshakeMessage()595 sock = MockSock()596 probe.test(sock)597 self.assertEqual(sock.sent_data,598 [MAKE_HELLO_EMPTY_EXT,599 b'\x16\x03\x01\x00\t'600 b'Something'])601class TestEmptyRecord(unittest.TestCase):602 def test_test(self):603 probe = EmptyRecord()604 sock = MockSock()605 probe.test(sock)606 self.assertEqual(sock.sent_data,607 [b'\x16\x03\x01\x00\x00',608 MAKE_HELLO_EMPTY_EXT])609class TestSplitHelloPackets(unittest.TestCase):610 def test_test(self):611 probe = SplitHelloPackets()612 sock = MockSock()613 probe.test(sock)614 self.assertEqual(sock.sent_data,615 [MAKE_HELLO_EMPTY_EXT[:10],616 MAKE_HELLO_EMPTY_EXT[10:]])617class TestSplitHelloPackets12(unittest.TestCase):618 def test_test(self):619 probe = SplitHelloPackets12()620 sock = MockSock()621 probe.test(sock)622 self.assertEqual(sock.sent_data,623 [MAKE_12_HELLO_EMPTY_STR[:10],624 MAKE_12_HELLO_EMPTY_STR[10:]])625class TestSplitHelloPackets12PFS(unittest.TestCase):626 def test_test(self):627 probe = SplitHelloPackets12PFS()628 sock = MockSock()629 probe.test(sock)630 self.assertEqual(sock.sent_data,631 [MAKE_12_PFS_HELLO_EMPTY_STR[:10],632 MAKE_12_PFS_HELLO_EMPTY_STR[10:]])633class TestNoCiphers(unittest.TestCase):634 def test_test(self):635 probe = NoCiphers()636 sock = MockSock()637 probe.test(sock)638 self.assertEqual(sock.sent_data,639 [b'\x16\x03\x01\x00-'640 b'\x01\x00\x00)'641 b'\x03\x01' +642 RANDOM_STR +643 b'\x00'644 b'\x00\x00'645 b'\x01\x00'646 b'\x00\x00'])647class TestNoCiphers12(unittest.TestCase):648 def test_test(self):649 probe = NoCiphers12()650 sock = MockSock()651 probe.test(sock)652 self.assertEqual(sock.sent_data,653 [b'\x16\x03\x01\x00-'654 b'\x01\x00\x00)'655 b'\x03\x03' +656 RANDOM_STR +657 b'\x00'658 b'\x00\x00'659 b'\x01\x00'660 b'\x00\x00'])661class TestTwoInvalidPackets(unittest.TestCase):662 def test_test(self):663 probe = TwoInvalidPackets()664 sock = MockSock()665 probe.test(sock)666 # this is broken because it is replicating the behaviour of old667 # incorrect code668 self.assertEqual(bytes(sock.sent_data[0])[:32],669 b'<tls.record.TLSRecord object at ')670 self.assertEqual(bytes(sock.sent_data[1])[:32],671 b'<tls.record.TLSRecord object at ')672class TestSplitHelloRecords(unittest.TestCase):673 def test_test(self):674 probe = SplitHelloRecords()675 sock = MockSock()676 probe.test(sock)677 self.assertEqual(sock.sent_data,678 [b'\x16\x03\x01\x00\n'679 b'\x01\x00\x007'680 b'\x03\x01' +681 RANDOM_STR[:4],682 b'\x16\x03\x01\x001' +683 RANDOM_STR[4:] +684 b'\x00'685 b'\x00\x0e' +686 DEFAULT_CIPHERS_STR +687 b'\x01\x00'688 b'\x00\x00'])689class TestSplitHelloRecords12(unittest.TestCase):690 def test_test(self):691 probe = SplitHelloRecords12()692 sock = MockSock()693 probe.test(sock)694 self.assertEqual(sock.sent_data,695 [b'\x16\x03\x01\x00\n'696 b'\x01\x00\x00O'697 b'\x03\x03' +698 RANDOM_STR[:4],699 b'\x16\x03\x01\x00I' +700 RANDOM_STR[4:] +701 b'\x00'702 b'\x00&' +703 DEFAULT_12_CIPHERS_STR +704 b'\x01\x00'705 b'\x00\x00'])706class TestSplitHelloRecords12PFS(unittest.TestCase):707 def test_test(self):708 probe = SplitHelloRecords12PFS()709 sock = MockSock()710 probe.test(sock)711 self.maxDiff = None712 self.assertEqual(sock.sent_data,713 [b'\x16\x03\x01\x00\n'714 b'\x01\x00\x00\x87'715 b'\x03\x03' +716 RANDOM_STR[:4],717 b'\x16\x03\x01\x00\x81' +718 RANDOM_STR[4:] +719 b'\x00'720 b'\x00^' +721 DEFAULT_PFS_CIPHERS_STR +722 b'\x01\x00'723 b'\x00\x00'])724class TestOnlyECCipherSuites(unittest.TestCase):725 def test_test(self):726 probe = OnlyECCipherSuites()727 sock = MockSock()728 probe.test(sock)729 self.assertEqual(sock.sent_data,730 [b"\x16\x03\x01\x00;"731 b"\x01\x00\x007"732 b"\x03\x01" +733 RANDOM_STR +734 b"\x00"735 b"\x00\x0e"736 b"\xc0\x0c\xc0\r\xc0\x0e\xc0\x0f"737 b"\xc0\x13\xc0\x14\xc0'"738 b"\x01\x00"739 b"\x00\x00"])740class TestHeartbeat(unittest.TestCase):741 def test_test(self):742 probe = Heartbeat()743 sock = MockSock()744 probe.test(sock)745 self.assertEqual(sock.sent_data,746 [b'\x16\x03\x01\x00@'747 b'\x01\x00\x00<'748 b'\x03\x01' +749 RANDOM_STR +750 b'\x00'751 b'\x00\x0e' +752 DEFAULT_CIPHERS_STR +753 b'\x01\x00'754 b'\x00\x05'755 b'\x00\x0f'756 b'\x00\x01\x01',757 b'\x18\x03\x01\x00\x07'758 b'\x01\x00\x04XXXX'])759class TestHeartbeat12(unittest.TestCase):760 def test_test(self):761 probe = Heartbeat12()762 sock = MockSock()763 probe.test(sock)764 self.assertEqual(sock.sent_data,765 [b'\x16\x03\x01\x00X'766 b'\x01\x00\x00T'767 b'\x03\x03' +768 RANDOM_STR +769 b'\x00'770 b'\x00&' +771 DEFAULT_12_CIPHERS_STR +772 b'\x01\x00'773 b'\x00\x05'774 b'\x00\x0f'775 b'\x00\x01\x01',776 b'\x18\x03\x03\x00\x07'777 b'\x01\x00\x04XXXX'])778class TestHeartbeat12PFS(unittest.TestCase):779 def test_test(self):780 probe = Heartbeat12PFS()781 sock = MockSock()782 probe.test(sock)783 self.maxDiff = None784 self.assertEqual(sock.sent_data,785 [b'\x16\x03\x01\x00\x90'786 b'\x01\x00\x00\x8c'787 b'\x03\x03' +788 RANDOM_STR +789 b'\x00'790 b'\x00^' +791 DEFAULT_PFS_CIPHERS_STR +792 b'\x01\x00'793 b'\x00\x05'794 b'\x00\x0f'795 b'\x00\x01\x01',796 b'\x18\x03\x03\x00\x07'797 b'\x01\x00\x04XXXX'])798class TestHeartbleed(unittest.TestCase):799 def test_test(self):800 probe = Heartbleed()801 sock = MockSock()802 probe.test(sock)803 self.assertEqual(sock.sent_data,804 [b'\x16\x03\x01\x00@'805 b'\x01\x00\x00<'806 b'\x03\x01' +807 RANDOM_STR +808 b'\x00'809 b'\x00\x0e' +810 DEFAULT_CIPHERS_STR +811 b'\x01\x00'812 b'\x00\x05'813 b'\x00\x0f'814 b'\x00\x01\x01',815 b'\x18\x03\x01\x00\x07'816 b'\x01@\x00XXXX'])817class TestHeartbleed12(unittest.TestCase):818 def test_test(self):819 probe = Heartbleed12()820 sock = MockSock()821 probe.test(sock)822 self.assertEqual(sock.sent_data,823 [b'\x16\x03\x01\x00X'824 b'\x01\x00\x00T'825 b'\x03\x03' +826 RANDOM_STR +827 b'\x00'828 b'\x00&' +829 DEFAULT_12_CIPHERS_STR +830 b'\x01\x00'831 b'\x00\x05'832 b'\x00\x0f'833 b'\x00\x01\x01',834 b'\x18\x03\x03\x00\x07'835 b'\x01@\x00XXXX'])836class TestHeartbleed12PFS(unittest.TestCase):837 def test_test(self):838 probe = Heartbleed12PFS()839 sock = MockSock()840 probe.test(sock)841 self.maxDiff = None842 self.assertEqual(sock.sent_data,843 [b'\x16\x03\x01\x00\x90'844 b'\x01\x00\x00\x8c'845 b'\x03\x03' +846 RANDOM_STR +847 b'\x00'848 b'\x00^' +849 DEFAULT_PFS_CIPHERS_STR +850 b'\x01\x00'851 b'\x00\x05'852 b'\x00\x0f'853 b'\x00\x01\x01',854 b'\x18\x03\x03\x00\x07'855 b'\x01@\x00XXXX'])856class TestHighTLSVersion(unittest.TestCase):857 def test_test(self):858 probe = HighTLSVersion()859 sock = MockSock()860 probe.test(sock)861 self.assertEqual(sock.sent_data,862 [b'\x16\x04\x00\x00;'863 b'\x01\x00\x007'864 b'\x03\x01' +865 RANDOM_STR +866 b'\x00'867 b'\x00\x0e' +868 DEFAULT_CIPHERS_STR +869 b'\x01\x00'870 b'\x00\x00'])871class TestHighTLSVersion12(unittest.TestCase):872 def test_test(self):873 probe = HighTLSVersion12()874 sock = MockSock()875 probe.test(sock)876 self.assertEqual(sock.sent_data,877 [b'\x16\x04\x00\x00S'878 b'\x01\x00\x00O'879 b'\x03\x03' +880 RANDOM_STR +881 b'\x00'882 b'\x00&' +883 DEFAULT_12_CIPHERS_STR +884 b'\x01\x00'885 b'\x00\x00'])886class TestHighTLSVersion12PFS(unittest.TestCase):887 def test_test(self):888 probe = HighTLSVersion12PFS()889 sock = MockSock()890 probe.test(sock)891 self.maxDiff = None892 self.assertEqual(sock.sent_data,893 [b'\x16\x04\x00\x00\x8b'894 b'\x01\x00\x00\x87'895 b'\x03\x03' +896 RANDOM_STR +897 b'\x00'898 b'\x00^' +899 DEFAULT_PFS_CIPHERS_STR +900 b'\x01\x00'901 b'\x00\x00'])902class TestVeryHighTLSVersion(unittest.TestCase):903 def test_test(self):904 probe = VeryHighTLSVersion()905 sock = MockSock()906 probe.test(sock)907 self.assertEqual(sock.sent_data,908 [b'\x16\xff\xff\x00;'909 b'\x01\x00\x007'910 b'\x03\x01' +911 RANDOM_STR +912 b'\x00'913 b'\x00\x0e' +914 DEFAULT_CIPHERS_STR +915 b'\x01\x00'916 b'\x00\x00'])917class TestVeryHighTLSVersion12(unittest.TestCase):918 def test_test(self):919 probe = VeryHighTLSVersion12()920 sock = MockSock()921 probe.test(sock)922 self.assertEqual(sock.sent_data,923 [b'\x16\xff\xff\x00S'924 b'\x01\x00\x00O'925 b'\x03\x03' +926 RANDOM_STR +927 b'\x00'928 b'\x00&' +929 DEFAULT_12_CIPHERS_STR +930 b'\x01\x00'931 b'\x00\x00'])932class TestVeryHighTLSVersion12PFS(unittest.TestCase):933 def test_test(self):934 probe = VeryHighTLSVersion12PFS()935 sock = MockSock()936 probe.test(sock)937 self.maxDiff = None938 self.assertEqual(sock.sent_data,939 [b'\x16\xff\xff\x00\x8b'940 b'\x01\x00\x00\x87'941 b'\x03\x03' +942 RANDOM_STR +943 b'\x00'944 b'\x00^' +945 DEFAULT_PFS_CIPHERS_STR +946 b'\x01\x00'947 b'\x00\x00'])948class TestZeroTLSVersion(unittest.TestCase):949 def test_test(self):950 probe = ZeroTLSVersion()951 sock = MockSock()952 probe.test(sock)953 self.assertEqual(sock.sent_data,954 [b'\x16\x00\x00\x00;'955 b'\x01\x00\x007'956 b'\x03\x01' +957 RANDOM_STR +958 b'\x00'959 b'\x00\x0e' +960 DEFAULT_CIPHERS_STR +961 b'\x01\x00'962 b'\x00\x00'])963class TestZeroTLSVersion12(unittest.TestCase):964 def test_test(self):965 probe = ZeroTLSVersion12()966 sock = MockSock()967 probe.test(sock)968 self.assertEqual(sock.sent_data,969 [b'\x16\x00\x00\x00S'970 b'\x01\x00\x00O'971 b'\x03\x03' +972 RANDOM_STR +973 b'\x00'974 b'\x00&' +975 DEFAULT_12_CIPHERS_STR +976 b'\x01\x00'977 b'\x00\x00'])978class TestZeroTLSVersion12PFS(unittest.TestCase):979 def test_test(self):980 probe = ZeroTLSVersion12PFS()981 sock = MockSock()982 probe.test(sock)983 self.maxDiff = None984 self.assertEqual(sock.sent_data,985 [b'\x16\x00\x00\x00\x8b'986 b'\x01\x00\x00\x87'987 b'\x03\x03' +988 RANDOM_STR +989 b'\x00'990 b'\x00^' +991 DEFAULT_PFS_CIPHERS_STR +992 b'\x01\x00'993 b'\x00\x00'])994class TestHighHelloVersion(unittest.TestCase):995 def test_test(self):996 probe = HighHelloVersion()997 sock = MockSock()998 probe.test(sock)999 self.assertEqual(sock.sent_data,1000 [b'\x16\x03\x01\x00;'1001 b'\x01\x00\x007'1002 b'\x04\x00' +1003 RANDOM_STR +1004 b'\x00'1005 b'\x00\x0e' +1006 DEFAULT_CIPHERS_STR +1007 b'\x01\x00'1008 b'\x00\x00'])1009class TestHighHelloVersionNew(unittest.TestCase):1010 def test_test(self):1011 probe = HighHelloVersionNew()1012 sock = MockSock()1013 probe.test(sock)1014 self.assertEqual(sock.sent_data,1015 [b'\x16\x03\x01\x00S'1016 b'\x01\x00\x00O'1017 b'\x04\x00' +1018 RANDOM_STR +1019 b'\x00'1020 b'\x00&' +1021 DEFAULT_12_CIPHERS_STR +1022 b'\x01\x00'1023 b'\x00\x00'])1024class TestHighHelloVersionPFS(unittest.TestCase):1025 def test_test(self):1026 probe = HighHelloVersionPFS()1027 sock = MockSock()1028 probe.test(sock)1029 self.assertEqual(sock.sent_data,1030 [b'\x16\x03\x01\x00\x8b'1031 b'\x01\x00\x00\x87'1032 b'\x04\x00' +1033 RANDOM_STR +1034 b'\x00'1035 b'\x00^' +1036 DEFAULT_PFS_CIPHERS_STR +1037 b'\x01\x00'1038 b'\x00\x00'])1039class TestVeryHighHelloVersion(unittest.TestCase):1040 def test_test(self):1041 probe = VeryHighHelloVersion()1042 sock = MockSock()1043 probe.test(sock)1044 self.assertEqual(sock.sent_data,1045 [b'\x16\x03\x01\x00;'1046 b'\x01\x00\x007'1047 b'\xff\xff' +1048 RANDOM_STR +1049 b'\x00'1050 b'\x00\x0e' +1051 DEFAULT_CIPHERS_STR +1052 b'\x01\x00'1053 b'\x00\x00'])1054class TestVeryHighHelloVersionNew(unittest.TestCase):1055 def test_test(self):1056 probe = VeryHighHelloVersionNew()1057 sock = MockSock()1058 probe.test(sock)1059 self.assertEqual(sock.sent_data,1060 [b'\x16\x03\x01\x00S'1061 b'\x01\x00\x00O'1062 b'\xff\xff' +1063 RANDOM_STR +1064 b'\x00'1065 b'\x00&' +1066 DEFAULT_12_CIPHERS_STR +1067 b'\x01\x00'1068 b'\x00\x00'])1069class TestVeryHighHelloVersionPFS(unittest.TestCase):1070 def test_test(self):1071 probe = VeryHighHelloVersionPFS()1072 sock = MockSock()1073 probe.test(sock)1074 self.assertEqual(sock.sent_data,1075 [b'\x16\x03\x01\x00\x8b'1076 b'\x01\x00\x00\x87'1077 b'\xff\xff' +1078 RANDOM_STR +1079 b'\x00'1080 b'\x00^' +1081 DEFAULT_PFS_CIPHERS_STR +1082 b'\x01\x00'1083 b'\x00\x00'])1084class TestZeroHelloVersion(unittest.TestCase):1085 def test_test(self):1086 probe = ZeroHelloVersion()1087 sock = MockSock()1088 probe.test(sock)1089 self.assertEqual(sock.sent_data,1090 [b'\x16\x03\x01\x00;'1091 b'\x01\x00\x007'1092 b'\x00\x00' +1093 RANDOM_STR +1094 b'\x00'1095 b'\x00\x0e' +1096 DEFAULT_CIPHERS_STR +1097 b'\x01\x00'1098 b'\x00\x00'])1099class TestBadContentType(unittest.TestCase):1100 def test_test(self):1101 probe = BadContentType()1102 sock = MockSock()1103 probe.test(sock)1104 self.assertEqual(sock.sent_data,1105 [b'\x11\x03\x01\x00;'1106 b'\x01\x00\x007'1107 b'\x03\x01' +1108 RANDOM_STR +1109 b'\x00'1110 b'\x00\x0e' +1111 DEFAULT_CIPHERS_STR +1112 b'\x01\x00'1113 b'\x00\x00'])1114class TestRecordLengthOverflow(unittest.TestCase):1115 def test_test(self):1116 probe = RecordLengthOverflow()1117 sock = MockSock()1118 probe.test(sock)1119 self.assertEqual(sock.sent_data,1120 [b'\x16\x03\x01\x00\x01'1121 b'\x01'])1122class TestRecordLengthUnderflow(unittest.TestCase):1123 def test_test(self):1124 probe = RecordLengthUnderflow()1125 sock = MockSock()1126 probe.test(sock)1127 self.assertEqual(len(sock.sent_data[0]), 65540)1128 self.assertEqual(sock.sent_data,1129 [b'\x16\x03\x01\xff\xff'1130 b'\x01\x00\x007'1131 b'\x03\x01' +1132 RANDOM_STR +1133 b'\x00'1134 b'\x00\x0e' +1135 DEFAULT_CIPHERS_STR +1136 b'\x01\x00'1137 b'\x00\x00' +1138 b'\x00' * (65540 - 64)])1139class TestEmptyRecord(unittest.TestCase):1140 def test_test(self):1141 probe = EmptyRecord()1142 sock = MockSock()1143 probe.test(sock)1144 self.assertEqual(sock.sent_data,1145 [b'\x16\x03\x01\x00\x00',1146 MAKE_HELLO_EMPTY_EXT])1147class TestEmptyRecord12(unittest.TestCase):1148 def test_test(self):1149 probe = EmptyRecord12()1150 sock = MockSock()1151 probe.test(sock)1152 self.assertEqual(sock.sent_data,1153 [b'\x16\x03\x01\x00\x00',1154 MAKE_12_HELLO_EMPTY_STR])1155class TestEmptyRecord12PFS(unittest.TestCase):1156 def test_test(self):1157 probe = EmptyRecord12PFS()1158 sock = MockSock()1159 probe.test(sock)1160 self.assertEqual(sock.sent_data,1161 [b'\x16\x03\x01\x00\x00',1162 MAKE_12_PFS_HELLO_EMPTY_STR])1163class TestSNIWrongName(unittest.TestCase):1164 def test_test(self):1165 probe = SNIWrongName()1166 sock = MockSock()1167 probe.test(sock)1168 self.assertEqual(sock.sent_data,1169 [b'\x16\x03\x01\x00U'1170 b'\x01\x00\x00Q'1171 b'\x03\x01' +1172 RANDOM_STR +1173 b'\x00'1174 b'\x00\x0e' +1175 DEFAULT_CIPHERS_STR +1176 b'\x01\x00'1177 b'\x00\x1a'1178 b'\x00\x00\x00\x16'1179 b'\x00\x14\x00\x00'1180 b'\x11thisisnotyourname'])1181class TestSNIWrongName12(unittest.TestCase):1182 def test_test(self):1183 probe = SNIWrongName12()1184 sock = MockSock()1185 probe.test(sock)1186 self.maxDiff = None1187 self.assertEqual(sock.sent_data,1188 [b'\x16\x03\x01\x00m'1189 b'\x01\x00\x00i'1190 b'\x03\x03' +1191 RANDOM_STR +1192 b'\x00'1193 b'\x00&' +1194 DEFAULT_12_CIPHERS_STR +1195 b'\x01\x00'1196 b'\x00\x1a'1197 b'\x00\x00\x00\x16'1198 b'\x00\x14\x00\x00'1199 b'\x11thisisnotyourname'])1200class TestSNIWrongName12PFS(unittest.TestCase):1201 def test_test(self):1202 probe = SNIWrongName12PFS()1203 sock = MockSock()1204 probe.test(sock)1205 self.maxDiff = None1206 self.assertEqual(sock.sent_data,1207 [b'\x16\x03\x01\x00\xa5'1208 b'\x01\x00\x00\xa1'1209 b'\x03\x03' +1210 RANDOM_STR +1211 b'\x00'1212 b'\x00^' +1213 DEFAULT_PFS_CIPHERS_STR +1214 b'\x01\x00'1215 b'\x00\x1a'1216 b'\x00\x00\x00\x16'1217 b'\x00\x14\x00\x00'1218 b'\x11thisisnotyourname'])1219class TestSNILongName(unittest.TestCase):1220 def test_test(self):1221 probe = SNILongName()1222 sock = MockSock()1223 probe.test(sock)1224 self.assertEqual(sock.sent_data,1225 [b'\x16\x03\x01\x028'1226 b'\x01\x00\x024'1227 b'\x03\x01' +1228 RANDOM_STR +1229 b'\x00'1230 b'\x00\x0e' +1231 DEFAULT_CIPHERS_STR +1232 b'\x01\x00'1233 b'\x01\xfd'1234 b'\x00\x00\x01\xf9'1235 b'\x01\xf7\x00\x01\xf4' + b'x'*500])1236class TestSNILongName12(unittest.TestCase):1237 def test_test(self):1238 probe = SNILongName12()1239 sock = MockSock()1240 probe.test(sock)1241 self.maxDiff = None1242 self.assertEqual(sock.sent_data,1243 [b'\x16\x03\x01\x02P'1244 b'\x01\x00\x02L'1245 b'\x03\x03' +1246 RANDOM_STR +1247 b'\x00'1248 b'\x00&' +1249 DEFAULT_12_CIPHERS_STR +1250 b'\x01\x00'1251 b'\x01\xfd'1252 b'\x00\x00\x01\xf9'1253 b'\x01\xf7\x00\x01\xf4' + b'x'*500])1254class TestSNIWrongName12PFS(unittest.TestCase):1255 def test_test(self):1256 probe = SNILongName12PFS()1257 sock = MockSock()1258 probe.test(sock)1259 self.maxDiff = None1260 self.assertEqual(sock.sent_data,1261 [b'\x16\x03\x01\x02\x88'1262 b'\x01\x00\x02\x84'1263 b'\x03\x03' +1264 RANDOM_STR +1265 b'\x00'1266 b'\x00^' +1267 DEFAULT_PFS_CIPHERS_STR +1268 b'\x01\x00'1269 b'\x01\xfd'1270 b'\x00\x00\x01\xf9'1271 b'\x01\xf7\x00\x01\xf4' + b'x'*500])1272class TestSNIEmptyName(unittest.TestCase):1273 def test_test(self):1274 probe = SNIEmptyName()1275 sock = MockSock()1276 probe.test(sock)1277 self.assertEqual(sock.sent_data,1278 [b'\x16\x03\x01\x00D'1279 b'\x01\x00\x00@'1280 b'\x03\x01' +1281 RANDOM_STR +1282 b'\x00'1283 b'\x00\x0e' +1284 DEFAULT_CIPHERS_STR +1285 b'\x01\x00'1286 b'\x00\t'1287 b'\x00\x00\x00\x05'1288 b'\x00\x03\x00\x00\x00'])1289class TestSNIEmptyName12(unittest.TestCase):1290 def test_test(self):1291 probe = SNIEmptyName12()1292 sock = MockSock()1293 probe.test(sock)1294 self.maxDiff = None1295 self.assertEqual(sock.sent_data,1296 [b'\x16\x03\x01\x00\\'1297 b'\x01\x00\x00X'1298 b'\x03\x03' +1299 RANDOM_STR +1300 b'\x00'1301 b'\x00&' +1302 DEFAULT_12_CIPHERS_STR +1303 b'\x01\x00'1304 b'\x00\t'1305 b'\x00\x00\x00\x05'1306 b'\x00\x03\x00\x00\x00'])1307class TestSNIEmptyName12PFS(unittest.TestCase):1308 def test_test(self):1309 probe = SNIEmptyName12PFS()1310 sock = MockSock()1311 probe.test(sock)1312 self.maxDiff = None1313 self.assertEqual(sock.sent_data,1314 [b'\x16\x03\x01\x00\x94'1315 b'\x01\x00\x00\x90'1316 b'\x03\x03' +1317 RANDOM_STR +1318 b'\x00'1319 b'\x00^' +1320 DEFAULT_PFS_CIPHERS_STR +1321 b'\x01\x00'1322 b'\x00\t'1323 b'\x00\x00\x00\x05'1324 b'\x00\x03\x00\x00\x00'])1325class TestSNIOneWrong(unittest.TestCase):1326 def test_test(self):1327 probe = SNIOneWrong()1328 probe.ipaddress = b'example.com'1329 sock = MockSock()1330 probe.test(sock)1331 self.maxDiff = None1332 self.assertEqual(sock.sent_data,1333 [b'\x16\x03\x01\x00c'1334 b'\x01\x00\x00_'1335 b'\x03\x01' +1336 RANDOM_STR +1337 b'\x00'1338 b'\x00\x0e' +1339 DEFAULT_CIPHERS_STR +1340 b'\x01\x00'1341 b'\x00('1342 b'\x00\x00\x00$'1343 b'\x00"'1344 b'\x00\x00\x0bexample.com'1345 b'\x00\x00\x11thisisnotyourname'])1346class TestSNIOneWrong12(unittest.TestCase):1347 def test_test(self):1348 probe = SNIOneWrong12()1349 probe.ipaddress = b'example.com'1350 sock = MockSock()1351 probe.test(sock)1352 self.maxDiff = None1353 self.assertEqual(sock.sent_data,1354 [b'\x16\x03\x01\x00{'1355 b'\x01\x00\x00w'1356 b'\x03\x03' +1357 RANDOM_STR +1358 b'\x00'1359 b'\x00&' +1360 DEFAULT_12_CIPHERS_STR +1361 b'\x01\x00'1362 b'\x00('1363 b'\x00\x00\x00$'1364 b'\x00"'1365 b'\x00\x00\x0bexample.com'1366 b'\x00\x00\x11thisisnotyourname'])1367class TestSNIOneWrong12PFS(unittest.TestCase):1368 def test_test(self):1369 probe = SNIOneWrong12PFS()1370 probe.ipaddress = b'example.com'1371 sock = MockSock()1372 probe.test(sock)1373 self.maxDiff = None1374 self.assertEqual(sock.sent_data,1375 [b"\x16\x03\x01\x00\xb3"1376 b"\x01\x00\x00\xaf"1377 b"\x03\x03" +1378 RANDOM_STR +1379 b"\x00"1380 b"\x00^" +1381 DEFAULT_PFS_CIPHERS_STR +1382 b"\x01\x00"1383 b'\x00('1384 b'\x00\x00\x00$'1385 b'\x00"'1386 b'\x00\x00\x0bexample.com'1387 b'\x00\x00\x11thisisnotyourname'])1388class TestSNIWithDifferentType(unittest.TestCase):1389 def test_test(self):1390 probe = SNIWithDifferentType()1391 probe.ipaddress = b'example.com'1392 sock = MockSock()1393 probe.test(sock)1394 self.maxDiff = None1395 self.assertEqual(sock.sent_data,1396 [b'\x16\x03\x01\x00_'1397 b'\x01\x00\x00['1398 b'\x03\x01' +1399 RANDOM_STR +1400 b'\x00'1401 b'\x00\x0e' +1402 DEFAULT_CIPHERS_STR +1403 b'\x01\x00'1404 b'\x00$'1405 b'\x00\x00\x00 '1406 b'\x00\x1e'1407 b'\x00\x00\x0bexample.com'1408 b'\x04\x00\r<binary-data>'])1409class TestSNIWithDifferentType12(unittest.TestCase):1410 def test_test(self):1411 probe = SNIWithDifferentType12()1412 probe.ipaddress = b'example.com'1413 sock = MockSock()1414 probe.test(sock)1415 self.maxDiff = None1416 self.assertEqual(sock.sent_data,1417 [b'\x16\x03\x01\x00w'1418 b'\x01\x00\x00s'1419 b'\x03\x03' +1420 RANDOM_STR +1421 b'\x00'1422 b'\x00&' +1423 DEFAULT_12_CIPHERS_STR +1424 b'\x01\x00'1425 b'\x00$'1426 b'\x00\x00\x00 '1427 b'\x00\x1e'1428 b'\x00\x00\x0bexample.com'1429 b'\x04\x00\r<binary-data>'])1430class TestSNIWithDifferentType12PFS(unittest.TestCase):1431 def test_test(self):1432 probe = SNIWithDifferentType12PFS()1433 probe.ipaddress = b'example.com'1434 sock = MockSock()1435 probe.test(sock)1436 self.maxDiff = None1437 self.assertEqual(sock.sent_data,1438 [b"\x16\x03\x01\x00\xaf"1439 b"\x01\x00\x00\xab"1440 b"\x03\x03" +1441 RANDOM_STR +1442 b"\x00"1443 b"\x00^" +1444 DEFAULT_PFS_CIPHERS_STR +1445 b"\x01\x00"1446 b'\x00$'1447 b'\x00\x00\x00 '1448 b'\x00\x1e'1449 b'\x00\x00\x0bexample.com'1450 b'\x04\x00\r<binary-data>'])1451class TestSNIDifferentTypeRev(unittest.TestCase):1452 def test_test(self):1453 probe = SNIDifferentTypeRev()1454 probe.ipaddress = b'example.com'1455 sock = MockSock()1456 probe.test(sock)1457 self.maxDiff = None1458 self.assertEqual(sock.sent_data,1459 [b'\x16\x03\x01\x00_'1460 b'\x01\x00\x00['1461 b'\x03\x01' +1462 RANDOM_STR +1463 b'\x00'1464 b'\x00\x0e' +1465 DEFAULT_CIPHERS_STR +1466 b'\x01\x00'1467 b'\x00$'1468 b'\x00\x00\x00 '1469 b'\x00\x1e'1470 b'\x04\x00\r<binary-data>'1471 b'\x00\x00\x0bexample.com'])1472class TestSNIDifferentTypeRev12(unittest.TestCase):1473 def test_test(self):1474 probe = SNIDifferentTypeRev12()1475 probe.ipaddress = b'example.com'1476 sock = MockSock()1477 probe.test(sock)1478 self.maxDiff = None1479 self.assertEqual(sock.sent_data,1480 [b'\x16\x03\x01\x00w'1481 b'\x01\x00\x00s'1482 b'\x03\x03' +1483 RANDOM_STR +1484 b'\x00'1485 b'\x00&' +1486 DEFAULT_12_CIPHERS_STR +1487 b'\x01\x00'1488 b'\x00$'1489 b'\x00\x00\x00 '1490 b'\x00\x1e'1491 b'\x04\x00\r<binary-data>'1492 b'\x00\x00\x0bexample.com'])1493class TestSNIDifferentTypeRev12PFS(unittest.TestCase):1494 def test_test(self):1495 probe = SNIDifferentTypeRev12PFS()1496 probe.ipaddress = b'example.com'1497 sock = MockSock()1498 probe.test(sock)1499 self.maxDiff = None1500 self.assertEqual(sock.sent_data,1501 [b"\x16\x03\x01\x00\xaf"1502 b"\x01\x00\x00\xab"1503 b"\x03\x03" +1504 RANDOM_STR +1505 b"\x00"1506 b"\x00^" +1507 DEFAULT_PFS_CIPHERS_STR +1508 b"\x01\x00"1509 b'\x00$'1510 b'\x00\x00\x00 '1511 b'\x00\x1e'1512 b'\x04\x00\r<binary-data>'1513 b'\x00\x00\x0bexample.com'])1514class TestSNIOverflow(unittest.TestCase):1515 def test_test(self):1516 probe = SNIOverflow()1517 probe.ipaddress = b'example.com'1518 sock = MockSock()1519 probe.test(sock)1520 self.maxDiff = None1521 self.assertEqual(sock.sent_data,1522 [b'\x16\x03\x01\x00N'1523 b'\x01\x00\x00J'1524 b'\x03\x01' +1525 RANDOM_STR +1526 b'\x00'1527 b'\x00\x0e' +1528 DEFAULT_CIPHERS_STR +1529 b'\x01\x00'1530 b'\x00\x13'1531 b'\x00\x00\x00\x0f'1532 b'\x00\x0e'1533 b'\x00\x00\x0bexample.co'])1534class TestSNIOverflow12(unittest.TestCase):1535 def test_test(self):1536 probe = SNIOverflow12()1537 probe.ipaddress = b'example.com'1538 sock = MockSock()1539 probe.test(sock)1540 self.maxDiff = None1541 self.assertEqual(sock.sent_data,1542 [b'\x16\x03\x01\x00f'1543 b'\x01\x00\x00b'1544 b'\x03\x03' +1545 RANDOM_STR +1546 b'\x00'1547 b'\x00&' +1548 DEFAULT_12_CIPHERS_STR +1549 b'\x01\x00'1550 b'\x00\x13'1551 b'\x00\x00\x00\x0f'1552 b'\x00\x0e'1553 b'\x00\x00\x0bexample.co'])1554class TestSNIOverflow12PFS(unittest.TestCase):1555 def test_test(self):1556 probe = SNIOverflow12PFS()1557 probe.ipaddress = b'example.com'1558 sock = MockSock()1559 probe.test(sock)1560 self.maxDiff = None1561 self.assertEqual(sock.sent_data,1562 [b"\x16\x03\x01\x00\x9e"1563 b"\x01\x00\x00\x9a"1564 b"\x03\x03" +1565 RANDOM_STR +1566 b"\x00"1567 b"\x00^" +1568 DEFAULT_PFS_CIPHERS_STR +1569 b'\x01\x00'1570 b'\x00\x13'1571 b'\x00\x00\x00\x0f'1572 b'\x00\x0e'1573 b'\x00\x00\x0bexample.co'])1574class TestSNIUnderflow(unittest.TestCase):1575 def test_test(self):1576 probe = SNIUnderflow()1577 probe.ipaddress = b'example.com'1578 sock = MockSock()1579 probe.test(sock)1580 self.maxDiff = None1581 self.assertEqual(sock.sent_data,1582 [b'\x16\x03\x01\x00R'1583 b'\x01\x00\x00N'1584 b'\x03\x01' +1585 RANDOM_STR +1586 b'\x00'1587 b'\x00\x0e' +1588 DEFAULT_CIPHERS_STR +1589 b'\x01\x00'1590 b'\x00\x17'1591 b'\x00\x00\x00\x13'1592 b'\x00\x0e'1593 b'\x00\x00\x0bexample.com'1594 b'\x00\x00\x00'])1595class TestSNIUnderflow12(unittest.TestCase):1596 def test_test(self):1597 probe = SNIUnderflow12()1598 probe.ipaddress = b'example.com'1599 sock = MockSock()1600 probe.test(sock)1601 self.maxDiff = None1602 self.assertEqual(sock.sent_data,1603 [b'\x16\x03\x01\x00j'1604 b'\x01\x00\x00f'1605 b'\x03\x03' +1606 RANDOM_STR +1607 b'\x00'1608 b'\x00&' +1609 DEFAULT_12_CIPHERS_STR +1610 b'\x01\x00'1611 b'\x00\x17'1612 b'\x00\x00\x00\x13'1613 b'\x00\x0e'1614 b'\x00\x00\x0bexample.com'1615 b'\x00\x00\x00'])1616class TestSNIUnderflow12PFS(unittest.TestCase):1617 def test_test(self):1618 probe = SNIUnderflow12PFS()1619 probe.ipaddress = b'example.com'1620 sock = MockSock()1621 probe.test(sock)1622 self.maxDiff = None1623 self.assertEqual(sock.sent_data,1624 [b"\x16\x03\x01\x00\xa2"1625 b"\x01\x00\x00\x9e"1626 b"\x03\x03" +1627 RANDOM_STR +1628 b"\x00"1629 b"\x00^" +1630 DEFAULT_PFS_CIPHERS_STR +1631 b'\x01\x00'1632 b'\x00\x17'1633 b'\x00\x00\x00\x13'1634 b'\x00\x0e'1635 b'\x00\x00\x0bexample.com'1636 b'\x00\x00\x00'])1637class TestSecureRenegoOverflow(unittest.TestCase):1638 def test_test(self):1639 probe = SecureRenegoOverflow()1640 sock = MockSock()1641 probe.test(sock)1642 self.assertEqual(sock.sent_data,1643 [b'\x16\x03\x01\x00J'1644 b'\x01\x00\x00F'1645 b'\x03\x01' +1646 RANDOM_STR +1647 b'\x00'1648 b'\x00\x0e' +1649 DEFAULT_CIPHERS_STR +1650 b'\x01\x00'1651 b'\x00\x0f'1652 b'\xff\x01\x00\x0b'1653 b'\x0c0123456789'])1654class TestSecureRenegoOverflow12(unittest.TestCase):1655 def test_test(self):1656 probe = SecureRenegoOverflow12()1657 sock = MockSock()1658 probe.test(sock)1659 self.assertEqual(sock.sent_data,1660 [b'\x16\x03\x01\x00b'1661 b'\x01\x00\x00^'1662 b'\x03\x03' +1663 RANDOM_STR +1664 b'\x00'1665 b'\x00&' +1666 DEFAULT_12_CIPHERS_STR +1667 b'\x01\x00'1668 b'\x00\x0f'1669 b'\xff\x01\x00\x0b'1670 b'\x0c0123456789'])1671class TestSecureRenegoOverflow12PFS(unittest.TestCase):1672 def test_test(self):1673 probe = SecureRenegoOverflow12PFS()1674 sock = MockSock()1675 probe.test(sock)1676 self.maxDiff = None1677 self.assertEqual(sock.sent_data,1678 [b'\x16\x03\x01\x00\x9a'1679 b'\x01\x00\x00\x96'1680 b'\x03\x03' +1681 RANDOM_STR +1682 b'\x00'1683 b'\x00^' +1684 DEFAULT_PFS_CIPHERS_STR +1685 b'\x01\x00'1686 b'\x00\x0f'1687 b'\xff\x01\x00\x0b'1688 b'\x0c0123456789'])1689class TestSecureRenegoUnderflow(unittest.TestCase):1690 def test_test(self):1691 probe = SecureRenegoUnderflow()1692 sock = MockSock()1693 probe.test(sock)1694 self.assertEqual(sock.sent_data,1695 [b'\x16\x03\x01\x00D'1696 b'\x01\x00\x00@'1697 b'\x03\x01' +1698 RANDOM_STR +1699 b'\x00'1700 b'\x00\x0e' +1701 DEFAULT_CIPHERS_STR +1702 b'\x01\x00'1703 b'\x00\t'1704 b'\xff\x01\x00\x05'1705 b'\x00\x00\x00\x00\x00'])1706class TestSecureRenegoUnderflow12(unittest.TestCase):1707 def test_test(self):1708 probe = SecureRenegoUnderflow12()1709 sock = MockSock()1710 probe.test(sock)1711 self.assertEqual(sock.sent_data,1712 [b'\x16\x03\x01\x00\\'1713 b'\x01\x00\x00X'1714 b'\x03\x03' +1715 RANDOM_STR +1716 b'\x00'1717 b'\x00&' +1718 DEFAULT_12_CIPHERS_STR +1719 b'\x01\x00'1720 b'\x00\t'1721 b'\xff\x01\x00\x05'1722 b'\x00\x00\x00\x00\x00'])1723class TestSecureRenegoUnderflow12PFS(unittest.TestCase):1724 def test_test(self):1725 probe = SecureRenegoUnderflow12PFS()1726 sock = MockSock()1727 probe.test(sock)1728 self.maxDiff = None1729 self.assertEqual(sock.sent_data,1730 [b'\x16\x03\x01\x00\x94'1731 b'\x01\x00\x00\x90'1732 b'\x03\x03' +1733 RANDOM_STR +1734 b'\x00'1735 b'\x00^' +1736 DEFAULT_PFS_CIPHERS_STR +1737 b'\x01\x00'1738 b'\x00\t'1739 b'\xff\x01\x00\x05'1740 b'\x00\x00\x00\x00\x00'])1741class TestSecureRenegoNonEmpty(unittest.TestCase):1742 def test_test(self):1743 probe = SecureRenegoNonEmpty()1744 sock = MockSock()1745 probe.test(sock)1746 self.assertEqual(sock.sent_data,1747 [b'\x16\x03\x01\x00L'1748 b'\x01\x00\x00H'1749 b'\x03\x01' +1750 RANDOM_STR +1751 b'\x00'1752 b'\x00\x0e' +1753 DEFAULT_CIPHERS_STR +1754 b'\x01\x00'1755 b'\x00\x11\xff\x01'1756 b'\x00\r\x0c012345678901'])1757class TestSecureRenegoNonEmpty12(unittest.TestCase):1758 def test_test(self):1759 probe = SecureRenegoNonEmpty12()1760 sock = MockSock()1761 probe.test(sock)1762 self.assertEqual(sock.sent_data,1763 [b'\x16\x03\x01\x00d'1764 b'\x01\x00\x00`'1765 b'\x03\x03' +1766 RANDOM_STR +1767 b'\x00'1768 b'\x00&' +1769 DEFAULT_12_CIPHERS_STR +1770 b'\x01\x00'1771 b'\x00\x11\xff\x01'1772 b'\x00\r\x0c012345678901'])1773class TestSecureRenegoNonEmpty12PFS(unittest.TestCase):1774 def test_test(self):1775 probe = SecureRenegoNonEmpty12PFS()1776 sock = MockSock()1777 probe.test(sock)1778 self.maxDiff = None1779 self.assertEqual(sock.sent_data,1780 [b'\x16\x03\x01\x00\x9c'1781 b'\x01\x00\x00\x98'1782 b'\x03\x03' +1783 RANDOM_STR +1784 b'\x00'1785 b'\x00^' +1786 DEFAULT_PFS_CIPHERS_STR +1787 b'\x01\x00'1788 b'\x00\x11\xff\x01'1789 b'\x00\r\x0c012345678901'])1790class TestSecureRenegoNull(unittest.TestCase):1791 def test_test(self):1792 probe = SecureRenegoNull()1793 sock = MockSock()1794 probe.test(sock)1795 self.assertEqual(sock.sent_data,1796 [b'\x16\x03\x01\x00?'1797 b'\x01\x00\x00;'1798 b'\x03\x01' +1799 RANDOM_STR +1800 b'\x00'1801 b'\x00\x0e' +1802 DEFAULT_CIPHERS_STR +1803 b'\x01\x00'1804 b'\x00\x04'1805 b'\xff\x01\x00\x00'])1806class TestSecureRenegoNull12(unittest.TestCase):1807 def test_test(self):1808 probe = SecureRenegoNull12()1809 sock = MockSock()1810 probe.test(sock)1811 self.assertEqual(sock.sent_data,1812 [b'\x16\x03\x01\x00W'1813 b'\x01\x00\x00S'1814 b'\x03\x03' +1815 RANDOM_STR +1816 b'\x00'1817 b'\x00&' +1818 DEFAULT_12_CIPHERS_STR +1819 b'\x01\x00'1820 b'\x00\x04'1821 b'\xff\x01\x00\x00'])1822class TestSecureRenegoNonEmpty12PFS(unittest.TestCase):1823 def test_test(self):1824 probe = SecureRenegoNull12PFS()1825 sock = MockSock()1826 probe.test(sock)1827 self.maxDiff = None1828 self.assertEqual(sock.sent_data,1829 [b'\x16\x03\x01\x00\x8f'1830 b'\x01\x00\x00\x8b'1831 b'\x03\x03' +1832 RANDOM_STR +1833 b'\x00'1834 b'\x00^' +1835 DEFAULT_PFS_CIPHERS_STR +1836 b'\x01\x00'1837 b'\x00\x04'1838 b'\xff\x01\x00\x00'])1839class TestMaxFragmentNull(unittest.TestCase):1840 def test_test(self):1841 probe = MaxFragmentNull()1842 sock = MockSock()1843 probe.test(sock)1844 self.assertEqual(sock.sent_data,1845 [b'\x16\x03\x01\x00?'1846 b'\x01\x00\x00;'1847 b'\x03\x01' +1848 RANDOM_STR +1849 b'\x00'1850 b'\x00\x0e' +1851 DEFAULT_CIPHERS_STR +1852 b'\x01\x00'1853 b'\x00\x04'1854 b'\x00\x01\x00\x00'])1855class TestMaxFragmentNull12(unittest.TestCase):1856 def test_test(self):1857 probe = MaxFragmentNull12()1858 sock = MockSock()1859 probe.test(sock)1860 self.assertEqual(sock.sent_data,1861 [b'\x16\x03\x01\x00W'1862 b'\x01\x00\x00S'1863 b'\x03\x03' +1864 RANDOM_STR +1865 b'\x00'1866 b'\x00&' +1867 DEFAULT_12_CIPHERS_STR +1868 b'\x01\x00'1869 b'\x00\x04'1870 b'\x00\x01\x00\x00'])1871class TestMaxFragmentNull12PFS(unittest.TestCase):1872 def test_test(self):1873 probe = MaxFragmentNull12PFS()1874 sock = MockSock()1875 probe.test(sock)1876 self.maxDiff = None1877 self.assertEqual(sock.sent_data,1878 [b"\x16\x03\x01\x00\x8f"1879 b"\x01\x00\x00\x8b"1880 b"\x03\x03" +1881 RANDOM_STR +1882 b"\x00"1883 b"\x00^" +1884 DEFAULT_PFS_CIPHERS_STR +1885 b"\x01\x00"1886 b'\x00\x04'1887 b'\x00\x01\x00\x00'])1888class TestMaxFragmentInvalid(unittest.TestCase):1889 def test_test(self):1890 probe = MaxFragmentInvalid()1891 sock = MockSock()1892 probe.test(sock)1893 self.assertEqual(sock.sent_data,1894 [b'\x16\x03\x01\x00@'1895 b'\x01\x00\x00<'1896 b'\x03\x01' +1897 RANDOM_STR +1898 b'\x00'1899 b'\x00\x0e' +1900 DEFAULT_CIPHERS_STR +1901 b'\x01\x00'1902 b'\x00\x05'1903 b'\x00\x01\x00\x01'1904 b'\x08'])1905class TestMaxFragmentInvalid12(unittest.TestCase):1906 def test_test(self):1907 probe = MaxFragmentInvalid12()1908 sock = MockSock()1909 probe.test(sock)1910 self.assertEqual(sock.sent_data,1911 [b'\x16\x03\x01\x00X'1912 b'\x01\x00\x00T'1913 b'\x03\x03' +1914 RANDOM_STR +1915 b'\x00'1916 b'\x00&' +1917 DEFAULT_12_CIPHERS_STR +1918 b'\x01\x00'1919 b'\x00\x05'1920 b'\x00\x01\x00\x01'1921 b'\x08'])1922class TestMaxFragmentInvalid12PFS(unittest.TestCase):1923 def test_test(self):1924 probe = MaxFragmentInvalid12PFS()1925 sock = MockSock()1926 probe.test(sock)1927 self.maxDiff = None1928 self.assertEqual(sock.sent_data,1929 [b"\x16\x03\x01\x00\x90"1930 b"\x01\x00\x00\x8c"1931 b"\x03\x03" +1932 RANDOM_STR +1933 b"\x00"1934 b"\x00^" +1935 DEFAULT_PFS_CIPHERS_STR +1936 b"\x01\x00"1937 b'\x00\x05'1938 b'\x00\x01\x00\x01'1939 b'\x08'])1940class TestClientCertURLsNotNull(unittest.TestCase):1941 def test_test(self):1942 probe = ClientCertURLsNotNull()1943 sock = MockSock()1944 probe.test(sock)1945 self.assertEqual(sock.sent_data,1946 [b'\x16\x03\x01\x00A'1947 b'\x01\x00\x00='1948 b'\x03\x01' +1949 RANDOM_STR +1950 b'\x00'1951 b'\x00\x0e' +1952 DEFAULT_CIPHERS_STR +1953 b'\x01\x00'1954 b'\x00\x06'1955 b'\x00\x02\x00\x02'1956 b'\x08\x00'])1957class TestClientCertURLsNotNull12(unittest.TestCase):1958 def test_test(self):1959 probe = ClientCertURLsNotNull12()1960 sock = MockSock()1961 probe.test(sock)1962 self.assertEqual(sock.sent_data,1963 [b'\x16\x03\x01\x00Y'1964 b'\x01\x00\x00U'1965 b'\x03\x03' +1966 RANDOM_STR +1967 b'\x00'1968 b'\x00&' +1969 DEFAULT_12_CIPHERS_STR +1970 b'\x01\x00'1971 b'\x00\x06'1972 b'\x00\x02\x00\x02'1973 b'\x08\x00'])1974class TestClientCertURLsNotNull12PFS(unittest.TestCase):1975 def test_test(self):1976 probe = ClientCertURLsNotNull12PFS()1977 sock = MockSock()1978 probe.test(sock)1979 self.maxDiff = None1980 self.assertEqual(sock.sent_data,1981 [b"\x16\x03\x01\x00\x91"1982 b"\x01\x00\x00\x8d"1983 b"\x03\x03" +1984 RANDOM_STR +1985 b"\x00"1986 b"\x00^" +1987 DEFAULT_PFS_CIPHERS_STR +1988 b"\x01\x00"1989 b'\x00\x06'1990 b'\x00\x02\x00\x02'1991 b'\x08\x00'])1992class TestTrustedCANull(unittest.TestCase):1993 def test_test(self):1994 probe = TrustedCANull()1995 sock = MockSock()1996 probe.test(sock)1997 self.assertEqual(sock.sent_data,1998 [b'\x16\x03\x01\x00?'1999 b'\x01\x00\x00;'2000 b'\x03\x01' +2001 RANDOM_STR +2002 b'\x00'2003 b'\x00\x0e' +2004 DEFAULT_CIPHERS_STR +2005 b'\x01\x00'2006 b'\x00\x04'2007 b'\x00\x03\x00\x00'])2008class TestTrustedCANull12(unittest.TestCase):2009 def test_test(self):2010 probe = TrustedCANull12()2011 sock = MockSock()2012 probe.test(sock)2013 self.assertEqual(sock.sent_data,2014 [b'\x16\x03\x01\x00W'2015 b'\x01\x00\x00S'2016 b'\x03\x03' +2017 RANDOM_STR +2018 b'\x00'2019 b'\x00&' +2020 DEFAULT_12_CIPHERS_STR +2021 b'\x01\x00'2022 b'\x00\x04'2023 b'\x00\x03\x00\x00'])2024class TestTrustedCANull12PFS(unittest.TestCase):2025 def test_test(self):2026 probe = TrustedCANull12PFS()2027 sock = MockSock()2028 probe.test(sock)2029 self.maxDiff = None2030 self.assertEqual(sock.sent_data,2031 [b"\x16\x03\x01\x00\x8f"2032 b"\x01\x00\x00\x8b"2033 b"\x03\x03" +2034 RANDOM_STR +2035 b"\x00"2036 b"\x00^" +2037 DEFAULT_PFS_CIPHERS_STR +2038 b"\x01\x00"2039 b'\x00\x04'2040 b'\x00\x03\x00\x00'])2041class TestTrustedCAOverflow(unittest.TestCase):2042 def test_test(self):2043 probe = TrustedCAOverflow()2044 sock = MockSock()2045 probe.test(sock)2046 self.assertEqual(sock.sent_data,2047 [b'\x16\x03\x01\x00A'2048 b'\x01\x00\x00='2049 b'\x03\x01' +2050 RANDOM_STR +2051 b'\x00'2052 b'\x00\x0e' +2053 DEFAULT_CIPHERS_STR +2054 b'\x01\x00'2055 b'\x00\x06'2056 b'\x00\x03\x00\x02'2057 b'\x00\x15'])2058class TestTrustedCAOverflow12(unittest.TestCase):2059 def test_test(self):2060 probe = TrustedCAOverflow12()2061 sock = MockSock()2062 probe.test(sock)2063 self.assertEqual(sock.sent_data,2064 [b'\x16\x03\x01\x00Y'2065 b'\x01\x00\x00U'2066 b'\x03\x03' +2067 RANDOM_STR +2068 b'\x00'2069 b'\x00&' +2070 DEFAULT_12_CIPHERS_STR +2071 b'\x01\x00'2072 b'\x00\x06'2073 b'\x00\x03\x00\x02'2074 b'\x00\x15'])2075class TestTrustedCAOverflow12PFS(unittest.TestCase):2076 def test_test(self):2077 probe = TrustedCAOverflow12PFS()2078 sock = MockSock()2079 probe.test(sock)2080 self.maxDiff = None2081 self.assertEqual(sock.sent_data,2082 [b"\x16\x03\x01\x00\x91"2083 b"\x01\x00\x00\x8d"2084 b"\x03\x03" +2085 RANDOM_STR +2086 b"\x00"2087 b"\x00^" +2088 DEFAULT_PFS_CIPHERS_STR +2089 b"\x01\x00"2090 b'\x00\x06'2091 b'\x00\x03\x00\x02'2092 b'\x00\x15'])2093class TestTrustedCAUnderflow(unittest.TestCase):2094 def test_test(self):2095 probe = TrustedCAUnderflow()2096 sock = MockSock()2097 probe.test(sock)2098 self.maxDiff = None2099 self.assertEqual(sock.sent_data,2100 [b'\x16\x03\x01\x00W'2101 b'\x01\x00\x00S'2102 b'\x03\x01' +2103 RANDOM_STR +2104 b'\x00'2105 b'\x00\x0e' +2106 DEFAULT_CIPHERS_STR +2107 b'\x01\x00'2108 b'\x00\x1c'2109 b'\x00\x03\x00\x18'2110 b'\x00\x15\x01' + 'a'*20 + b'\x00'])2111class TestTrustedCAUnderflow12(unittest.TestCase):2112 def test_test(self):2113 probe = TrustedCAUnderflow12()2114 sock = MockSock()2115 probe.test(sock)2116 self.maxDiff = None2117 self.assertEqual(sock.sent_data,2118 [b'\x16\x03\x01\x00o'2119 b'\x01\x00\x00k'2120 b'\x03\x03' +2121 RANDOM_STR +2122 b'\x00'2123 b'\x00&' +2124 DEFAULT_12_CIPHERS_STR +2125 b'\x01\x00'2126 b'\x00\x1c'2127 b'\x00\x03\x00\x18'2128 b'\x00\x15\x01' + 'a'*20 + b'\x00'])2129class TestTrustedCAUnderflow12PFS(unittest.TestCase):2130 def test_test(self):2131 probe = TrustedCAUnderflow12PFS()2132 sock = MockSock()2133 probe.test(sock)2134 self.maxDiff = None2135 self.assertEqual(sock.sent_data,2136 [b"\x16\x03\x01\x00\xa7"2137 b"\x01\x00\x00\xa3"2138 b"\x03\x03" +2139 RANDOM_STR +2140 b"\x00"2141 b"\x00^" +2142 DEFAULT_PFS_CIPHERS_STR +2143 b"\x01\x00"2144 b'\x00\x1c'2145 b'\x00\x03\x00\x18'2146 b'\x00\x15\x01' + 'a'*20 + b'\x00'])2147class TestTruncatedHMACNotNull(unittest.TestCase):2148 def test_test(self):2149 probe = TruncatedHMACNotNull()2150 sock = MockSock()2151 probe.test(sock)2152 self.assertEqual(sock.sent_data,2153 [b'\x16\x03\x01\x00@'2154 b'\x01\x00\x00<'2155 b'\x03\x01' +2156 RANDOM_STR +2157 b'\x00'2158 b'\x00\x0e' +2159 DEFAULT_CIPHERS_STR +2160 b'\x01\x00'2161 b'\x00\x05'2162 b'\x00\x04\x00\x01'2163 b'\x0c'])2164class TestTruncatedHMACNotNull12(unittest.TestCase):2165 def test_test(self):2166 probe = TruncatedHMACNotNull12()2167 sock = MockSock()2168 probe.test(sock)2169 self.assertEqual(sock.sent_data,2170 [b'\x16\x03\x01\x00X'2171 b'\x01\x00\x00T'2172 b'\x03\x03' +2173 RANDOM_STR +2174 b'\x00'2175 b'\x00&' +2176 DEFAULT_12_CIPHERS_STR +2177 b'\x01\x00'2178 b'\x00\x05'2179 b'\x00\x04\x00\x01'2180 b'\x0c'])2181class TestTruncatedHMACNotNull12PFS(unittest.TestCase):2182 def test_test(self):2183 probe = TruncatedHMACNotNull12PFS()2184 sock = MockSock()2185 probe.test(sock)2186 self.maxDiff = None2187 self.assertEqual(sock.sent_data,2188 [b"\x16\x03\x01\x00\x90"2189 b"\x01\x00\x00\x8c"2190 b"\x03\x03" +2191 RANDOM_STR +2192 b"\x00"2193 b"\x00^" +2194 DEFAULT_PFS_CIPHERS_STR +2195 b"\x01\x00"2196 b'\x00\x05'2197 b'\x00\x04\x00\x01'2198 b'\x0c'])2199class TestOCSPNull(unittest.TestCase):2200 def test_test(self):2201 probe = OCSPNull()2202 sock = MockSock()2203 probe.test(sock)2204 self.assertEqual(sock.sent_data,2205 [b'\x16\x03\x01\x00?'2206 b'\x01\x00\x00;'2207 b'\x03\x01' +2208 RANDOM_STR +2209 b'\x00'2210 b'\x00\x0e' +2211 DEFAULT_CIPHERS_STR +2212 b'\x01\x00'2213 b'\x00\x04'2214 b'\x00\x05\x00\x00'])2215class TestOCSPNull12(unittest.TestCase):2216 def test_test(self):2217 probe = OCSPNull12()2218 sock = MockSock()2219 probe.test(sock)2220 self.assertEqual(sock.sent_data,2221 [b'\x16\x03\x01\x00W'2222 b'\x01\x00\x00S'2223 b'\x03\x03' +2224 RANDOM_STR +2225 b'\x00'2226 b'\x00&' +2227 DEFAULT_12_CIPHERS_STR +2228 b'\x01\x00'2229 b'\x00\x04'2230 b'\x00\x05\x00\x00'])2231class TestOCSPNull12PFS(unittest.TestCase):2232 def test_test(self):2233 probe = OCSPNull12PFS()2234 sock = MockSock()2235 probe.test(sock)2236 self.maxDiff = None2237 self.assertEqual(sock.sent_data,2238 [b"\x16\x03\x01\x00\x8f"2239 b"\x01\x00\x00\x8b"2240 b"\x03\x03" +2241 RANDOM_STR +2242 b"\x00"2243 b"\x00^" +2244 DEFAULT_PFS_CIPHERS_STR +2245 b"\x01\x00"2246 b'\x00\x04'2247 b'\x00\x05\x00\x00'])2248class TestOCSPOverflow(unittest.TestCase):2249 def test_test(self):2250 probe = OCSPOverflow()2251 sock = MockSock()2252 probe.test(sock)2253 self.assertEqual(sock.sent_data,2254 [b'\x16\x03\x01\x00C'2255 b'\x01\x00\x00?'2256 b'\x03\x01' +2257 RANDOM_STR +2258 b'\x00'2259 b'\x00\x0e' +2260 DEFAULT_CIPHERS_STR +2261 b'\x01\x00'2262 b'\x00\x08'2263 b'\x00\x05\x00\x04'2264 b'\x01\x00\x00\x00'])2265class TestOCSPOverflow12(unittest.TestCase):2266 def test_test(self):2267 probe = OCSPOverflow12()2268 sock = MockSock()2269 probe.test(sock)2270 self.assertEqual(sock.sent_data,2271 [b'\x16\x03\x01\x00['2272 b'\x01\x00\x00W'2273 b'\x03\x03' +2274 RANDOM_STR +2275 b'\x00'2276 b'\x00&' +2277 DEFAULT_12_CIPHERS_STR +2278 b'\x01\x00'2279 b'\x00\x08'2280 b'\x00\x05\x00\x04'2281 b'\x01\x00\x00\x00'])2282class TestOCSPOverflow12PFS(unittest.TestCase):2283 def test_test(self):2284 probe = OCSPOverflow12PFS()2285 sock = MockSock()2286 probe.test(sock)2287 self.maxDiff = None2288 self.assertEqual(sock.sent_data,2289 [b"\x16\x03\x01\x00\x93"2290 b"\x01\x00\x00\x8f"2291 b"\x03\x03" +2292 RANDOM_STR +2293 b"\x00"2294 b"\x00^" +2295 DEFAULT_PFS_CIPHERS_STR +2296 b"\x01\x00"2297 b'\x00\x08'2298 b'\x00\x05\x00\x04'2299 b'\x01\x00\x00\x00'])2300class TestOCSPUnderflow(unittest.TestCase):2301 def test_test(self):2302 probe = OCSPUnderflow()2303 sock = MockSock()2304 probe.test(sock)2305 self.maxDiff = None2306 self.assertEqual(sock.sent_data,2307 [b'\x16\x03\x01\x00F'2308 b'\x01\x00\x00B'2309 b'\x03\x01' +2310 RANDOM_STR +2311 b'\x00'2312 b'\x00\x0e' +2313 DEFAULT_CIPHERS_STR +2314 b'\x01\x00'2315 b'\x00\x0b'2316 b'\x00\x05\x00\x07'2317 b'\x01\x00\x00\x00\x00\x00\x00'])2318class TestOCSPUnderflow12(unittest.TestCase):2319 def test_test(self):2320 probe = OCSPUnderflow12()2321 sock = MockSock()2322 probe.test(sock)2323 self.maxDiff = None2324 self.assertEqual(sock.sent_data,2325 [b'\x16\x03\x01\x00^'2326 b'\x01\x00\x00Z'2327 b'\x03\x03' +2328 RANDOM_STR +2329 b'\x00'2330 b'\x00&' +2331 DEFAULT_12_CIPHERS_STR +2332 b'\x01\x00'2333 b'\x00\x0b'2334 b'\x00\x05\x00\x07'2335 b'\x01\x00\x00\x00\x00\x00\x00'])2336class TestOCSPUnderflow12PFS(unittest.TestCase):2337 def test_test(self):2338 probe = OCSPUnderflow12PFS()2339 sock = MockSock()2340 probe.test(sock)2341 self.maxDiff = None2342 self.assertEqual(sock.sent_data,2343 [b"\x16\x03\x01\x00\x96"2344 b"\x01\x00\x00\x92"2345 b"\x03\x03" +2346 RANDOM_STR +2347 b"\x00"2348 b"\x00^" +2349 DEFAULT_PFS_CIPHERS_STR +2350 b"\x01\x00"2351 b'\x00\x0b'2352 b'\x00\x05\x00\x07'2353 b'\x01\x00\x00\x00\x00\x00\x00'])2354class TestDoubleExtension(unittest.TestCase):2355 def test_test(self):2356 probe = DoubleExtension()2357 sock = MockSock()2358 probe.test(sock)2359 self.assertEqual(sock.sent_data,2360 [b'\x16\x03\x01\x00E'2361 b'\x01\x00\x00A'2362 b'\x03\x01' +2363 RANDOM_STR +2364 b'\x00'2365 b'\x00\x0e' +2366 DEFAULT_CIPHERS_STR +2367 b'\x01\x00'2368 b'\x00\x0a'2369 b'\xff\x01\x00\x01'2370 b'\x00'2371 b'\xff\x01\x00\x01'2372 b'\x00'])2373class TestDoubleExtension12(unittest.TestCase):2374 def test_test(self):2375 probe = DoubleExtension12()2376 sock = MockSock()2377 probe.test(sock)2378 self.assertEqual(sock.sent_data,2379 [b'\x16\x03\x01\x00]'2380 b'\x01\x00\x00Y'2381 b'\x03\x03' +2382 RANDOM_STR +2383 b'\x00'2384 b'\x00&' +2385 DEFAULT_12_CIPHERS_STR +2386 b'\x01\x00'2387 b'\x00\x0a'2388 b'\xff\x01\x00\x01'2389 b'\x00'2390 b'\xff\x01\x00\x01'2391 b'\x00'])2392class TestDoubleExtension12PFS(unittest.TestCase):2393 def test_test(self):2394 probe = DoubleExtension12PFS()2395 sock = MockSock()2396 probe.test(sock)2397 self.maxDiff = None2398 self.assertEqual(sock.sent_data,2399 [b"\x16\x03\x01\x00\x95"2400 b"\x01\x00\x00\x91"2401 b"\x03\x03" +2402 RANDOM_STR +2403 b"\x00"2404 b"\x00^" +2405 DEFAULT_PFS_CIPHERS_STR +2406 b"\x01\x00"2407 b'\x00\x0a'2408 b'\xff\x01\x00\x01'2409 b'\x00'2410 b'\xff\x01\x00\x01'2411 b'\x00'])2412class TestUserMappingNull(unittest.TestCase):2413 def test_test(self):2414 probe = UserMappingNull()2415 sock = MockSock()2416 probe.test(sock)2417 self.assertEqual(sock.sent_data,2418 [b'\x16\x03\x01\x00?'2419 b'\x01\x00\x00;'2420 b'\x03\x01' +2421 RANDOM_STR +2422 b'\x00'2423 b'\x00\x0e' +2424 DEFAULT_CIPHERS_STR +2425 b'\x01\x00'2426 b'\x00\x04'2427 b'\x00\x06\x00\x00'])2428class TestUserMappingNull12(unittest.TestCase):2429 def test_test(self):2430 probe = UserMappingNull12()2431 sock = MockSock()2432 probe.test(sock)2433 self.assertEqual(sock.sent_data,2434 [b'\x16\x03\x01\x00W'2435 b'\x01\x00\x00S'2436 b'\x03\x03' +2437 RANDOM_STR +2438 b'\x00'2439 b'\x00&' +2440 DEFAULT_12_CIPHERS_STR +2441 b'\x01\x00'2442 b'\x00\x04'2443 b'\x00\x06\x00\x00'])2444class TestUserMappingNull12PFS(unittest.TestCase):2445 def test_test(self):2446 probe = UserMappingNull12PFS()2447 sock = MockSock()2448 probe.test(sock)2449 self.maxDiff = None2450 self.assertEqual(sock.sent_data,2451 [b"\x16\x03\x01\x00\x8f"2452 b"\x01\x00\x00\x8b"2453 b"\x03\x03" +2454 RANDOM_STR +2455 b"\x00"2456 b"\x00^" +2457 DEFAULT_PFS_CIPHERS_STR +2458 b"\x01\x00"2459 b'\x00\x04'2460 b'\x00\x06\x00\x00'])2461class TestUserMappingOverflow(unittest.TestCase):2462 def test_test(self):2463 probe = UserMappingOverflow()2464 sock = MockSock()2465 probe.test(sock)2466 self.maxDiff = None2467 self.assertEqual(sock.sent_data,2468 [b'\x16\x03\x01\x00A'2469 b'\x01\x00\x00='2470 b'\x03\x01' +2471 RANDOM_STR +2472 b'\x00'2473 b'\x00\x0e' +2474 DEFAULT_CIPHERS_STR +2475 b'\x01\x00'2476 b'\x00\x06'2477 b'\x00\x06\x00\x02'2478 b'\x02\x40'])2479class TestUserMappingOverflow12(unittest.TestCase):2480 def test_test(self):2481 probe = UserMappingOverflow12()2482 sock = MockSock()2483 probe.test(sock)2484 self.assertEqual(sock.sent_data,2485 [b'\x16\x03\x01\x00Y'2486 b'\x01\x00\x00U'2487 b'\x03\x03' +2488 RANDOM_STR +2489 b'\x00'2490 b'\x00&' +2491 DEFAULT_12_CIPHERS_STR +2492 b'\x01\x00'2493 b'\x00\x06'2494 b'\x00\x06\x00\x02'2495 b'\x02\x40'])2496class TestUserMappingOverflow12PFS(unittest.TestCase):2497 def test_test(self):2498 probe = UserMappingOverflow12PFS()2499 sock = MockSock()2500 probe.test(sock)2501 self.maxDiff = None2502 self.assertEqual(sock.sent_data,2503 [b"\x16\x03\x01\x00\x91"2504 b"\x01\x00\x00\x8d"2505 b"\x03\x03" +2506 RANDOM_STR +2507 b"\x00"2508 b"\x00^" +2509 DEFAULT_PFS_CIPHERS_STR +2510 b"\x01\x00"2511 b'\x00\x06'2512 b'\x00\x06\x00\x02'2513 b'\x02\x40'])2514class TestClientAuthzNull(unittest.TestCase):2515 def test_test(self):2516 probe = ClientAuthzNull()2517 sock = MockSock()2518 probe.test(sock)2519 self.assertEqual(sock.sent_data,2520 [b'\x16\x03\x01\x00?'2521 b'\x01\x00\x00;'2522 b'\x03\x01' +2523 RANDOM_STR +2524 b'\x00'2525 b'\x00\x0e' +2526 DEFAULT_CIPHERS_STR +2527 b'\x01\x00'2528 b'\x00\x04'2529 b'\x00\x07\x00\x00'])2530class TestClientAuthzNull12(unittest.TestCase):2531 def test_test(self):2532 probe = ClientAuthzNull12()2533 sock = MockSock()2534 probe.test(sock)2535 self.assertEqual(sock.sent_data,2536 [b'\x16\x03\x01\x00W'2537 b'\x01\x00\x00S'2538 b'\x03\x03' +2539 RANDOM_STR +2540 b'\x00'2541 b'\x00&' +2542 DEFAULT_12_CIPHERS_STR +2543 b'\x01\x00'2544 b'\x00\x04'2545 b'\x00\x07\x00\x00'])2546class TestClientAuthzNull12PFS(unittest.TestCase):2547 def test_test(self):2548 probe = ClientAuthzNull12PFS()2549 sock = MockSock()2550 probe.test(sock)2551 self.maxDiff = None2552 self.assertEqual(sock.sent_data,2553 [b"\x16\x03\x01\x00\x8f"2554 b"\x01\x00\x00\x8b"2555 b"\x03\x03" +2556 RANDOM_STR +2557 b"\x00"2558 b"\x00^" +2559 DEFAULT_PFS_CIPHERS_STR +2560 b"\x01\x00"2561 b'\x00\x04'2562 b'\x00\x07\x00\x00'])2563class TestClientAuthzOverflow(unittest.TestCase):2564 def test_test(self):2565 probe = ClientAuthzOverflow()2566 sock = MockSock()2567 probe.test(sock)2568 self.maxDiff = None2569 self.assertEqual(sock.sent_data,2570 [b'\x16\x03\x01\x00B'2571 b'\x01\x00\x00>'2572 b'\x03\x01' +2573 RANDOM_STR +2574 b'\x00'2575 b'\x00\x0e' +2576 DEFAULT_CIPHERS_STR +2577 b'\x01\x00'2578 b'\x00\x07'2579 b'\x00\x07\x00\x03'2580 b'\x04\x00\x01'])2581class TestClientAuthzOverflow12(unittest.TestCase):2582 def test_test(self):2583 probe = ClientAuthzOverflow12()2584 sock = MockSock()2585 probe.test(sock)2586 self.assertEqual(sock.sent_data,2587 [b'\x16\x03\x01\x00Z'2588 b'\x01\x00\x00V'2589 b'\x03\x03' +2590 RANDOM_STR +2591 b'\x00'2592 b'\x00&' +2593 DEFAULT_12_CIPHERS_STR +2594 b'\x01\x00'2595 b'\x00\x07'2596 b'\x00\x07\x00\x03'2597 b'\x04\x00\x01'])2598class TestClientAuthzOverflow12FS(unittest.TestCase):2599 def test_test(self):2600 probe = ClientAuthzOverflow12PFS()2601 sock = MockSock()2602 probe.test(sock)2603 self.maxDiff = None2604 self.assertEqual(sock.sent_data,2605 [b"\x16\x03\x01\x00\x92"2606 b"\x01\x00\x00\x8e"2607 b"\x03\x03" +2608 RANDOM_STR +2609 b"\x00"2610 b"\x00^" +2611 DEFAULT_PFS_CIPHERS_STR +2612 b"\x01\x00"2613 b'\x00\x07'2614 b'\x00\x07\x00\x03'2615 b'\x04\x00\x01'])2616class TestServerAuthzNull(unittest.TestCase):2617 def test_test(self):2618 probe = ServerAuthzNull()2619 sock = MockSock()2620 probe.test(sock)2621 self.assertEqual(sock.sent_data,2622 [b'\x16\x03\x01\x00?'2623 b'\x01\x00\x00;'2624 b'\x03\x01' +2625 RANDOM_STR +2626 b'\x00'2627 b'\x00\x0e' +2628 DEFAULT_CIPHERS_STR +2629 b'\x01\x00'2630 b'\x00\x04'2631 b'\x00\x08\x00\x00'])2632class TestServerAuthzNull12(unittest.TestCase):2633 def test_test(self):2634 probe = ServerAuthzNull12()2635 sock = MockSock()2636 probe.test(sock)2637 self.assertEqual(sock.sent_data,2638 [b'\x16\x03\x01\x00W'2639 b'\x01\x00\x00S'2640 b'\x03\x03' +2641 RANDOM_STR +2642 b'\x00'2643 b'\x00&' +2644 DEFAULT_12_CIPHERS_STR +2645 b'\x01\x00'2646 b'\x00\x04'2647 b'\x00\x08\x00\x00'])2648class TestServerAuthzNull12PFS(unittest.TestCase):2649 def test_test(self):2650 probe = ServerAuthzNull12PFS()2651 sock = MockSock()2652 probe.test(sock)2653 self.maxDiff = None2654 self.assertEqual(sock.sent_data,2655 [b"\x16\x03\x01\x00\x8f"2656 b"\x01\x00\x00\x8b"2657 b"\x03\x03" +2658 RANDOM_STR +2659 b"\x00"2660 b"\x00^" +2661 DEFAULT_PFS_CIPHERS_STR +2662 b"\x01\x00"2663 b'\x00\x04'2664 b'\x00\x08\x00\x00'])2665class TestServerAuthzOverflow(unittest.TestCase):2666 def test_test(self):2667 probe = ServerAuthzOverflow()2668 sock = MockSock()2669 probe.test(sock)2670 self.maxDiff = None2671 self.assertEqual(sock.sent_data,2672 [b'\x16\x03\x01\x00B'2673 b'\x01\x00\x00>'2674 b'\x03\x01' +2675 RANDOM_STR +2676 b'\x00'2677 b'\x00\x0e' +2678 DEFAULT_CIPHERS_STR +2679 b'\x01\x00'2680 b'\x00\x07'2681 b'\x00\x08\x00\x03'2682 b'\x04\x00\x01'])2683class TestServerAuthzOverflow12(unittest.TestCase):2684 def test_test(self):2685 probe = ServerAuthzOverflow12()2686 sock = MockSock()2687 probe.test(sock)2688 self.assertEqual(sock.sent_data,2689 [b'\x16\x03\x01\x00Z'2690 b'\x01\x00\x00V'2691 b'\x03\x03' +2692 RANDOM_STR +2693 b'\x00'2694 b'\x00&' +2695 DEFAULT_12_CIPHERS_STR +2696 b'\x01\x00'2697 b'\x00\x07'2698 b'\x00\x08\x00\x03'2699 b'\x04\x00\x01'])2700class TestServerAuthzOverflow12FS(unittest.TestCase):2701 def test_test(self):2702 probe = ServerAuthzOverflow12PFS()2703 sock = MockSock()2704 probe.test(sock)2705 self.maxDiff = None2706 self.assertEqual(sock.sent_data,2707 [b"\x16\x03\x01\x00\x92"2708 b"\x01\x00\x00\x8e"2709 b"\x03\x03" +2710 RANDOM_STR +2711 b"\x00"2712 b"\x00^" +2713 DEFAULT_PFS_CIPHERS_STR +2714 b"\x01\x00"2715 b'\x00\x07'2716 b'\x00\x08\x00\x03'2717 b'\x04\x00\x01'])2718class TestCertTypeNull(unittest.TestCase):2719 def test_test(self):2720 probe = CertTypeNull()2721 sock = MockSock()2722 probe.test(sock)2723 self.assertEqual(sock.sent_data,2724 [b'\x16\x03\x01\x00?'2725 b'\x01\x00\x00;'2726 b'\x03\x01' +2727 RANDOM_STR +2728 b'\x00'2729 b'\x00\x0e' +2730 DEFAULT_CIPHERS_STR +2731 b'\x01\x00'2732 b'\x00\x04'2733 b'\x00\x09\x00\x00'])2734class TestCertTypeNull12(unittest.TestCase):2735 def test_test(self):2736 probe = CertTypeNull12()2737 sock = MockSock()2738 probe.test(sock)2739 self.assertEqual(sock.sent_data,2740 [b'\x16\x03\x01\x00W'2741 b'\x01\x00\x00S'2742 b'\x03\x03' +2743 RANDOM_STR +2744 b'\x00'2745 b'\x00&' +2746 DEFAULT_12_CIPHERS_STR +2747 b'\x01\x00'2748 b'\x00\x04'2749 b'\x00\x09\x00\x00'])2750class TestCertTypeNull12PFS(unittest.TestCase):2751 def test_test(self):2752 probe = CertTypeNull12PFS()2753 sock = MockSock()2754 probe.test(sock)2755 self.maxDiff = None2756 self.assertEqual(sock.sent_data,2757 [b"\x16\x03\x01\x00\x8f"2758 b"\x01\x00\x00\x8b"2759 b"\x03\x03" +2760 RANDOM_STR +2761 b"\x00"2762 b"\x00^" +2763 DEFAULT_PFS_CIPHERS_STR +2764 b"\x01\x00"2765 b'\x00\x04'2766 b'\x00\x09\x00\x00'])2767class TestCertTypeOverflow(unittest.TestCase):2768 def test_test(self):2769 probe = CertTypeOverflow()2770 sock = MockSock()2771 probe.test(sock)2772 self.maxDiff = None2773 self.assertEqual(sock.sent_data,2774 [b'\x16\x03\x01\x00A'2775 b'\x01\x00\x00='2776 b'\x03\x01' +2777 RANDOM_STR +2778 b'\x00'2779 b'\x00\x0e' +2780 DEFAULT_CIPHERS_STR +2781 b'\x01\x00'2782 b'\x00\x06'2783 b'\x00\x09\x00\x02'2784 b'\x04\x01'])2785class TestCertTypeOverflow12(unittest.TestCase):2786 def test_test(self):2787 probe = CertTypeOverflow12()2788 sock = MockSock()2789 probe.test(sock)2790 self.assertEqual(sock.sent_data,2791 [b'\x16\x03\x01\x00Y'2792 b'\x01\x00\x00U'2793 b'\x03\x03' +2794 RANDOM_STR +2795 b'\x00'2796 b'\x00&' +2797 DEFAULT_12_CIPHERS_STR +2798 b'\x01\x00'2799 b'\x00\x06'2800 b'\x00\x09\x00\x02'2801 b'\x04\x01'])2802class TestCertTypeOverflow12PFS(unittest.TestCase):2803 def test_test(self):2804 probe = CertTypeOverflow12PFS()2805 sock = MockSock()2806 probe.test(sock)2807 self.maxDiff = None2808 self.assertEqual(sock.sent_data,2809 [b"\x16\x03\x01\x00\x91"2810 b"\x01\x00\x00\x8d"2811 b"\x03\x03" +2812 RANDOM_STR +2813 b"\x00"2814 b"\x00^" +2815 DEFAULT_PFS_CIPHERS_STR +2816 b"\x01\x00"2817 b'\x00\x06'2818 b'\x00\x09\x00\x02'2819 b'\x04\x01'])2820class TestSupportedGroupsNull(unittest.TestCase):2821 def test_test(self):2822 probe = SupportedGroupsNull()2823 sock = MockSock()2824 probe.test(sock)2825 self.assertEqual(sock.sent_data,2826 [b'\x16\x03\x01\x00?'2827 b'\x01\x00\x00;'2828 b'\x03\x01' +2829 RANDOM_STR +2830 b'\x00'2831 b'\x00\x0e' +2832 DEFAULT_CIPHERS_STR +2833 b'\x01\x00'2834 b'\x00\x04'2835 b'\x00\x0a\x00\x00'])2836class TestSupportedGroupsNull12(unittest.TestCase):2837 def test_test(self):2838 probe = SupportedGroupsNull12()2839 sock = MockSock()2840 probe.test(sock)2841 self.assertEqual(sock.sent_data,2842 [b'\x16\x03\x01\x00W'2843 b'\x01\x00\x00S'2844 b'\x03\x03' +2845 RANDOM_STR +2846 b'\x00'2847 b'\x00&' +2848 DEFAULT_12_CIPHERS_STR +2849 b'\x01\x00'2850 b'\x00\x04'2851 b'\x00\x0a\x00\x00'])2852class TestSupportedGroupsNull12PFS(unittest.TestCase):2853 def test_test(self):2854 probe = SupportedGroupsNull12PFS()2855 sock = MockSock()2856 probe.test(sock)2857 self.maxDiff = None2858 self.assertEqual(sock.sent_data,2859 [b'\x16\x03\x01\x00\x8f'2860 b'\x01\x00\x00\x8b'2861 b'\x03\x03' +2862 RANDOM_STR +2863 b'\x00'2864 b'\x00^' +2865 DEFAULT_PFS_CIPHERS_STR +2866 b'\x01\x00'2867 b'\x00\x04'2868 b'\x00\x0a\x00\x00'])2869class TestSupportedGroupsOddLen(unittest.TestCase):2870 def test_test(self):2871 probe = SupportedGroupsOddLen()2872 sock = MockSock()2873 probe.test(sock)2874 self.maxDiff = None2875 self.assertEqual(sock.sent_data,2876 [b'\x16\x03\x01\x00D'2877 b'\x01\x00\x00@'2878 b'\x03\x01' +2879 RANDOM_STR +2880 b'\x00'2881 b'\x00\x0e' +2882 DEFAULT_CIPHERS_STR +2883 b'\x01\x00'2884 b'\x00\x09'2885 b'\x00\x0a\x00\x05'2886 b'\x00\x03\x00\x17\x00'])2887class TestSupportedGroupsOddLen12(unittest.TestCase):2888 def test_test(self):2889 probe = SupportedGroupsOddLen12()2890 sock = MockSock()2891 probe.test(sock)2892 self.assertEqual(sock.sent_data,2893 [b'\x16\x03\x01\x00\\'2894 b'\x01\x00\x00X'2895 b'\x03\x03' +2896 RANDOM_STR +2897 b'\x00'2898 b'\x00&' +2899 DEFAULT_12_CIPHERS_STR +2900 b'\x01\x00'2901 b'\x00\x09'2902 b'\x00\x0a\x00\x05'2903 b'\x00\x03\x00\x17\x00'])2904class TestSupportedGroupsOddLen12PFS(unittest.TestCase):2905 def test_test(self):2906 probe = SupportedGroupsOddLen12PFS()2907 sock = MockSock()2908 probe.test(sock)2909 self.maxDiff = None2910 self.assertEqual(sock.sent_data,2911 [b"\x16\x03\x01\x00\x94"2912 b"\x01\x00\x00\x90"2913 b"\x03\x03" +2914 RANDOM_STR +2915 b"\x00"2916 b"\x00^" +2917 DEFAULT_PFS_CIPHERS_STR +2918 b"\x01\x00"2919 b'\x00\x09'2920 b'\x00\x0a\x00\x05'2921 b'\x00\x03\x00\x17\x00'])2922class TestSupportedGroupsOverflow(unittest.TestCase):2923 def test_test(self):2924 probe = SupportedGroupsOverflow()2925 sock = MockSock()2926 probe.test(sock)2927 self.maxDiff = None2928 self.assertEqual(sock.sent_data,2929 [b'\x16\x03\x01\x00C'2930 b'\x01\x00\x00?'2931 b'\x03\x01' +2932 RANDOM_STR +2933 b'\x00'2934 b'\x00\x0e' +2935 DEFAULT_CIPHERS_STR +2936 b'\x01\x00'2937 b'\x00\x08'2938 b'\x00\x0a\x00\x04'2939 b'\x00\x04\x00\x17'])2940class TestSupportedGroupsOverflow12(unittest.TestCase):2941 def test_test(self):2942 probe = SupportedGroupsOverflow12()2943 sock = MockSock()2944 probe.test(sock)2945 self.assertEqual(sock.sent_data,2946 [b'\x16\x03\x01\x00['2947 b'\x01\x00\x00W'2948 b'\x03\x03' +2949 RANDOM_STR +2950 b'\x00'2951 b'\x00&' +2952 DEFAULT_12_CIPHERS_STR +2953 b'\x01\x00'2954 b'\x00\x08'2955 b'\x00\x0a\x00\x04'2956 b'\x00\x04\x00\x17'])2957class TestSupportedGroupsOverflow12PFS(unittest.TestCase):2958 def test_test(self):2959 probe = SupportedGroupsOverflow12PFS()2960 sock = MockSock()2961 probe.test(sock)2962 self.maxDiff = None2963 self.assertEqual(sock.sent_data,2964 [b"\x16\x03\x01\x00\x93"2965 b"\x01\x00\x00\x8f"2966 b"\x03\x03" +2967 RANDOM_STR +2968 b"\x00"2969 b"\x00^" +2970 DEFAULT_PFS_CIPHERS_STR +2971 b"\x01\x00"2972 b'\x00\x08'2973 b'\x00\x0a\x00\x04'2974 b'\x00\x04\x00\x17'])2975class TestPadding16384Byte(unittest.TestCase):2976 def test_test(self):2977 probe = Padding16384Byte()2978 sock = MockSock()2979 probe.test(sock)2980 self.maxDiff = None2981 expected = (b'\x16\x03\x01\x40\x00'2982 b'\x01\x00\x3f\xfc'2983 b'\x03\x01' +2984 RANDOM_STR +2985 b'\x00'2986 b'\x00\x0e' +2987 DEFAULT_CIPHERS_STR +2988 b'\x01\x00'2989 b'\x3f\xc5'2990 b'\x00\x15\x3f\xc1' +2991 b'\x00' * (16384 - (64-5) - 4))2992 self.assertEqual(repr(sock.sent_data[0][:70]),2993 repr(expected[:70]))2994 self.assertEqual(sock.sent_data,2995 [expected])2996class TestPadding16384Byte12(unittest.TestCase):2997 def test_test(self):2998 probe = Padding16384Byte12()2999 sock = MockSock()3000 probe.test(sock)3001 self.maxDiff = None3002 expected = (b'\x16\x03\x01\x40\x00'3003 b'\x01\x00\x3f\xfc'3004 b'\x03\x03' +3005 RANDOM_STR +3006 b'\x00'3007 b'\x00&' +3008 DEFAULT_12_CIPHERS_STR +3009 b'\x01\x00'3010 b'\x3f\xad'3011 b'\x00\x15\x3f\xa9' +3012 b'\x00' * (16384 - (88-5) - 4))3013 self.assertEqual(repr(sock.sent_data[0][:100]),3014 repr(expected[:100]))3015 self.assertEqual(sock.sent_data,3016 [expected])3017class TestPadding16384Byte12PFS(unittest.TestCase):3018 def test_test(self):3019 probe = Padding16384Byte12PFS()3020 sock = MockSock()3021 probe.test(sock)3022 self.maxDiff = None3023 expected = (b'\x16\x03\x01\x40\x00'3024 b'\x01\x00\x3f\xfc'3025 b'\x03\x03' +3026 RANDOM_STR +3027 b'\x00'3028 b'\x00^' +3029 DEFAULT_PFS_CIPHERS_STR +3030 b'\x01\x00'3031 b'\x3fu'3032 b'\x00\x15\x3fq' +3033 b'\x00' * (16384 - (144-5) - 4))3034 self.assertEqual(repr(sock.sent_data[0][:160]),3035 repr(expected[:160]))3036 self.assertEqual(sock.sent_data,3037 [expected])3038class TestPadding16385Byte(unittest.TestCase):3039 def test_test(self):3040 probe = Padding16385Byte()3041 sock = MockSock()3042 probe.test(sock)3043 self.maxDiff = None3044 expected = (b'\x16\x03\x01\x40\x00'3045 b'\x01\x00\x3f\xfd'3046 b'\x03\x01' +3047 RANDOM_STR +3048 b'\x00'3049 b'\x00\x0e' +3050 DEFAULT_CIPHERS_STR +3051 b'\x01\x00'3052 b'\x3f\xc6'3053 b'\x00\x15\x3f\xc2' +3054 b'\x00' * (16385 - (64-5) - 4 - 1) +3055 b'\x16\x03\x01\x00\x01' # second record3056 b'\x00')3057 self.assertEqual(repr(sock.sent_data[0][:70]),3058 repr(expected[:70]))3059 self.assertEqual(sock.sent_data,3060 [expected])3061class TestPadding16385Byte12(unittest.TestCase):3062 def test_test(self):3063 probe = Padding16385Byte12()3064 sock = MockSock()3065 probe.test(sock)3066 self.maxDiff = None3067 expected = (b'\x16\x03\x01\x40\x00'3068 b'\x01\x00\x3f\xfd'3069 b'\x03\x03' +3070 RANDOM_STR +3071 b'\x00'3072 b'\x00&' +3073 DEFAULT_12_CIPHERS_STR +3074 b'\x01\x00'3075 b'\x3f\xae'3076 b'\x00\x15\x3f\xaa' +3077 b'\x00' * (16385 - (88-5) - 4 -1 ) +3078 b'\x16\x03\x01\x00\x01' # second record3079 b'\x00')3080 self.assertEqual(repr(sock.sent_data[0][:100]),3081 repr(expected[:100]))3082 self.assertEqual(sock.sent_data,3083 [expected])3084class TestPadding16385Byte12PFS(unittest.TestCase):3085 def test_test(self):3086 probe = Padding16385Byte12PFS()3087 sock = MockSock()3088 probe.test(sock)3089 self.maxDiff = None3090 expected = (b'\x16\x03\x01\x40\x00'3091 b'\x01\x00\x3f\xfd'3092 b'\x03\x03' +3093 RANDOM_STR +3094 b'\x00'3095 b'\x00^' +3096 DEFAULT_PFS_CIPHERS_STR +3097 b'\x01\x00'3098 b'\x3fv'3099 b'\x00\x15\x3fr' +...

Full Screen

Full Screen

run-tests.py

Source:run-tests.py Github

copy

Full Screen

...26# Example Sudoku from Wikipedia's sudoku page (7/2015) 27assert(JSolve("530070000600195000098000060800060003400803001700020006060000280000419005000080079", 100) == 1)28assert(JSolve("53..7....6..195....98....6.8...6...34..8.3..17...2...6.6....28....419..5....8..79", 100) == 1)29# Captured output. This should not change.30def test_test(intxt):31 assert(test(intxt[0:81], compute_possible_left_sides()) == intxt)32test_test("123456789........1........2........4........7........8........3........5497513826, 0, 632, 2400")33test_test("123456789........1........2........4........5........7........6........8298675413, 0, 1042, 3600")34test_test("123456789........1........4........2........7........8........3........5539728416, 0, 582, 2400")35test_test("123456789........2........4........5........7........8........1........6967125843, 0, 742, 2400")36test_test("123456789........1........4........2........5........7........3........8835179246, 0, 560, 2400")37test_test("123456789........1........4........5........7........8........2........3234798156, 0, 810, 3600")38test_test("123456789........1........4........2........5........7........3........8289734516, 0, 930, 3600")39test_test("123456789........1........4........2........5........7........3........8542398176, 0, 272, 2400")40test_test("123456789........1........4........2........5........7........3........6516374928, 0, 862, 2400")41test_test("123456789........1........2........3........4........7........5........8745891236, 0, 790, 2400")42test_test("123456789........1........2........4........5........7........3........8814523976, 0, 952, 2400")43test_test("123456789........2........3........1........4........7........5........8947385216, 0, 640, 2400")44test_test("123456789........2........4........1........5........7........6........8417968253, 0, 1008, 2400")45test_test("123456789........1........4........5........7........8........2........3241375896, 0, 1108, 3600")46test_test("123456789........2........4........3........7........8........1........5471582396, 0, 980, 2400")47test_test("123456789........2........4........1........5........7........6........8286714593, 0, 1228, 3600")48test_test("123456789........1........2........4........5........7........3........8248513976, 0, 888, 3600")49test_test("123456789........2........4........3........7........8........1........5514297836, 0, 888, 2400")50test_test("123456789........1........4........2........5........7........3........8574983126, 0, 464, 2400")51test_test("123456789........1........4........2........5........6........7........8475968213, 0, 704, 2400")52test_test("123456789........2........4........1........3........7........5........8917285436, 0, 805, 2400")53test_test("123456789........2........4........5........7........8........1........6965781243, 0, 742, 2400")54test_test("123456789........1........2........3........4........7........5........6752641938, 0, 652, 2400")55test_test("123456789........1........4........2........5........7........3........8947832516, 0, 420, 2400")56test_test("123456789........4........5........6........7........8........2........3437628951, 0, 437, 2400")57test_test("123456789........2........4........3........5........7........6........8965387421, 0, 602, 2400")58test_test("123456789........4........5........6........7........8........1........2612798453, 0, 774, 2400")59test_test("123456789........4........5........6........7........8........2........3634782951, 0, 370, 2400")60test_test("123456789........1........2........4........7........8........5........6576819243, 0, 872, 2400")61test_test("123456789........1........2........4........7........8........3........5435178926, 0, 824, 2400")62test_test("123456789........1........4........2........3........5........7........8275381946, 0, 920, 3600")63test_test("123456789........2........4........5........7........8........1........3751243896, 0, 890, 2400")64test_test("123456789........1........4........2........5........7........6........8986527413, 0, 732, 2400")65test_test("123456789........4........5........6........7........8........1........2249178653, 0, 874, 3600")66test_test("123456789........1........2........3........4........7........5........8258743916, 0, 1200, 3600")67test_test("123456789........1........4........2........5........7........3........6241563978, 0, 1072, 3600")68test_test("123456789........4........5........2........7........8........3........6947635821, 0, 364, 2400")69test_test("123456789........1........4........2........7........8........5........6547682913, 0, 544, 2400")70test_test("123456789........2........4........3........5........7........6........8592687341, 0, 459, 2400")71test_test("123456789........1........2........3........7........8........4........5412795836, 0, 838, 2400")72test_test("123456789........1........4........2........7........8........3........5785293146, 0, 606, 2400")73test_test("123456789........2........4........5........6........7........3........8536872491, 0, 543, 2400")74test_test("123456789........2........4........1........5........7........6........8987612453, 0, 704, 2400")75test_test("123456789........4........5........2........7........8........3........6476389251, 0, 544, 2400")76test_test("123456789........2........4........5........7........8........1........6942615873, 0, 459, 2400")77test_test("123456789........2........4........5........7........8........3........6475683921, 0, 532, 2400")78test_test("123456789........1........4........2........5........7........3........8458372916, 0, 640, 2400")79test_test("123456789........1........2........4........5........6........3........7934527618, 0, 582, 2400")80test_test("123456789........4........5........1........7........8........2........6475962813, 0, 483, 2400")81test_test("123456789........2........3........4........5........6........7........8457628391, 0, 820, 2400")82test_test("123456789........2........4........5........7........8........1........6612574893, 0, 852, 2400")83test_test("123456789........2........4........1........5........7........6........8476918523, 0, 820, 2400")...

Full Screen

Full Screen

test_modelQuiz.py

Source:test_modelQuiz.py Github

copy

Full Screen

1import os2import unittest3#4from src import instantiate_test_app, db5from src.auth.models import User6from src.quiz.models import Result, Test, Question7from config import Config8class TestConfig(Config):9 TESTING = True10<<<<<<< HEAD11 SQLALCHEMY_DATABASE_URI = os.environ.get("TEST_DATABASE_URL")12=======13 SQLALCHEMY_DATABASE_URI = os.environ.get("TEST_DATABASE_URL") or \14 "postgresql://postgres:postgres@localhost/testflaskapp"15>>>>>>> main16class TestModelCase(unittest.TestCase):17 def setUp(self):18 self.app = instantiate_test_app(TestConfig)19 self.app_context = self.app.app_context()20 self.app_context.push()21 db.create_all()22 self.test_test = Test(title="Custom Title", description="Custom Test")23 db.session.add(self.test_test)24 db.session.commit()25 self.client = self.app.test_client()26 def tearDown(self):27 db.session.remove()28 db.drop_all()29 self.app_context.pop()30 def test_test_add(self):31 test_test = Test(title="Custom Title 2", description="Custom Test 2")32 db.session.add(test_test)33 db.session.commit()34 self.assertIn(test_test, Test.query.all())35 def test_test_update(self):36 self.assertEqual(self.test_test.title, "Custom Title")37 self.test_test.title = "Altered Title"38 db.session.commit()39 self.assertEqual(self.test_test.title, "Altered Title")40 def test_test_delete(self):41 self.assertIn(self.test_test, Test.query.all())42 db.session.delete(self.test_test)43 db.session.commit()44 no_test = Test.query.filter_by(title="Custom Title").first()45 self.assertIsNone(no_test)46 def test_num_questions(self):47 question = Question(test_id=self.test_test.id)48 db.session.add(question)49 db.session.commit()50 self.assertEqual(self.test_test.get_num_questions(), 1)51 def test_get_results(self):52 self.assertEqual(self.test_test.get_num_questions(), 0)53 self.assertEqual(self.test_test.get_best_result(), 0)54 self.assertEqual(self.test_test.get_last_result(), 0)55 user = User(username="testUser", email="test@user.com")56 user.encrypt_password("test_pass")57 db.session.add(user)58 db.session.commit()59 question = Question(text="Blah Blah", test_id=self.test_test.id)60 result_1 = Result(user_id=user.id, test_id=self.test_test.id)61 result_2 = Result(user_id=user.id, test_id=self.test_test.id, num_correct_answers=3)62 db.session.add(question)63 db.session.add(result_1)64 db.session.add(result_2)65 db.session.commit()66 self.assertEqual(self.test_test.get_num_questions(), 1)67 # self.assertEqual(self.test_test.get_best_result(), result_2) # TODO: LOGIN68 # self.assertEqual(self.test_test.get_last_result(), result_2)69 def test_tests_list_page(self):70 response = self.client.get("/tests/")71 self.assertEqual(response.status_code, 302)72if __name__ == '__main__':...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful