From fb31dd6225d3abff6ba2d2a3874c88af1efb5b33 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 27 Nov 2023 17:43:48 +0100 Subject: [PATCH] Proton has two API endpoints, unify them. - I was assured privately that they should always return the same information, but unfortunately there is no public documentation about the Proton key server. In any case, they are controlled by the same entity, thus should be considered the same for our purposes. --- src/commands/net.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/commands/net.rs b/src/commands/net.rs index 2113d88b..fdab1436 100644 --- a/src/commands/net.rs +++ b/src/commands/net.rs @@ -384,14 +384,14 @@ pub fn dispatch_keyserver(mut config: Config, c: cli::keyserver::Command) return None; } - let server = server.to_ascii_lowercase(); + let mut server = server.to_ascii_lowercase(); // Only record provenance information for certifying // keyservers. Anything else doesn't make sense. match &server[..] { "keys.openpgp.org" => (), "keys.mailvelope.com" => (), - "mail-api.proton.me" => (), + "mail-api.proton.me" | "api.protonmail.ch" => (), _ => { eprintln!("Not recording provenance information, {} is not \ known to be a verifying keyserver", @@ -400,6 +400,11 @@ pub fn dispatch_keyserver(mut config: Config, c: cli::keyserver::Command) }, } + // Unify aliases. + if &server == "api.protonmail.ch" { + server = "mail-api.proton.me".into(); + } + Some((format!("_keyserver_{}.pgp", server), format!("Downloaded from the keyserver {}", server))) } else {