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 #285

Merged
merged 34 commits into from
Mar 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
588ca72
PushService::distribute_pni_keys
rubdos Jan 14, 2024
db4466b
Stop returning next pre key id's from update_pre_key_bundle
rubdos Jan 14, 2024
6e29804
Take IdentityKey by ref
rubdos Jan 14, 2024
b3f6f2b
Factor out generation of pre keys to separate function
rubdos Jan 14, 2024
27b07fb
WIP pnp_initialize_devices
rubdos Jan 14, 2024
5581048
Deduplicate SignedPreKeyEntity and SignedPreKey
rubdos Jan 14, 2024
4555591
WIP pnp_initialize_devices
rubdos Jan 14, 2024
dc42322
Implement last resort pre key through extension trait
rubdos Jan 30, 2024
b57d4d6
Deduplicate pre key gen code for device linking
rubdos Jan 30, 2024
6c7b1cc
Move generate_pre_keys into pre_keys.rs
rubdos Jan 30, 2024
78aa4a8
Use IdentityKey where it makes sense
rubdos Jan 30, 2024
f8ea086
Don't generate last resort key if already stored
rubdos Mar 9, 2024
5b8b840
WIP distribution message
rubdos Mar 9, 2024
30e5ef5
Remove Clone bound on some generics
rubdos Mar 9, 2024
bc9d1f6
generate_prekeys to return Records instead of Entity
rubdos Mar 9, 2024
ba774e7
PreKeyEntity TryFrom based on ref instead of move
rubdos Mar 9, 2024
68894e5
Distribution message
rubdos Mar 9, 2024
e87df73
Implement random padding
rubdos Mar 9, 2024
afb41ec
Some asserts for pre key gen
rubdos Mar 9, 2024
04edb85
More flexible trait bounds on pnp_initialize_devices
rubdos Mar 9, 2024
3077ada
Implement PNI signatures
rubdos Mar 9, 2024
48bd383
Rename generate_pre_keys to replenish_pre_keys
rubdos Mar 11, 2024
2b51a34
Add DeviceActivationRequest to linking and registration
rubdos Mar 12, 2024
e00c5a0
AccountManager::register_account
rubdos Mar 12, 2024
99c7f2b
Add example store
rubdos Mar 13, 2024
8c1b9b6
Fix registration examples
rubdos Mar 13, 2024
df600f6
Fix storage example fn main
rubdos Mar 13, 2024
55486a5
Don't require signaling key when not needed
rubdos Mar 13, 2024
ae373b4
Log pre key upload
rubdos Mar 13, 2024
f92b19d
Rename pnp -> pni field
rubdos Mar 13, 2024
5a5150c
Update DeviceCapabilities to be in sync with SA
rubdos Mar 13, 2024
95e859f
Bump protobufs
rubdos Mar 13, 2024
05b4fcc
Allow force-refreshing prekeys
rubdos Mar 13, 2024
4255520
Fix envelope decryption test
rubdos Mar 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix registration examples
rubdos committed Mar 21, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
rubdos Ruben De Smet
commit 8c1b9b6a67e2c9590029b83b4b3c7c87eefa473f
1 change: 1 addition & 0 deletions libsignal-service-actix/Cargo.toml
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ async-trait = "0.1"
phonenumber = "0.3"

[dev-dependencies]
chrono = "0.4"
image = { version = "0.23", default-features = false, features = ["png"] }
opener = "0.5"
qrcode = "0.12"
18 changes: 15 additions & 3 deletions libsignal-service-actix/examples/registering.rs
Original file line number Diff line number Diff line change
@@ -25,11 +25,14 @@ use libsignal_service::push_service::{
AccountAttributes, DeviceCapabilities, PushService, RegistrationMethod,
VerificationTransport,
};
use libsignal_service::USER_AGENT;
use libsignal_service::{AccountManager, USER_AGENT};
use libsignal_service_actix::prelude::AwcPushService;
use rand::RngCore;
use structopt::StructOpt;

#[path = "../../libsignal-service/examples/storage.rs"]
mod storage;

#[actix_rt::main]
async fn main() -> Result<(), Error> {
let client = "libsignal-service-hyper-example";
@@ -136,8 +139,15 @@ async fn main() -> Result<(), Error> {
rand::thread_rng().fill_bytes(&mut profile_key);
let profile_key = ProfileKey::create(profile_key);
let skip_device_transfer = false;
let _registration_data = push_service
.submit_registration_request(

// Create the prekeys storage
let mut aci_store = storage::ExampleStore::new();
let mut pni_store = storage::ExampleStore::new();

let mut account_manager = AccountManager::new(push_service, None);
let _registration_data = account_manager
.register_account(
&mut rand::thread_rng(),
RegistrationMethod::SessionId(&session.id),
AccountAttributes {
signaling_key: Some(signaling_key.to_vec()),
@@ -156,6 +166,8 @@ async fn main() -> Result<(), Error> {
name: Some("libsignal-service-hyper test".into()),
capabilities: DeviceCapabilities::default(),
},
&mut aci_store,
&mut pni_store,
skip_device_transfer,
)
.await;
1 change: 1 addition & 0 deletions libsignal-service-hyper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ tokio-rustls = "0.25"
rustls-pemfile = "2.0"

[dev-dependencies]
chrono = "0.4"
rand = "0.8"
tokio = { version = "1.0", features = ["rt-multi-thread"] }

18 changes: 15 additions & 3 deletions libsignal-service-hyper/examples/registering.rs
Original file line number Diff line number Diff line change
@@ -8,12 +8,15 @@ use libsignal_service::push_service::{
AccountAttributes, DeviceCapabilities, PushService, RegistrationMethod,
VerificationTransport,
};
use libsignal_service::USER_AGENT;
use libsignal_service::{AccountManager, USER_AGENT};

use libsignal_service_hyper::prelude::HyperPushService;

use rand::RngCore;

#[path = "../../libsignal-service/examples/storage.rs"]
mod storage;

#[tokio::main]
async fn main() {
let client = "libsignal-service-hyper-example";
@@ -104,8 +107,15 @@ async fn main() {
rand::thread_rng().fill_bytes(&mut profile_key);
let profile_key = ProfileKey::create(profile_key);
let skip_device_transfer = false;
let _registration_data = push_service
.submit_registration_request(

// Create the prekeys storage
let mut aci_store = storage::ExampleStore::new();
let mut pni_store = storage::ExampleStore::new();

let mut account_manager = AccountManager::new(push_service, None);
let _registration_data = account_manager
.register_account(
&mut rand::thread_rng(),
RegistrationMethod::SessionId(&session.id),
AccountAttributes {
signaling_key: Some(signaling_key.to_vec()),
@@ -124,6 +134,8 @@ async fn main() {
name: Some("libsignal-service-hyper test".into()),
capabilities: DeviceCapabilities::default(),
},
&mut aci_store,
&mut pni_store,
skip_device_transfer,
)
.await;