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

Implement PNI #245

Merged
merged 12 commits into from
May 30, 2024
Merged

Implement PNI #245

merged 12 commits into from
May 30, 2024

Conversation

gferon
Copy link
Collaborator

@gferon gferon commented Mar 23, 2024

@gferon gferon added this to the 0.7.0 milestone Apr 6, 2024
@gferon gferon marked this pull request as ready for review April 12, 2024 13:37
Copy link

@flamingradian flamingradian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I'm just leaving comments here after testing registration. I'm not a maintainer but would like to see presage registration working again.

Server setup:

WORK_DIR $ git clone https://github.com/signalapp/Signal-Server
WORK_DIR $ cd Signal-Server
WORK_DIR/Signal-Server $ git checkout v12.51.0
WORK_DIR/Signal-Server $ ./mvnw integration-test -Ptest-server -Dskip-tests=true

Client test:

WORK_DIR $ git clone https://github.com/whisperfish/libsignal-service-rs
WORK_DIR $ cd libsignal-service-rs
WORK_DIR/libsignal-service-rs $ git apply PATCH
WORK_DIR/libsignal-service-rs $ cd ..
WORK_DIR $ git clone https://github.com/whisperfish/presage -b aci-pni
WORK_DIR $ cd presage/presage-cli
WORK_DIR/presage/presage-cli $ cargo run -- register -s staging --phone-number +xxxxxxxxxxx --captcha signalcaptcha://test.test.registration.test

Patch to libsignal-service-rs that uses the local server:

diff --git a/libsignal-service/src/configuration.rs b/libsignal-service/src/configuration.rs
index fff3cc6eb..1cdc5794c 100644
--- a/libsignal-service/src/configuration.rs
+++ b/libsignal-service/src/configuration.rs
@@ -119,16 +119,16 @@ impl From<&SignalServers> for ServiceConfiguration {
             // configuration with the Signal API staging endpoints
             // see: https://github.com/signalapp/Signal-Desktop/blob/master/config/default.json
             SignalServers::Staging => ServiceConfiguration {
-                service_url: "https://chat.staging.signal.org".parse().unwrap(),
-                storage_url:"https://storage-staging.signal.org".parse().unwrap(),
+                service_url: "http://localhost:8080".parse().unwrap(),
+                storage_url:"https://0.0.0.0".parse().unwrap(),
                 cdn_urls: {
                     let mut map = HashMap::new();
-                    map.insert(0, "https://cdn-staging.signal.org".parse().unwrap());
-                    map.insert(2, "https://cdn2-staging.signal.org".parse().unwrap());
+                    map.insert(0, "https://0.0.0.0".parse().unwrap());
+                    map.insert(2, "https://0.0.0.0".parse().unwrap());
                     map
                 },
                 contact_discovery_url:
-                    "https://api-staging.directory.signal.org".parse().unwrap(),
+                    "https://0.0.0.0".parse().unwrap(),
                 certificate_authority: include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/certs/staging-root-ca.pem")).to_string(),
                 unidentified_sender_trust_root:
                     PublicKey::deserialize(&BASE64_RELAXED.decode("BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx").unwrap()).unwrap(),

presage-store-sled/src/protocol.rs Outdated Show resolved Hide resolved
presage-store-sled/src/protocol.rs Outdated Show resolved Hide resolved
presage/src/manager/confirmation.rs Show resolved Hide resolved
@boxdot
Copy link
Collaborator

boxdot commented May 28, 2024

@flamingradian Thank you for testing. Since @gferon is not available right now, I will try to finish this PR.

boxdot added 2 commits May 28, 2024 23:01
The keys are stored in the state tree of the `SledStore` under static
keys next to registered data. This allows to get/set them independently
of registered data.
@boxdot
Copy link
Collaborator

boxdot commented May 28, 2024

Looks like I can't push to this PR. I have a fix for register/linking devices.

@gferon
Copy link
Collaborator Author

gferon commented May 28, 2024

Looks like I can't push to this PR. I have a fix for register/linking devices.

Thanks! I'll invite you as a collaborator to the repo and then it should work.

@boxdot
Copy link
Collaborator

boxdot commented May 30, 2024

Manually tested with gurk. So far did not see any problems. Migration did not work, however I am not sure my v4 store state was correct.

@boxdot boxdot merged commit 0c46be2 into main May 30, 2024
4 checks passed
@boxdot boxdot deleted the aci-pni branch May 30, 2024 19:50
@Schmiddiii
Copy link
Contributor

Manually tested with gurk. So far did not see any problems. Migration did not work, however I am not sure my v4 store state was correct.

Testing with Flare works for me. Migration worked as well.

@boxdot
Copy link
Collaborator

boxdot commented May 31, 2024

Manually tested with gurk. So far did not see any problems. Migration did not work, however I am not sure my v4 store state was correct.

Testing with Flare works for me. Migration worked as well.

Now, next step is to extend presage's contacts store with a flag whether to send a pni signuture or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants