Skip to content

Commit

Permalink
Pin installer-downloader to LE root for version metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Feb 27, 2025
1 parent 647ff1d commit 258803f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions installer-downloader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ anyhow = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread", "fs"] }
async-trait = "0.1"
rand = { version = "0.8.5" }
reqwest = { version = "0.12.9", default-features = false, features = ["rustls-tls"] }
serde = { workspace = true, features = ["derive"] }


Expand Down
5 changes: 4 additions & 1 deletion installer-downloader/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use rand::seq::SliceRandom;

use tokio::sync::{mpsc, oneshot};

const PINNED_CERTIFICATE: &[u8] = include_bytes!("../../mullvad-api/le_root_cert.pem");

/// Actions handled by an async worker task in [handle_action_messages].
enum TaskMessage {
SetVersionInfo(VersionInfo),
Expand All @@ -39,9 +41,10 @@ pub fn initialize_controller<T: AppDelegate + 'static>(delegate: &mut T) {
const STAGEMOLE_PUBKEY: &str = include_str!("../../mullvad-update/stagemole-pubkey");
let verifying_key =
mullvad_update::format::key::VerifyingKey::from_hex(STAGEMOLE_PUBKEY).expect("valid key");
let cert = reqwest::Certificate::from_pem(PINNED_CERTIFICATE).expect("invalid cert");
let version_provider = HttpVersionInfoProvider {
url: get_metadata_url(),
pinned_certificate: None,
pinned_certificate: Some(cert),
verifying_key,
};

Expand Down

0 comments on commit 258803f

Please sign in to comment.