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/format | |
| 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/format')
| -rw-r--r-- | mullvad-update/src/format/deserializer.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mullvad-update/src/format/deserializer.rs b/mullvad-update/src/format/deserializer.rs index 980fd52ca6..8b138578b5 100644 --- a/mullvad-update/src/format/deserializer.rs +++ b/mullvad-update/src/format/deserializer.rs @@ -10,6 +10,21 @@ use super::{PartialSignedResponse, ResponseSignature, SignedResponse}; impl SignedResponse { /// Deserialize some bytes to JSON, and verify them, including signature and expiry. /// If successful, the deserialized data is returned. + /// + /// This uses the keys in `trusted-metadata-signing-pubkeys` + pub fn deserialize_and_verify( + bytes: &[u8], + min_metadata_version: usize, + ) -> Result<Self, anyhow::Error> { + Self::deserialize_and_verify_with_keys( + &crate::keys::TRUSTED_METADATA_SIGNING_PUBKEYS, + bytes, + min_metadata_version, + ) + } + + /// Deserialize some bytes to JSON, and verify them, including signature and expiry. + /// If successful, the deserialized data is returned. pub fn deserialize_and_verify_with_keys( keys: &Vec1<VerifyingKey>, bytes: &[u8], |
