Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an option to disable record splitting #588

Merged
merged 1 commit into from Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/test-dhe-key-share-random.py
Expand Up @@ -42,6 +42,7 @@ def help_msg():
print(" (excluding \"sanity\" tests)")
print(" --repeat num repeat every test num times to collect the values")
print(" 32 by default")
print(" -z disable 1/n-1 record split for TLS1.0")
print(" --help this message")


Expand All @@ -52,9 +53,10 @@ def main():
num_limit = None
run_exclude = set()
repeats = 32
record_split = True

argv = sys.argv[1:]
opts, args = getopt.getopt(argv, "h:p:e:n:", ["help", "repeat="])
opts, args = getopt.getopt(argv, "h:p:e:n:z", ["help", "repeat="])
for opt, arg in opts:
if opt == '-h':
host = arg
Expand All @@ -64,6 +66,8 @@ def main():
run_exclude.add(arg)
elif opt == '-n':
num_limit = int(arg)
elif opt == '-z':
record_split = False
elif opt == '--help':
help_msg()
sys.exit(0)
Expand Down Expand Up @@ -145,7 +149,7 @@ def main():
node = node.add_child(ApplicationDataGenerator(
bytearray(b"GET / HTTP/1.0\n\n")))
node = node.add_child(ExpectApplicationData())
if prot < (3, 2):
if prot < (3, 2) and record_split:
# 1/n-1 record splitting
node = node.add_child(ExpectApplicationData())
node = node.add_child(AlertGenerator(AlertLevel.warning,
Expand Down
8 changes: 6 additions & 2 deletions scripts/test-dhe-no-shared-secret-padding.py
Expand Up @@ -43,6 +43,7 @@ def help_msg():
print(" --min-zeros m minimal number of zeros that have to be cut from")
print(" shared secret for test case to be valid,")
print(" 1 by default")
print(" -z disable 1/n-1 record split for TLS1.0")
print(" --help this message")


Expand All @@ -53,9 +54,10 @@ def main():
num_limit = None
run_exclude = set()
min_zeros = 1
record_split = True

argv = sys.argv[1:]
opts, args = getopt.getopt(argv, "h:p:e:n:", ["help", "min-zeros="])
opts, args = getopt.getopt(argv, "h:p:e:n:z", ["help", "min-zeros="])
for opt, arg in opts:
if opt == '-h':
host = arg
Expand All @@ -65,6 +67,8 @@ def main():
run_exclude.add(arg)
elif opt == '-n':
num_limit = int(arg)
elif opt == '-z':
record_split = False
elif opt == '--help':
help_msg()
sys.exit(0)
Expand Down Expand Up @@ -143,7 +147,7 @@ def main():
node = node.add_child(ApplicationDataGenerator(
bytearray(b"GET / HTTP/1.0\n\n")))
node = node.add_child(ExpectApplicationData())
if prot < (3, 2):
if prot < (3, 2) and record_split:
# 1/n-1 record splitting
node = node.add_child(ExpectApplicationData())
node = node.add_child(AlertGenerator(AlertLevel.warning,
Expand Down
8 changes: 6 additions & 2 deletions scripts/test-ecdhe-padded-shared-secret.py
Expand Up @@ -44,6 +44,7 @@ def help_msg():
print(" --min-zeros m minimal number of zeros that have to be cut from")
print(" shared secret for test case to be valid,")
print(" 1 by default")
print(" -z disable 1/n-1 record split for TLS1.0")
print(" --help this message")


Expand All @@ -54,9 +55,10 @@ def main():
num_limit = None
run_exclude = set()
min_zeros = 1
record_split = True

argv = sys.argv[1:]
opts, args = getopt.getopt(argv, "h:p:e:n:", ["help", "min-zeros="])
opts, args = getopt.getopt(argv, "h:p:e:n:z", ["help", "min-zeros="])
for opt, arg in opts:
if opt == '-h':
host = arg
Expand All @@ -66,6 +68,8 @@ def main():
run_exclude.add(arg)
elif opt == '-n':
num_limit = int(arg)
elif opt == '-z':
record_split = False
elif opt == '--help':
help_msg()
sys.exit(0)
Expand Down Expand Up @@ -164,7 +168,7 @@ def main():
node = node.add_child(ApplicationDataGenerator(
bytearray(b"GET / HTTP/1.0\n\n")))
node = node.add_child(ExpectApplicationData())
if prot < (3, 2):
if prot < (3, 2) and record_split:
# 1/n-1 record splitting
node = node.add_child(ExpectApplicationData())
node = node.add_child(AlertGenerator(AlertLevel.warning,
Expand Down
8 changes: 6 additions & 2 deletions scripts/test-ecdhe-rsa-key-share-random.py
Expand Up @@ -44,6 +44,7 @@ def help_msg():
print(" (excluding \"sanity\" tests)")
print(" --repeat num repeat every test num times to collect the values")
print(" 32 by default")
print(" -z disable 1/n-1 record split for TLS1.0")
print(" --help this message")


Expand All @@ -54,9 +55,10 @@ def main():
num_limit = None
run_exclude = set()
repeats = 32
record_split = True

argv = sys.argv[1:]
opts, args = getopt.getopt(argv, "h:p:e:n:", ["help", "repeat="])
opts, args = getopt.getopt(argv, "h:p:e:n:z", ["help", "repeat="])
for opt, arg in opts:
if opt == '-h':
host = arg
Expand All @@ -69,6 +71,8 @@ def main():
elif opt == '--help':
help_msg()
sys.exit(0)
elif opt == '-z':
record_split = False
elif opt == '--repeat':
repeats = int(arg)
else:
Expand Down Expand Up @@ -170,7 +174,7 @@ def main():
node = node.add_child(ApplicationDataGenerator(
bytearray(b"GET / HTTP/1.0\n\n")))
node = node.add_child(ExpectApplicationData())
if prot < (3, 2):
if prot < (3, 2) and record_split:
# 1/n-1 record splitting
node = node.add_child(ExpectApplicationData())
node = node.add_child(AlertGenerator(AlertLevel.warning,
Expand Down
8 changes: 6 additions & 2 deletions scripts/test-serverhello-random.py
Expand Up @@ -42,6 +42,7 @@ def help_msg():
print(" (excluding \"sanity\" tests)")
print(" --repeat num repeat every test num times to collect the values")
print(" 32 by default")
print(" -z disable 1/n-1 record split for TLS1.0")
print(" --help this message")


Expand All @@ -52,9 +53,10 @@ def main():
num_limit = None
run_exclude = set()
repeats = 32
record_split = True

argv = sys.argv[1:]
opts, args = getopt.getopt(argv, "h:p:e:n:", ["help", "repeat="])
opts, args = getopt.getopt(argv, "h:p:e:n:z", ["help", "repeat="])
for opt, arg in opts:
if opt == '-h':
host = arg
Expand All @@ -64,6 +66,8 @@ def main():
run_exclude.add(arg)
elif opt == '-n':
num_limit = int(arg)
elif opt == '-z':
record_split = False
elif opt == '--help':
help_msg()
sys.exit(0)
Expand Down Expand Up @@ -140,7 +144,7 @@ def main():
node = node.add_child(ApplicationDataGenerator(
bytearray(b"GET / HTTP/1.0\n\n")))
node = node.add_child(ExpectApplicationData())
if prot < (3, 2):
if prot < (3, 2) and record_split:
# 1/n-1 record splitting
node = node.add_child(ExpectApplicationData())
node = node.add_child(AlertGenerator(AlertLevel.warning,
Expand Down