From 5032b8f1783cad70675cdb07e00eb184f256a6e3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 16 Oct 2020 12:37:16 -0400 Subject: Regenerate complete failing_routerdescs.inc and adjust tests accordingly. --- scripts/codegen/makedesc.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/codegen/makedesc.py b/scripts/codegen/makedesc.py index 37ad4bd3bb..10941cc3fa 100644 --- a/scripts/codegen/makedesc.py +++ b/scripts/codegen/makedesc.py @@ -70,6 +70,26 @@ i2d_RSAPublicKey.argtypes = [ i2d_RSAPublicKey.restype = ctypes.c_int +HEADER = """\ +router fred 127.0.0.1 9001 0 9002 +identity-ed25519 +{d.ED_CERT} +signing-key +{d.RSA_IDENTITY} +master-key-ed25519 {d.ED_IDENTITY} +onion-key +{d.RSA_ONION_KEY} +ntor-onion-key {d.NTOR_ONION_KEY} +ntor-onion-key-crosscert {d.NTOR_CROSSCERT_SIGN} +{d.NTOR_CROSSCERT} +onion-key-crosscert +{d.RSA_CROSSCERT_ED} +""" + +FOOTER=""" + +""" + def rsa_sign(msg, rsa): buf = ctypes.create_string_buffer(2048) n = RSA_private_encrypt(len(msg), msg, buf, rsa, 1) @@ -354,7 +374,7 @@ def analyze(s): body = s[:idx].rstrip() s = s[idx:] else: - body = s + body = s.rstrip() s = "" yield (fields, body) @@ -374,6 +394,11 @@ def emit_entry(fields, s): raise ValueError("unrecognized type") def process_file(s): + print("""\ +/* These entries are automatically generated by makedesc.py to make sure + * that their keys and signatures are right except when otherwise + * specified. */ +""") for (fields, s) in analyze(s): emit_entry(fields, s) -- cgit v1.2.3-54-g00ecf