tstclnt_arguments.py (1838B)
1 #!/usr/bin/env python 2 # This Source Code Form is subject to the terms of the Mozilla Public 3 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # file, You can obtain one at https://mozilla.org/MPL/2.0/. 5 6 import random 7 import string 8 9 ECH_CONFIGS ="AEX+DQBBcQAgACDh4IuiuhhInUcKZx5uYcehlG9PQ1ZlzhvVZyjJl7dscQAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA=" 10 11 12 def main(): 13 # Use Encrypted Client Hello with the given Base64-encoded ECHConfigs. 14 if random.randint(0, 1): 15 print(f"-N {ECH_CONFIGS}") 16 17 # Configure a TLS 1.3 External PSK with the given hex string for a key. 18 if random.randint(0, 1): 19 print(f"-z 0x{''.join(random.choices(string.hexdigits, k=16))}") 20 21 # Enable the session ticket extension. 22 if random.randint(0, 1): 23 print("-u") 24 25 # Enable the cert_status extension (OCSP stapling). 26 if random.randint(0, 1): 27 print("-T") 28 29 # Enable the signed_certificate_timestamp extension. 30 if random.randint(0, 1): 31 print("-U") 32 33 # Enable the delegated credentials extension. 34 if random.randint(0, 1): 35 print("-B") 36 37 # Enable the extended master secret extension [RFC7627). 38 if random.randint(0, 1): 39 print("-G") 40 41 # Allow 0-RTT data (TLS 1.3 only). 42 if random.randint(0, 1): 43 print("-Z") 44 45 # Enable Encrypted Client Hello GREASEing with the given padding size (0-255). 46 if random.randint(0, 1): 47 print(f"-i {random.randint(0, 255)}") 48 49 # Enable middlebox compatibility mode (TLS 1.3 only). 50 if random.randint(0, 1): 51 print("-e") 52 53 if random.randint(0, 1): 54 print("--enable-rfc8701-grease") 55 56 if random.randint(0, 1): 57 print("--enable-ch-extension-permutation") 58 59 if random.randint(0, 1): 60 print("--zlib-certificate-compression") 61 62 63 if __name__ =="__main__": 64 main()