diff --git a/Cargo.lock b/Cargo.lock index 7101c7fb4..44bc6a5ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -392,7 +392,7 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "autoendpoint" -version = "1.57.5" +version = "1.57.6" dependencies = [ "a2", "actix-cors", @@ -443,7 +443,7 @@ dependencies = [ [[package]] name = "autopush" -version = "1.57.5" +version = "1.57.6" dependencies = [ "autopush_common", "base64 0.13.0", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "autopush_common" -version = "1.57.5" +version = "1.57.6" dependencies = [ "base64 0.13.0", "cadence", diff --git a/autoendpoint/src/extractors/notification_headers.rs b/autoendpoint/src/extractors/notification_headers.rs index daeabc813..57724f1d8 100644 --- a/autoendpoint/src/extractors/notification_headers.rs +++ b/autoendpoint/src/extractors/notification_headers.rs @@ -122,7 +122,6 @@ impl NotificationHeaders { })?; match encoding { - "aesgcm128" => self.validate_encryption_01_rules()?, "aesgcm" => self.validate_encryption_04_rules()?, "aes128gcm" => self.validate_encryption_06_rules()?, _ => { @@ -136,16 +135,6 @@ impl NotificationHeaders { Ok(()) } - /// Validates encryption headers according to - /// draft-ietf-webpush-encryption-01 - fn validate_encryption_01_rules(&self) -> ApiResult<()> { - Self::assert_base64_item_exists("Encryption", self.encryption.as_deref(), "salt")?; - Self::assert_base64_item_exists("Encryption-Key", self.encryption_key.as_deref(), "dh")?; - Self::assert_not_exists("aesgcm128 Crypto-Key", self.crypto_key.as_deref(), "dh")?; - - Ok(()) - } - /// Validates encryption headers according to /// draft-ietf-webpush-encryption-04 fn validate_encryption_04_rules(&self) -> ApiResult<()> { @@ -351,31 +340,6 @@ mod tests { assert_encryption_error(result, "Missing Content-Encoding header"); } - /// Valid 01 draft encryption passes validation - #[test] - fn valid_01_encryption() { - let req = TestRequest::post() - .header("TTL", "10") - .header("Content-Encoding", "aesgcm128") - .header("Encryption", "salt=foo") - .header("Encryption-Key", "dh=bar") - .to_http_request(); - let result = NotificationHeaders::from_request(&req, true); - - assert!(result.is_ok()); - assert_eq!( - result.unwrap(), - NotificationHeaders { - ttl: 10, - topic: None, - encoding: Some("aesgcm128".to_string()), - encryption: Some("salt=foo".to_string()), - encryption_key: Some("dh=bar".to_string()), - crypto_key: None - } - ); - } - /// Valid 04 draft encryption passes validation #[test] fn valid_04_encryption() {