Regenerate complete failing_routerdescs.inc and adjust tests accordingly.

This commit is contained in:
Nick Mathewson
2020-10-16 12:37:16 -04:00
parent 0031d2b0ad
commit 5032b8f178
4 changed files with 1729 additions and 1011 deletions
+26 -1
View File
@@ -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)