summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-10-16 12:37:16 -0400
committerNick Mathewson <nickm@torproject.org>2020-10-16 16:07:46 -0400
commit5032b8f1783cad70675cdb07e00eb184f256a6e3 (patch)
treeec859fb18fa6cca6b6445dfcddc130d249726108 /scripts
parent0031d2b0adf077708210fe7ca84810b464f56e8e (diff)
downloadtor-5032b8f1783cad70675cdb07e00eb184f256a6e3.tar.gz
tor-5032b8f1783cad70675cdb07e00eb184f256a6e3.zip
Regenerate complete failing_routerdescs.inc and adjust tests accordingly.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/codegen/makedesc.py27
1 files changed, 26 insertions, 1 deletions
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)