diff options
| author | David Lönnhager <david.l@mullvad.net> | 2025-04-02 13:49:15 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2025-04-03 14:10:58 +0200 |
| commit | 3d03dc779f6829a236d139543e3c19fa56c4a25e (patch) | |
| tree | 63656e7a74de1ee9ec416b23a80ec42c53dc304d /mullvad-update/src/client | |
| parent | 00e26c1d17fb9044f8cbc0a168eab1edef70ba8a (diff) | |
| download | mullvadvpn-3d03dc779f6829a236d139543e3c19fa56c4a25e.tar.xz mullvadvpn-3d03dc779f6829a236d139543e3c19fa56c4a25e.zip | |
Set default pubkeys and pinned certificate in mullvad-update
Diffstat (limited to 'mullvad-update/src/client')
| -rw-r--r-- | mullvad-update/src/client/api.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mullvad-update/src/client/api.rs b/mullvad-update/src/client/api.rs index 7811dee275..05c8359449 100644 --- a/mullvad-update/src/client/api.rs +++ b/mullvad-update/src/client/api.rs @@ -35,6 +35,18 @@ impl HttpVersionInfoProvider { /// Maximum size of the GET response, in bytes const SIZE_LIMIT: usize = 1024 * 1024; + /// Construct an [HttpVersionInfoProvider] for `url` using reasonable defaults. + /// + /// By default, `pinned_certificate` will be set to the LE root certificate, and + /// `verifying_keys` will be set to the keys in `trusted-metadata-signing-keys`. + pub fn new(url: String) -> Self { + HttpVersionInfoProvider { + url, + pinned_certificate: Some(crate::keys::PINNED_CERTIFICATE.clone()), + verifying_keys: crate::keys::TRUSTED_METADATA_SIGNING_PUBKEYS.clone(), + } + } + /// Download and verify signed data pub async fn get_versions( &self, |
