diff --git a/Cargo.lock b/Cargo.lock index 71abfd7a90576c5861e26fd9225b3504a874a2fd..2ed29b4b5754b82e9de141c47a4d8e13f7e744f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -553,7 +553,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cookie" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3575,7 +3575,7 @@ name = "webdriver" version = "0.40.1" dependencies = [ "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3910,7 +3910,7 @@ dependencies = [ "checksum cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "56d741ea7a69e577f6d06b36b7dff4738f680593dc27a701ffa8506b73ce28bb" "checksum comedy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d4f03fbb05a4df3523a44cda10340e6ae6bea03ee9d01240a1a2c1ef6c73e95" "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" -"checksum cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1465f8134efa296b4c19db34d909637cb2bf0f7aaf21299e23e18fa29ac557cf" +"checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" "checksum core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" "checksum core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "62ceafe1622ffc9a332199096841d0ff9912ec8cf8f9cde01e254a7d5217cd10" diff --git a/testing/webdriver/Cargo.toml b/testing/webdriver/Cargo.toml index 8702020b23e22e6dd9d393c88f1e2b3e9ff16a37..eccb25d3c3412b9c4241fc7b4d68e5992ea86b6c 100644 --- a/testing/webdriver/Cargo.toml +++ b/testing/webdriver/Cargo.toml @@ -11,7 +11,7 @@ license = "MPL-2.0" [dependencies] base64 = "0.10" -cookie = { version = "0.11", default-features = false } +cookie = { version = "0.12", default-features = false } http = "0.1" log = "0.4" regex = "1.0" diff --git a/third_party/rust/cookie/.cargo-checksum.json b/third_party/rust/cookie/.cargo-checksum.json index 2a6efbe7ca402bad7e2e66511890a94fab07a5f8..a286fb89d6aa54974755ba0ef743b0991bd00085 100644 --- a/third_party/rust/cookie/.cargo-checksum.json +++ b/third_party/rust/cookie/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"6a8f9c03d5260359e497a70910ab444f32b51551e9c0aaffabcfbbb2dd7c906d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"9205f5b7d179b5ca140ec7322c5894540aef149a38bd55874bef9de5a48e0938","src/builder.rs":"4200963d44d1a59f1268965b77407ba977eb5a777875cb76ea927ddc829be3d8","src/delta.rs":"510fc3dbf0a70d635d0488c5a5a32a2ba8e1490ce05bee39d944ea8c02189bbc","src/draft.rs":"950b43b3f6e1c4c13b1e90220c71defe02713170807b41e5ffde9a1327688f48","src/jar.rs":"0e8a6e2f0426834101bd9608baf9f695839053523e9e9ac58aea03a73506b8fb","src/lib.rs":"963ff56045a4ee22e280ee24a42efc9b1d6a96de30d3856b39287ec2b51b00db","src/parse.rs":"549844993601f20f5de3f5d5f8bea0fce3fe4f09d72e343aff9e433948a4ec5c","src/secure/key.rs":"734f35ef4b0d6b63174befdcb970f0304ac63f0895871b7c2f267fefdd43b648","src/secure/macros.rs":"83d770e5c4eb7fbd3c3d86973b69042e9e2bb9fafb72a4456598e2ae78638d5f","src/secure/mod.rs":"5d7fecb62295827d474ed1ce6b7628fe93d4a09eb14babfde036d64e8e4a04f8","src/secure/private.rs":"bea61d91772285e0db7c234bda32d9e95ce386dba5cab640859531d72f13628c","src/secure/signed.rs":"26c46c2d561ea14d1d8d79f85342a98b4bd749df776677dde91dd9b928e91fbe"},"package":"1465f8134efa296b4c19db34d909637cb2bf0f7aaf21299e23e18fa29ac557cf"} \ No newline at end of file +{"files":{"Cargo.toml":"2c65ccbf56c2640abee1927d35423ade48e20588630ac31e094d434595ee80d8","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"3fcac69759e004d729a868ed5ef248c84d86fb0f3ab5c7a93abb547b91a0eb4e","src/builder.rs":"4200963d44d1a59f1268965b77407ba977eb5a777875cb76ea927ddc829be3d8","src/delta.rs":"510fc3dbf0a70d635d0488c5a5a32a2ba8e1490ce05bee39d944ea8c02189bbc","src/draft.rs":"950b43b3f6e1c4c13b1e90220c71defe02713170807b41e5ffde9a1327688f48","src/jar.rs":"8cc6531203e2a9422bfe1b2a00aeb96beb57d4676fa147a66f28f2d7c3129b57","src/lib.rs":"6a267d63ad90998f4a463c726be6a93fc33979eb8a72bfb53cae9f5b7a13fae0","src/parse.rs":"549844993601f20f5de3f5d5f8bea0fce3fe4f09d72e343aff9e433948a4ec5c","src/secure/key.rs":"734f35ef4b0d6b63174befdcb970f0304ac63f0895871b7c2f267fefdd43b648","src/secure/macros.rs":"83d770e5c4eb7fbd3c3d86973b69042e9e2bb9fafb72a4456598e2ae78638d5f","src/secure/mod.rs":"5d7fecb62295827d474ed1ce6b7628fe93d4a09eb14babfde036d64e8e4a04f8","src/secure/private.rs":"81d782cd4fa4b1415795710ad9e2e77eca3f4326e20ef96675093db9a378da32","src/secure/signed.rs":"26c46c2d561ea14d1d8d79f85342a98b4bd749df776677dde91dd9b928e91fbe"},"package":"888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5"} \ No newline at end of file diff --git a/third_party/rust/cookie/Cargo.toml b/third_party/rust/cookie/Cargo.toml index 8b2f89d1790dc3ad9080af0a8bdddd23e0e6b633..6057503b518f73fd188808c44f4289ab2b776508 100644 --- a/third_party/rust/cookie/Cargo.toml +++ b/third_party/rust/cookie/Cargo.toml @@ -3,7 +3,7 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g. crates.io) dependencies +# to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're @@ -12,7 +12,7 @@ [package] name = "cookie" -version = "0.11.0" +version = "0.12.0" authors = ["Alex Crichton <alex@alexcrichton.com>", "Sergio Benitez <sb@sergio.bz>"] description = "Crate for parsing HTTP cookie headers and managing a cookie jar. Supports signed\nand private (encrypted + signed) jars.\n" documentation = "https://docs.rs/cookie" @@ -21,11 +21,11 @@ repository = "https://github.com/alexcrichton/cookie-rs" [package.metadata.docs.rs] all-features = true [dependencies.base64] -version = "0.9.0" +version = "0.10.0" optional = true [dependencies.ring] -version = "0.13.0" +version = "0.14.0" optional = true [dependencies.time] diff --git a/third_party/rust/cookie/README.md b/third_party/rust/cookie/README.md index 3ff2827f6f5803e40db5de58967ce0b7c56ef3db..73dda0a7a832b8b62b40c42ba2c91c5da1de01ec 100644 --- a/third_party/rust/cookie/README.md +++ b/third_party/rust/cookie/README.md @@ -1,6 +1,6 @@ # cookie-rs -[](https://travis-ci.org/alexcrichton/cookie-rs) +[](https://travis-ci.com/SergioBenitez/cookie-rs) [](https://crates.io/crates/cookie) A library for parsing HTTP cookies and managing cookie jars. @@ -11,7 +11,7 @@ Add the following to your `Cargo.toml`: ```toml [dependencies] -cookie = "0.10" +cookie = "0.12" ``` See the [documentation](http://docs.rs/cookie) for detailed usage information. diff --git a/third_party/rust/cookie/src/jar.rs b/third_party/rust/cookie/src/jar.rs index b6231fd6892da4304f2d50fb4a6f8b8e3e98d847..0f1c6dd0331bfccf25c59167c5d176b73ba9c8df 100644 --- a/third_party/rust/cookie/src/jar.rs +++ b/third_party/rust/cookie/src/jar.rs @@ -344,7 +344,10 @@ impl CookieJar { /// } /// ``` pub fn iter(&self) -> Iter { - Iter { delta_cookies: self.delta_cookies.union(&self.original_cookies) } + Iter { + delta_cookies: self.delta_cookies.iter() + .chain(self.original_cookies.difference(&self.delta_cookies)), + } } /// Returns a `PrivateJar` with `self` as its parent jar using the key `key` @@ -439,12 +442,13 @@ impl<'a> Iterator for Delta<'a> { } } -use std::collections::hash_set::Union; +use std::collections::hash_set::Difference; use std::collections::hash_map::RandomState; +use std::iter::Chain; /// Iterator over all of the cookies in a jar. pub struct Iter<'a> { - delta_cookies: Union<'a, DeltaCookie, RandomState>, + delta_cookies: Chain<HashSetIter<'a, DeltaCookie>, Difference<'a, DeltaCookie, RandomState>>, } impl<'a> Iterator for Iter<'a> { diff --git a/third_party/rust/cookie/src/lib.rs b/third_party/rust/cookie/src/lib.rs index 6f3525071ecb95346cf3230d1137e8419f1cdea9..c4aab99ddf9d1bda23b02ef523afc90b793eacb6 100644 --- a/third_party/rust/cookie/src/lib.rs +++ b/third_party/rust/cookie/src/lib.rs @@ -10,7 +10,7 @@ //! Add the following to the `[dependencies]` section of your `Cargo.toml`: //! //! ```ignore -//! cookie = "0.11" +//! cookie = "0.12" //! ``` //! //! Then add the following line to your crate root: @@ -58,7 +58,7 @@ //! features = ["secure", "percent-encode"] //! ``` -#![doc(html_root_url = "https://docs.rs/cookie/0.11")] +#![doc(html_root_url = "https://docs.rs/cookie/0.12")] #![deny(missing_docs)] #[cfg(feature = "percent-encode")] extern crate url; diff --git a/third_party/rust/cookie/src/secure/private.rs b/third_party/rust/cookie/src/secure/private.rs index 56dcdbc226b9e6d6c1209ad99ea8fbcb8bbc7e32..0817a6c870c4d36973ad098d109e24d199bd373e 100644 --- a/third_party/rust/cookie/src/secure/private.rs +++ b/third_party/rust/cookie/src/secure/private.rs @@ -1,4 +1,4 @@ -use secure::ring::aead::{seal_in_place, open_in_place, Algorithm, AES_256_GCM}; +use secure::ring::aead::{seal_in_place, open_in_place, Aad, Algorithm, Nonce, AES_256_GCM}; use secure::ring::aead::{OpeningKey, SealingKey}; use secure::ring::rand::{SecureRandom, SystemRandom}; use secure::{base64, Key}; @@ -46,9 +46,11 @@ impl<'a> PrivateJar<'a> { return Err("length of decoded data is <= NONCE_LEN"); } - let ad = name.as_bytes(); + let ad = Aad::from(name.as_bytes()); let key = OpeningKey::new(ALGO, &self.key).expect("opening key"); let (nonce, sealed) = data.split_at_mut(NONCE_LEN); + let nonce = Nonce::try_assume_unique_for_key(nonce) + .expect("invalid length of `nonce`"); let unsealed = open_in_place(&key, nonce, ad, 0, sealed) .map_err(|_| "invalid key/nonce/value: bad seal")?; @@ -156,9 +158,11 @@ impl<'a> PrivateJar<'a> { let (nonce, in_out) = data.split_at_mut(NONCE_LEN); SystemRandom::new().fill(nonce).expect("couldn't random fill nonce"); in_out[..cookie_val.len()].copy_from_slice(cookie_val); + let nonce = Nonce::try_assume_unique_for_key(nonce) + .expect("invalid length of `nonce`"); // Use cookie's name as associated data to prevent value swapping. - let ad = cookie.name().as_bytes(); + let ad = Aad::from(cookie.name().as_bytes()); // Perform the actual sealing operation and get the output length. seal_in_place(&key, nonce, ad, in_out, overhead).expect("in-place seal")