msm8916-mainline / qtestsign

Simple tool to "sign" ELF Qualcomm firmware images using dummy certificates ("test keys")
GNU General Public License v2.0
41 stars 8 forks source link

sign failed? #4

Closed Boom-Hacker closed 1 year ago

Boom-Hacker commented 1 year ago

./qtestsign.py hyp ../qhypstub.elf Before: Elf(ehdr=Ehdr(ei_magic=b'\x7fELF', ei_class=2, ei_data=1, ei_version=1, ei_os_abi=0, ei_abi_version=0, e_type=2, e_machine=183, e_version=1, e_entry=2252341248, e_phoff=64, e_shoff=428688, e_flags=0, e_ehsize=64, e_phentsize=56, e_phnum=2, e_shentsize=64, e_shnum=9, e_shstrndx=8), phdrs=[Phdr(p_type=1, p_offset=65536, p_vaddr=2147483648, p_paddr=2147483648, p_filesz=355044, p_memsz=355044, p_flags=7, p_align=65536), Phdr(p_type=1, p_offset=421888, p_vaddr=2252341248, p_paddr=2252341248, p_filesz=4096, p_memsz=4096, p_flags=7, p_align=2048)]) Traceback (most recent call last): File "./qtestsign.py", line 61, in _sign_elf(elf_bytes, out, FW_SW_ID[args.type]) File "./qtestsign.py", line 35, in _sign_elf hashseg.generate(elf, sw_id) File "/home/boomhacker/qhypstub/qtestsign/hashseg.py", line 122, in generate cert_chain = sign.generate_cert_chain(sw_id) File "/home/boomhacker/qhypstub/qtestsign/sign.py", line 32, in generate_cert_chain root_key, builder = _begin_cert() File "/home/boomhacker/qhypstub/qtestsign/sign.py", line 18, in _begin_cert key = rsa.generate_private_key(public_exponent=65537, key_size=KEY_BITS) TypeError: generate_private_key() missing 1 required positional argument: 'backend'

stephan-gh commented 1 year ago

cryptography 3.1+ is required as described in the README. You can install it with pip.