Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Download signatures independently of modules #8

Closed
0cwa opened this issue Aug 19, 2024 · 6 comments
Closed

[FEAT] Download signatures independently of modules #8

0cwa opened this issue Aug 19, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@0cwa
Copy link

0cwa commented Aug 19, 2024

I pulled the latest version. There is no custota.zip.sig, only custota-tool.zip.sig x64 Fedora

➜  .tmp git:(main) ✗ ls modules                     
alterinstaller.zip  custota.zip  oemunlockonboot.zip
bcr.zip             msd.zip
➜  .tmp git:(main) ✗ ls signatures
afsr.zip.sig            custota-tool.zip.sig
alterinstaller.zip.sig  msd.zip.sig
avbroot.zip.sig         oemunlockonboot.zip.sig
bcr.zip.sig
[*] Verifying SSH signature: .tmp/modules/custota.zip
Couldn't read signature file: No such file or directory
Could not verify signature.
Traceback (most recent call last):
  File "/home/user/PixeneOS/.tmp/tools/my-avbroot-setup/patch.py", line 1009, in <module>
    main()
  File "/home/user/PixeneOS/.tmp/tools/my-avbroot-setup/patch.py", line 1000, in main
    run(args, Path(temp_dir))
  File "/home/user/PixeneOS/.tmp/tools/my-avbroot-setup/patch.py", line 919, in run
    inject_custota(
  File "/home/user/PixeneOS/.tmp/tools/my-avbroot-setup/patch.py", line 420, in inject_custota
    verify_ssh_sig(module_zip, module_sig, SSH_PUBLIC_KEY_CHENXIAOLONG)
  File "/home/user/PixeneOS/.tmp/tools/my-avbroot-setup/patch.py", line 402, in verify_ssh_sig
    subprocess.check_call([
  File "/usr/lib64/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ssh-keygen', '-Y', 'verify', '-f', '/tmp/tmpl6g6fou_', '-I', 'trusted', '-n', 'file', '-s', PosixPath('.tmp/signatures/custota.zip.sig')]' returned non-zero exit status 255.
Cleanup is disabled. Exiting...
@0cwa 0cwa changed the title No custata signature No custota signature Aug 19, 2024
@pixincreate
Copy link
Owner

image

I just tested this. It is indeed getting downloaded.

@0cwa
Copy link
Author

0cwa commented Aug 20, 2024

Ok, I retested and it's there, it must've 404'd when it tried to download and then didn't download again because I had custota.zip already downloaded?

@0cwa 0cwa closed this as completed Aug 20, 2024
@pixincreate pixincreate self-assigned this Aug 20, 2024
@pixincreate pixincreate added question Further information is requested invalid This doesn't seem right and removed question Further information is requested labels Aug 20, 2024
@pixincreate
Copy link
Owner

You should be having the logs of it downloading, right? Can you please confirm with that once?

If it exist already, even that should printed stating 'custota.zip' file already exists in '.tmp/modules'.

@0cwa
Copy link
Author

0cwa commented Aug 20, 2024

I deleted the .tmp, retried and it works. I'm not at my workstation, but I'm guessing this is probably just a minor bug where if the module custota.zip is already downloaded, it doesn't download the signature for it, even if the signature is missing.

@pixincreate
Copy link
Owner

Yes, this was an intentional decision from my end as it unnecessarily increases complexity in the fetcher file.

I'll have a look at this again today once patcher is completed.

@pixincreate pixincreate added enhancement New feature or request and removed invalid This doesn't seem right labels Aug 21, 2024
@pixincreate pixincreate reopened this Aug 21, 2024
@pixincreate pixincreate changed the title No custota signature [FEAT] Download signatures independently of modules Aug 21, 2024
@pixincreate
Copy link
Owner

I did some refactoring around retries to address #9.

Now that, during download, we verify the files. If any file goes missing and you've ADDITIONALS[RETRY] flag set to true it will try to download again (max 3 retries, fails afterward).

pixincreate added a commit that referenced this issue Aug 29, 2024
should address #8 and #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants