From b9533ec27e341d8c62be205a0feb30b0b11a5b1d Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 22 Aug 2019 16:01:33 +0200 Subject: Bump percent-encoding to 2.1. --- Cargo.lock | 8 +------- net/Cargo.toml | 2 +- net/src/lib.rs | 19 ++++++++++--------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d47f7671..00c3d8b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1149,11 +1149,6 @@ name = "peeking_take_while" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "percent-encoding" version = "2.1.0" @@ -1673,7 +1668,7 @@ dependencies = [ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "nettle 5.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "sequoia-core 0.9.0", "sequoia-openpgp 0.9.0", @@ -2470,7 +2465,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" "checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" -"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" "checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" "checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" diff --git a/net/Cargo.toml b/net/Cargo.toml index 6389bbfa..6750810f 100644 --- a/net/Cargo.toml +++ b/net/Cargo.toml @@ -34,7 +34,7 @@ hyper-tls = "0.3" libc = "0.2.33" native-tls = "0.2.0" nettle = "5.0" -percent-encoding = "1.0.1" +percent-encoding = "2.1" tokio-core = "0.1" tokio-io = "0.1.4" url = "2.1" diff --git a/net/src/lib.rs b/net/src/lib.rs index e37e6ece..771b7d9f 100644 --- a/net/src/lib.rs +++ b/net/src/lib.rs @@ -49,7 +49,6 @@ extern crate native_tls; extern crate nettle; extern crate tokio_core; extern crate tokio_io; -#[macro_use] extern crate percent_encoding; extern crate url; extern crate zbase32; @@ -60,7 +59,8 @@ use hyper::header::{CONTENT_LENGTH, CONTENT_TYPE, HeaderValue}; use hyper::{Client, Body, StatusCode, Request}; use hyper_tls::HttpsConnector; use native_tls::{Certificate, TlsConnector}; -use percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; +use percent_encoding::{percent_encode, AsciiSet, CONTROLS}; + use std::convert::From; use std::io::Cursor; use url::Url; @@ -72,13 +72,14 @@ use sequoia_core::{Context, NetworkPolicy}; pub mod wkd; -define_encode_set! { - /// Encoding used for submitting keys. - /// - /// The SKS keyserver as of version 1.1.6 is a bit picky with - /// respect to the encoding. - pub KEYSERVER_ENCODE_SET = [DEFAULT_ENCODE_SET] | {'-', '+', '/' } -} +/// https://url.spec.whatwg.org/#fragment-percent-encode-set +const KEYSERVER_ENCODE_SET: &AsciiSet = + // Formerly DEFAULT_ENCODE_SET + &CONTROLS.add(b' ').add(b'"').add(b'#').add(b'<').add(b'>').add(b'`') + .add(b'?').add(b'{').add(b'}') + // The SKS keyserver as of version 1.1.6 is a bit picky with + // respect to the encoding. + .add(b'-').add(b'+').add(b'/'); /// For accessing keyservers using HKP. pub struct KeyServer { -- cgit v1.2.3