From ff777b6a6938ba312768f5934701352b1473f189 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 21 Nov 2016 10:16:02 -0500 Subject: Add timeouts to TLS scanner [ci skip] --- src/extra_tests/tls_scanner/tls_scanner.py | 13 +++++++++++-- src/extra_tests/tls_scanner/urls.txt | 8 ++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/extra_tests/tls_scanner/tls_scanner.py b/src/extra_tests/tls_scanner/tls_scanner.py index f36ee6bfa..8fdf046ca 100755 --- a/src/extra_tests/tls_scanner/tls_scanner.py +++ b/src/extra_tests/tls_scanner/tls_scanner.py @@ -1,6 +1,7 @@ #!/usr/bin/python2 import sys +import time import subprocess import re @@ -27,16 +28,24 @@ def scanner(args = None): scanners = {} for url in [s.strip() for s in open(args[1]).readlines()]: - scanners[url] = subprocess.Popen(['../../../botan', 'tls_client', url], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) + scanners[url] = subprocess.Popen(['../../../botan', 'tls_client', '--policy=policy.txt', url], + stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) for url in scanners.keys(): scanners[url].stdin.close() report = {} + timeout = 10 for url in scanners.keys(): print "waiting for", url - scanners[url].wait() + + for i in range(timeout): + scanners[url].poll() + if scanners[url].returncode != None: + break + #print "Waiting %d more seconds for %s" % (timeout-i, url) + time.sleep(1) if scanners[url].returncode != None: output = scanners[url].stdout.read() + scanners[url].stderr.read() diff --git a/src/extra_tests/tls_scanner/urls.txt b/src/extra_tests/tls_scanner/urls.txt index 33c7e0870..a5bcf349e 100644 --- a/src/extra_tests/tls_scanner/urls.txt +++ b/src/extra_tests/tls_scanner/urls.txt @@ -22,7 +22,6 @@ hp.com huawei.com ibm.com ietf.org -intel.com intuit.com linkedin.com medium.com @@ -32,6 +31,12 @@ nec.com netflix.com openssl.org oracle.com +sgi.com +chase.com +bankofamerica.com +citibank.com +wellsfargo.com +ebay.com paypal.com pwc.com randombit.net @@ -42,7 +47,6 @@ sas.com siemens.com sony.com stripe.com -swift.com symantec.com tls.mbed.org twitter.com -- cgit v1.2.3