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.
This commit is contained in:
Justus Winter 2023-11-27 17:43:48 +01:00
parent f3757c004e
commit fb31dd6225
No known key found for this signature in database
GPG Key ID: 686F55B4AB2B3386

View File

@ -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 {