From 3d438903d01a166821f05bc1ca0e28a2021c8190 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 26 Oct 2017 16:53:59 +0200 Subject: Add `--maxcerts' argument to submitcert.py. Patch by Magnus Ahltorp from map/submission-fix. --- tools/submitcert.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools') diff --git a/tools/submitcert.py b/tools/submitcert.py index 9d96148..cc483f1 100755 --- a/tools/submitcert.py +++ b/tools/submitcert.py @@ -26,6 +26,7 @@ parser.add_argument('baseurl', help="Base URL for CT server") parser.add_argument('--store', default=None, metavar="dir", help='Get certificates from directory dir') parser.add_argument('--sct-file', default=None, metavar="file", help='Store SCT:s in file') parser.add_argument('--parallel', type=int, default=16, metavar="n", help="Number of parallel submits") +parser.add_argument('--maxcerts', type=int, metavar="n", help="Maximum number of certificates to submit") parser.add_argument('--check-sct', action='store_true', help="Check SCT signature") parser.add_argument('--pre-warm', action='store_true', help="Wait 3 seconds after first submit") parser.add_argument('--publickey', default=None, metavar="file", help='Public key for the CT log') @@ -187,6 +188,9 @@ lastprinted = 0 print "listing certs" ncerts = get_ncerts(certfiles) +if args.maxcerts: + ncerts = min(ncerts, args.maxcerts) + print ncerts, "certs" certs = itertools.islice(get_all_certificates(certfiles), ncerts) -- cgit v1.1