Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into upgrade-aes
Browse files Browse the repository at this point in the history
  • Loading branch information
boxdot committed Dec 15, 2023
2 parents 9a21d07 + 34ad911 commit e790b4f
Show file tree
Hide file tree
Showing 20 changed files with 272 additions and 311 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ jobs:
args: --manifest-path ${{ matrix.project }}/Cargo.toml

build:
name: Build
name: Build (${{ matrix.project }}, Rust ${{ matrix.toolchain }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.can-fail }}
strategy:
fail-fast: false
matrix:
project: ["libsignal-service-actix", "libsignal-service-hyper"]
toolchain: ["stable", "nightly"]
can-fail: [false]
toolchain: ["stable", "beta", "nightly"]
coverage: [false, true]
exclude:
- toolchain: stable
Expand All @@ -50,10 +48,7 @@ jobs:
coverage: false
include:
- project: "libsignal-service-actix"
# toolchain: "1.52.1"
toolchain: "nightly-2021-05-06"
features: "rust-1-52"
can-fail: true
toolchain: "1.70"
coverage: false
steps:
- uses: actions/checkout@v3
Expand All @@ -67,20 +62,20 @@ jobs:
if: ${{ !matrix.coverage }}
with:
command: test
args: --all-targets --no-fail-fast --manifest-path ${{ matrix.project }}/Cargo.toml --features "${{ matrix.features }}"
args: --all-targets --no-fail-fast --manifest-path ${{ matrix.project }}/Cargo.toml

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --manifest-path ${{ matrix.project }}/Cargo.toml --features "${{ matrix.features }}"
args: --all-targets --manifest-path ${{ matrix.project }}/Cargo.toml

- name: Run tests
uses: actions-rs/cargo@v1
if: ${{ matrix.coverage }}
with:
command: test
args: --all-targets --no-fail-fast --manifest-path ${{ matrix.project }}/Cargo.toml --features "${{ matrix.features }}"
args: --all-targets --no-fail-fast --manifest-path ${{ matrix.project }}/Cargo.toml
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# libsignal-service-rs

[![Build Status](https://github.com/whisperfish/libsignal-service-rs/workflows/CI/badge.svg?branch=main)][ci_workflow]
[![Build Status](https://github.com/whisperfish/libsignal-service-rs/actions/workflows/ci.yaml/badge.svg?branch=main)][ci_workflow]
[![API Docs](https://img.shields.io/badge/docs-libsignal--service-blue)][rustdocs]

A Rust version of the [libsignal-service-java][lsj] library which implements the core functionality to communicate with [Signal][signal] servers. It is based on the official Rust version of [libsignal][lsg]
Expand Down Expand Up @@ -29,16 +29,16 @@ libsignal-protocol = { git = "https://github.com/signalapp/libsignal-client", br
zkgroup = { version = "0.9.0", git = "https://github.com/signalapp/libsignal-client", branch = "main" }

[patch.crates-io]
"curve25519-dalek" = { git = "https://github.com/signalapp/curve25519-dalek", branch = "lizard2" }
"curve25519-dalek" = { git = "https://github.com/signalapp/curve25519-dalek", tag = "signal-curve25519-4.0.0" }
```

If you're using a Cargo workspace, you should add the `[patch.crates.io]` section in the root `Cargo.toml` file instead.

### Note on supported Rust versions

`libsignal-service-rs` is the at the core of [Whisperfish][whisperfish], a SailfishOS application. The SailfishOS Rust compiler is relatively old, and therefore the MSRV for `libsignal-service-actix` maps on the compiler for that operating system, including some lag. At moment of writing, this is **Rust 1.52.1** (soon to be updated to 1.61).
`libsignal-service-rs` is the at the core of [Whisperfish][whisperfish], a SailfishOS application. The SailfishOS Rust compiler updates seldomly, and therefore the MSRV maps on the compiler for that operating system. At moment of writing, this is **Rust 1.72**.

For other platforms, we don't mandate MSRV.
For other platforms, we don't mandate MSRV. In practice, however, it is **Rust 1.70**.

## Contributing

Expand Down Expand Up @@ -78,4 +78,4 @@ version 2.0 (https://www.mozilla.org/en-US/MPL/2.0/).
[whisperfish]: https://gitlab.com/whisperfish/whisperfish/
[presage]: https://github.com/whisperfish/presage/
[ci_workflow]: https://github.com/whisperfish/libsignal-service-rs/actions/workflows/ci.yaml?query=branch:main
[rustdocs]: https://whisperfish.github.io/libsignal-service-rs/libsignal_service
[rustdocs]: https://whisperfish.github.io/libsignal-service-rs/libsignal_service
17 changes: 6 additions & 11 deletions libsignal-service-actix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ name = "libsignal-service-actix"
version = "0.1.0"
authors = ["Ruben De Smet <[email protected]>"]
edition = "2018"
license = "AGPL-3.0"
rust-version = "1.70.0"

[dependencies]
# Contrary to hyper, actix does not have Send compatible futures, which means
# the Send requirement in libsignal-service needs to be lifted by enabling `unsend-futures`.
libsignal-service = { path = "../libsignal-service", features = ["unsend-futures"] }

awc = { version = "3.0.0-beta.19", features = ["rustls"] }
awc = { version = "3.2.0", features = ["rustls-0_21"] }
actix = "0.13"
actix-http = "3.0.0-beta.19"
actix-http = "3.2.0"
actix-rt = "2.4"
# mpart-async 0.6 requires Rust 2021, violating MSRV = 1.52
mpart-async = "0.5"
mpart-async = "0.6"
serde_json = "1.0"
futures = "0.3"
bytes = "1"
rustls = "0.20"
rustls = "0.21"
rustls-pemfile = "0.3"
url = "2.1"
serde = "1.0"
Expand All @@ -31,9 +32,6 @@ base64 = "0.13"

phonenumber = "0.3"

proc-macro2 = { version = "1.0.66", optional = true }
quote = { version = "1.0.33", optional = true }

[dev-dependencies]
env_logger = "0.9"
image = { version = "0.23", default-features = false, features = ["png"] }
Expand All @@ -42,6 +40,3 @@ qrcode = "0.12"
structopt = "0.3"
tokio = { version = "1", features = ["macros"] }
anyhow = "1.0"

[features]
rust-1-52 = ["proc-macro2", "quote"]
2 changes: 1 addition & 1 deletion libsignal-service-actix/src/push_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ fn get_client(cfg: &ServiceConfiguration, user_agent: String) -> Client {
ssl_config.alpn_protocols = vec![b"http/1.1".to_vec()];

let connector = Connector::new()
.rustls(Arc::new(ssl_config))
.rustls_021(Arc::new(ssl_config))
.timeout(Duration::from_secs(10)); // https://github.com/actix/actix-web/issues/1047
let client = awc::ClientBuilder::new()
.connector(connector)
Expand Down
14 changes: 5 additions & 9 deletions libsignal-service-hyper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name = "libsignal-service-hyper"
version = "0.1.0"
authors = ["Gabriel Féron <[email protected]>"]
edition = "2018"
license = "AGPL-3.0"
rust-version = "1.70.0"

[dependencies]
libsignal-service = { path = "../libsignal-service" }

async-trait = "0.1"
base64 = "0.13"
bytes = "1.0"
futures = "0.3"
log = "0.4"
Expand All @@ -19,25 +20,20 @@ thiserror = "1.0"
url = "2.1"

hyper = { version = "0.14", features = ["client", "stream"] }
hyper-rustls = "0.23"
hyper-rustls = "0.24"
hyper-timeout = "0.4"
headers = "0.3"

# for websocket support
async-tungstenite = { version = "0.17", features = ["tokio-rustls-native-certs"] }
async-tungstenite = { version = "0.23", features = ["tokio-rustls-native-certs"] }

tokio = { version = "1.0", features = ["macros"] }
tokio-rustls = "0.23"
tokio-rustls = "0.24"

rustls-pemfile = "0.3"

[dev-dependencies]
env_logger = "0.9"
image = { version = "0.23", default-features = false, features = ["png"] }
opener = "0.5"
qrcode = "0.12"
rand = "0.8"
structopt = "0.3"
tokio = { version = "1.0", features = ["rt-multi-thread"] }

[features]
Expand Down
4 changes: 2 additions & 2 deletions libsignal-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libsignal-service"
version = "0.1.0"
authors = ["Ruben De Smet <[email protected]>", "Gabriel Féron <[email protected]>", "Michael Bryan <[email protected]>", "Shady Khalifa <[email protected]>"]
edition = "2018"
license = "GPLv3"
license = "AGPL-3.0"
readme = "../README.md"

[dependencies]
Expand Down Expand Up @@ -42,7 +42,7 @@ prost-build = "0.10"
anyhow = "1.0"
tokio = { version = "1.0", features = ["macros", "rt"] }

rustls = "0.20"
rustls = "0.21"

[features]
unsend-futures = []
2 changes: 1 addition & 1 deletion libsignal-service/protobuf/Groups.proto
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ message GroupChange {
bool announcementsOnly = 1;
}

bytes sourceUuid = 1;
bytes sourceServiceId = 1;
uint32 revision = 2;
repeated AddMemberAction addMembers = 3;
repeated DeleteMemberAction deleteMembers = 4;
Expand Down
Loading

0 comments on commit e790b4f

Please sign in to comment.