Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/tlslite/tests/tlstest.py

Issue 875683002: Implement AES-GCM in tlslite. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/tlslite/patches/aes_gcm.patch ('k') | third_party/tlslite/tlslite/constants.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Authors: 3 # Authors:
4 # Trevor Perrin 4 # Trevor Perrin
5 # Kees Bos - Added tests for XML-RPC 5 # Kees Bos - Added tests for XML-RPC
6 # Dimitris Moraitis - Anon ciphersuites 6 # Dimitris Moraitis - Anon ciphersuites
7 # Marcelo Fernandez - Added test for NPN 7 # Marcelo Fernandez - Added test for NPN
8 # Martin von Loewis - python 3 port 8 # Martin von Loewis - python 3 port
9 9
10 # 10 #
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 settings.cipherImplementations = [implementation, "python"] 311 settings.cipherImplementations = [implementation, "python"]
312 settings.minVersion = (3,1) 312 settings.minVersion = (3,1)
313 settings.maxVersion = (3,1) 313 settings.maxVersion = (3,1)
314 connection.handshakeClientCert(settings=settings) 314 connection.handshakeClientCert(settings=settings)
315 testConnClient(connection) 315 testConnClient(connection)
316 print("%s %s" % (connection.getCipherName(), connection.getCipherImp lementation())) 316 print("%s %s" % (connection.getCipherName(), connection.getCipherImp lementation()))
317 connection.close() 317 connection.close()
318 318
319 print("Test 23 - throughput test") 319 print("Test 23 - throughput test")
320 for implementation in implementations: 320 for implementation in implementations:
321 for cipher in ["aes128", "aes256", "3des", "rc4"]: 321 for cipher in ["aes128gcm", "aes128", "aes256", "3des", "rc4"]:
322 if cipher == "3des" and implementation not in ("openssl", "pycrypto" ): 322 if cipher == "3des" and implementation not in ("openssl", "pycrypto" ):
323 continue 323 continue
324 if cipher == "aes128gcm" and implementation not in ("pycrypto", "pyt hon"):
325 continue
324 326
325 print("Test 23:", end=' ') 327 print("Test 23:", end=' ')
326 connection = connect() 328 connection = connect()
327 329
328 settings = HandshakeSettings() 330 settings = HandshakeSettings()
329 settings.cipherNames = [cipher] 331 settings.cipherNames = [cipher]
330 settings.cipherImplementations = [implementation, "python"] 332 settings.cipherImplementations = [implementation, "python"]
331 connection.handshakeClientCert(settings=settings) 333 connection.handshakeClientCert(settings=settings)
332 print("%s %s:" % (connection.getCipherName(), connection.getCipherIm plementation()), end=' ') 334 print("%s %s:" % (connection.getCipherName(), connection.getCipherIm plementation()), end=' ')
333 335
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 settings.cipherImplementations = [implementation, "python"] 673 settings.cipherImplementations = [implementation, "python"]
672 674
673 connection.handshakeServer(certChain=x509Chain, privateKey=x509Key, 675 connection.handshakeServer(certChain=x509Chain, privateKey=x509Key,
674 settings=settings) 676 settings=settings)
675 print(connection.getCipherName(), connection.getCipherImplementation ()) 677 print(connection.getCipherName(), connection.getCipherImplementation ())
676 testConnServer(connection) 678 testConnServer(connection)
677 connection.close() 679 connection.close()
678 680
679 print("Test 23 - throughput test") 681 print("Test 23 - throughput test")
680 for implementation in implementations: 682 for implementation in implementations:
681 for cipher in ["aes128", "aes256", "3des", "rc4"]: 683 for cipher in ["aes128gcm", "aes128", "aes256", "3des", "rc4"]:
682 if cipher == "3des" and implementation not in ("openssl", "pycrypto" ): 684 if cipher == "3des" and implementation not in ("openssl", "pycrypto" ):
683 continue 685 continue
686 if cipher == "aes128gcm" and implementation not in ("pycrypto", "pyt hon"):
687 continue
684 688
685 print("Test 23:", end=' ') 689 print("Test 23:", end=' ')
686 connection = connect() 690 connection = connect()
687 691
688 settings = HandshakeSettings() 692 settings = HandshakeSettings()
689 settings.cipherNames = [cipher] 693 settings.cipherNames = [cipher]
690 settings.cipherImplementations = [implementation, "python"] 694 settings.cipherImplementations = [implementation, "python"]
691 695
692 connection.handshakeServer(certChain=x509Chain, privateKey=x509Key, 696 connection.handshakeServer(certChain=x509Chain, privateKey=x509Key,
693 settings=settings) 697 settings=settings)
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 788
785 if __name__ == '__main__': 789 if __name__ == '__main__':
786 if len(sys.argv) < 2: 790 if len(sys.argv) < 2:
787 printUsage("Missing command") 791 printUsage("Missing command")
788 elif sys.argv[1] == "client"[:len(sys.argv[1])]: 792 elif sys.argv[1] == "client"[:len(sys.argv[1])]:
789 clientTestCmd(sys.argv[2:]) 793 clientTestCmd(sys.argv[2:])
790 elif sys.argv[1] == "server"[:len(sys.argv[1])]: 794 elif sys.argv[1] == "server"[:len(sys.argv[1])]:
791 serverTestCmd(sys.argv[2:]) 795 serverTestCmd(sys.argv[2:])
792 else: 796 else:
793 printUsage("Unknown command: %s" % sys.argv[1]) 797 printUsage("Unknown command: %s" % sys.argv[1])
OLDNEW
« no previous file with comments | « third_party/tlslite/patches/aes_gcm.patch ('k') | third_party/tlslite/tlslite/constants.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698