-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support new backup file format #60
base: master
Are you sure you want to change the base?
Conversation
🫶 thanks for digging into this and creating a PR. I’ll try to test it as soon as possible, but since i’m at ccc-camp, this might not be until next week. If you didn’t hear anything back until end of next week, please ping me |
From me instead of @pascalgn and a bit more than a week later but here's a gentle nudge 😄 |
Plz someone merge a fix for this, pascalgn patch works, just need to run cargo update so the build doesn't fail. |
@pajowu ping... |
For me the change works for newer backup files but older fail (for different reasons):
Both files worked with the Note: I had to change
to
in |
This raises a good point, can we detect older files and use an old version. PS: I’m still following the discussion but didn’t get to test yet |
@pajowu : you might also have a look at #63 and my comment #63 (comment) |
@pajowu You might want to check out mossblaser/signal_for_android_decryption#6 on how to detect older versions. According to @frans-fuerst it works for older versions. I in turn used the info on this PR to implement it. |
I should've made it a bit clearer, but I'm not really a Rust expert, so this PR was only intended as a proof of concept. I've now added some more code, to check the backup file version and run the according decryption logic. However, I don't have any old backup files either, so I cannot really test it. I hope it works. |
data = vec![0u8; 4 + length - crate::decrypter::LENGTH_HMAC]; | ||
|
||
// read data and decrypt | ||
self.reader.read_exact(&mut data[4..])?; | ||
data[0] = encrypted_len[0]; | ||
data[1] = encrypted_len[1]; | ||
data[2] = encrypted_len[2]; | ||
data[3] = encrypted_len[3]; | ||
|
||
data = self.decrypter.decrypt(&mut data, true); | ||
data = data[4..].to_vec(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does some data copying, so could probably be implemented in a much more efficient manner!
It's been 5 months, any chance of getting this merged and released? I am still unable to decrypt my backups with the latest official release. |
Let's try to be more patient. This repo is owned by one person, who does this in their spare time. If you're desperate for the merge, then fork it and merge on your fork. Let's stop contributing to an environment that takes advantage of people who are overworked and unpaid volunteers. Not only does that make it easier for stuff like this to happen, it's just wrong, in and of itself. |
This branch is working, but to get it to build on Ubuntu 22.04 I had to modify Cargo.toml to build openssl from source, instead of relying on libssl-dev from apt:
|
Fixes #58
I updated the Backups.proto file from here: https://github.com/signalapp/Signal-Android/blob/c6473ca9e63236af3eae9959a50cfa643d53272e/app/src/main/protowire/Backups.proto
I changed it so that the length is decrypted. However, the decryption wasn't straightforward, because the length is not a separate block, so I had to adapt the existing decrypt function a bit
Decryption in Signal:
signalapp/Signal-Android@c6473ca#diff-cf445f7d302fb0629f925b7cf39cb340defe74a485bb7756159c6c9c86b31c0f