Several fixes to authenticator, added more unit tests

Some fixes include, in more detail:
- Using little over big endianess in some parts
- Flagging all the constructor numbers as unsigned
- Fixed bugs with factorizer
- Implemented TLSharp's RSA
This commit is contained in:
Lonami
2016-09-03 10:54:58 +02:00
parent 12cb66ab2c
commit 75a648f438
28 changed files with 226 additions and 53 deletions

0
parser/__init__.py Normal file → Executable file
View File

0
parser/source_builder.py Normal file → Executable file
View File

4
parser/tl_generator.py Normal file → Executable file
View File

@@ -113,7 +113,7 @@ def generate_tlobjects(scheme_file):
# Write the on_send(self, writer) function
builder.writeln('def on_send(self, writer):')
builder.writeln("writer.write_int({}) # {}'s constructor ID"
builder.writeln("writer.write_int({}, signed=False) # {}'s constructor ID"
.format(hex(tlobject.id), tlobject.name))
for arg in tlobject.args:
@@ -214,7 +214,7 @@ def write_onsend_code(builder, arg, args, name=None):
builder.writeln('if {} is not None:'.format(name))
if arg.is_vector:
builder.writeln("writer.write_int(0x1cb5c415) # Vector's constructor ID")
builder.writeln("writer.write_int(0x1cb5c415, signed=False) # Vector's constructor ID")
builder.writeln('writer.write_int(len({}))'.format(name))
builder.writeln('for {}_item in {}:'.format(arg.name, name))
# Temporary disable .is_vector, not to enter this if again

0
parser/tl_parser.py Normal file → Executable file
View File