diff --git a/Cargo.lock b/Cargo.lock index a8b5e17..b5ccddf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2764,6 +2764,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared 0.1.1", +] + [[package]] name = "foreign-types" version = "0.5.0" @@ -2771,7 +2780,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared", + "foreign-types-shared 0.3.1", ] [[package]] @@ -2785,6 +2794,12 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -5391,6 +5406,7 @@ dependencies = [ "lazy_static", "lber", "log", + "native-tls", "nom 7.1.3", "percent-encoding", "ring 0.16.20", @@ -5398,6 +5414,7 @@ dependencies = [ "rustls-native-certs 0.6.3", "thiserror 1.0.69", "tokio", + "tokio-native-tls", "tokio-rustls 0.24.1", "tokio-stream", "tokio-util", @@ -5931,6 +5948,23 @@ dependencies = [ "uuid", ] +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe 0.2.1", + "openssl-sys", + "schannel", + "security-framework 3.7.0", + "security-framework-sys", + "tempfile", +] + [[package]] name = "ndk-context" version = "0.1.1" @@ -6262,6 +6296,32 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" +[[package]] +name = "openssl" +version = "0.10.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "951c002c75e16ea2c65b8c7e4d3d51d5530d8dfa7d060b4776828c88cfb18ecf" +dependencies = [ + "bitflags 2.11.0", + "cfg-if", + "foreign-types 0.3.2", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "openssl-probe" version = "0.1.6" @@ -6274,6 +6334,18 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" +[[package]] +name = "openssl-sys" +version = "0.9.112" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d55af3b3e226502be1526dfdba67ab0e9c96fc293004e79576b2b9edb0dbdb" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "outref" version = "0.5.2" @@ -8824,6 +8896,16 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-postgres" version = "0.7.17" @@ -9426,7 +9508,7 @@ name = "vectorscan-rs" version = "0.0.6" dependencies = [ "bitflags 2.11.0", - "foreign-types", + "foreign-types 0.5.0", "libc", "thiserror 1.0.69", "vectorscan-rs-sys", diff --git a/crates/kingfisher-scanner/Cargo.toml b/crates/kingfisher-scanner/Cargo.toml index 69d0d8c..743b0d1 100644 --- a/crates/kingfisher-scanner/Cargo.toml +++ b/crates/kingfisher-scanner/Cargo.toml @@ -195,8 +195,6 @@ tokio-postgres-rustls = { version = "0.13.0", optional = true } rustls = { version = "0.23.35", optional = true } rustls-native-certs = { version = "0.8.2", optional = true } tokio-rustls = { version = "0.26.4", optional = true } -ldap3 = { version = "0.11.5", default-features = false, features = ["tls-rustls"], optional = true } - # AWS validation aws-config = { version = "1.8.14", default-features = false, features = ["default-https-client", "rt-tokio"], optional = true } aws-credential-types = { version = "1.2.12", optional = true } @@ -210,6 +208,14 @@ base32 = { version = "0.5", optional = true } byteorder = { version = "1.5", optional = true } rand = { version = "0.10", optional = true } +[target.'cfg(all(windows, target_arch = "aarch64"))'.dependencies] +# ldap3's rustls backend still pulls ring 0.16, which fails to build on Windows ARM64. +# Use the platform TLS backend there to keep the raw LDAP validator available. +ldap3 = { version = "0.11.5", default-features = false, features = ["tls-native"], optional = true } + +[target.'cfg(not(all(windows, target_arch = "aarch64")))'.dependencies] +ldap3 = { version = "0.11.5", default-features = false, features = ["tls-rustls"], optional = true } + [dev-dependencies] pretty_assertions = "1.4" tempfile = "3.23" diff --git a/src/parser.rs b/src/parser.rs index 9a34338..ee4b20f 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -233,6 +233,33 @@ mod tests { ); } + #[test] + fn html_embedded_context_extracts_uppercase_script_and_style_candidates() { + let source = br#" + +
+ + + + + "#; + let mut texts = Vec::new(); + stream_context_candidates(source, &Language::Html, |text| { + texts.push(text.to_string()); + true + }) + .unwrap(); + + assert!( + texts.iter().any(|text| text.contains("