GeezerVison is showing github.com — ssl: take the OID table and the OpenSSL cipher-string parser from #80… · RustPython/RustPython@de60530
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .cspell.json +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 71 | 71 | // words - list of words to be always considered correct | 72 | 72 | // (compound words like pyarg, baseclass, microbenchmark are handled by allowCompoundWords) | 73 | 73 | "words": [ | | 74 | + "AESGCM", | 74 | 75 | "aiterable", | 75 | 76 | "alnum", | | 77 | + "COMPLEMENTOFALL", | | 78 | + "COMPLEMENTOFDEFAULT", | 76 | 79 | "csock", | 77 | 80 | "coro", | 78 | 81 | "contig", | | 82 | 85 | "deduped", | 83 | 86 | "deoptimized", | 84 | 87 | "deoptimize", | | 88 | + "EECDH", | 85 | 89 | "emscripten", | 86 | 90 | "excs", | 87 | 91 | "fdigits", | | 98 | 102 | "kwonly", | 99 | 103 | "lossily", | 100 | 104 | "mcache", | | 105 | + "MLKEM", | 101 | 106 | "oparg", | 102 | 107 | "opargs", | 103 | 108 | "pointee", | | 109 | 114 | "reraises", | 110 | 115 | "reraising", | 111 | 116 | "significand", | | 117 | + "SUITEB", | 112 | 118 | "summands", | 113 | 119 | "TESTFN", | 114 | 120 | "TZPATH", | |
Collapse file Copy file name to clipboardExpand all lines: Cargo.lock +1-1Lines changed: 1 addition & 1 deletion Collapse file Copy file name to clipboardExpand all lines: crates/host_env/Cargo.toml +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -8,6 +8,9 @@ rust-version.workspace = true | 8 | 8 | repository.workspace = true | 9 | 9 | license.workspace = true | 10 | 10 |
| | 11 | +[features] | | 12 | +native-certs = ["dep:rustls-native-certs"] | | 13 | + | 11 | 14 | [dependencies] | 12 | 15 | rustpython-wtf8 = { workspace = true } | 13 | 16 |
| @@ -35,6 +38,7 @@ mac_address = { workspace = true } | 35 | 38 | dns-lookup = { workspace = true } | 36 | 39 | gethostname = { workspace = true } | 37 | 40 | rustyline = { workspace = true } | | 41 | +rustls-native-certs = { workspace = true, optional = true } | 38 | 42 | socket2 = { workspace = true, features = ["all"] } | 39 | 43 | which = { workspace = true } | 40 | 44 |
| |
Collapse file Copy file name to clipboardExpand all lines: crates/host_env/src/fs.rs +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -36,6 +36,18 @@ pub fn metadata(path: impl AsRef<Path>) -> io::Result<Metadata> { | 36 | 36 | fs::metadata(path) | 37 | 37 | } | 38 | 38 |
| | 39 | +pub fn exists(path: impl AsRef<Path>) -> bool { | | 40 | + metadata(path).is_ok() | | 41 | +} | | 42 | + | | 43 | +pub fn is_file(path: impl AsRef<Path>) -> bool { | | 44 | + metadata(path).is_ok_and(|metadata| metadata.is_file()) | | 45 | +} | | 46 | + | | 47 | +pub fn is_dir(path: impl AsRef<Path>) -> bool { | | 48 | + metadata(path).is_ok_and(|metadata| metadata.is_dir()) | | 49 | +} | | 50 | + | 39 | 51 | pub fn symlink_metadata(path: impl AsRef<Path>) -> io::Result<Metadata> { | 40 | 52 | fs::symlink_metadata(path) | 41 | 53 | } | |
Collapse file Copy file name to clipboardExpand all lines: crates/host_env/src/lib.rs +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,6 +30,8 @@ pub mod fileutils; | 30 | 30 | pub mod fs; | 31 | 31 | #[cfg(any(unix, windows))] | 32 | 32 | pub mod locale; | | 33 | +#[cfg(all(feature = "native-certs", not(target_arch = "wasm32")))] | | 34 | +pub mod native_certs; | 33 | 35 | pub mod readline; | 34 | 36 |
| 35 | 37 | #[cfg(windows)] | |
Collapse file Copy file name to clipboard +22Lines changed: 22 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +/// Certificates and errors returned by the platform's native trust-store | | 2 | +/// loader. Certificate bytes stay independent of any TLS backend type. | | 3 | +pub struct LoadResult { | | 4 | + pub certs: Vec<Vec<u8>>, | | 5 | + pub errors: Vec<String>, | | 6 | +} | | 7 | + | | 8 | +pub fn load() -> LoadResult { | | 9 | + let result = rustls_native_certs::load_native_certs(); | | 10 | + LoadResult { | | 11 | + certs: result | | 12 | + .certs | | 13 | + .into_iter() | | 14 | + .map(|cert| cert.as_ref().to_vec()) | | 15 | + .collect(), | | 16 | + errors: result | | 17 | + .errors | | 18 | + .into_iter() | | 19 | + .map(|error| error.to_string()) | | 20 | + .collect(), | | 21 | + } | | 22 | +} |
Collapse file Copy file name to clipboardExpand all lines: crates/stdlib/Cargo.toml +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -24,7 +24,7 @@ ssl-openssl-vendor = ["ssl-openssl", "openssl/vendored"] | 24 | 24 | tkinter = ["dep:tk-sys", "dep:tcl-sys", "dep:widestring"] | 25 | 25 | flame-it = ["flame"] | 26 | 26 |
| 27 | | -__ssl-rustls = ["ssl", "rustls", "rustls-native-certs", "rustls-pemfile", "rustls-platform-verifier", "x509-cert", "x509-parser", "der", "pem-rfc7468", "webpki-roots", "oid-registry", "pkcs8"] | | 27 | +__ssl-rustls = ["ssl", "rustpython-host_env/native-certs", "rustls", "rustls-pemfile", "rustls-platform-verifier", "x509-cert", "x509-parser", "der", "pem-rfc7468", "webpki-roots", "oid-registry", "pkcs8"] | 28 | 28 |
| 29 | 29 | [dependencies] | 30 | 30 | # rustpython crates | @@ -92,7 +92,6 @@ foreign-types-shared = { workspace = true, optional = true } | 92 | 92 |
| 93 | 93 | # Rustls dependencies (optional, for ssl-rustls feature) | 94 | 94 | rustls = { workspace = true, default-features = false, features = ["std", "tls12"], optional = true } | 95 | | -rustls-native-certs = { workspace = true, optional = true } | 96 | 95 | rustls-pemfile = { workspace = true, optional = true } | 97 | 96 | rustls-platform-verifier = { workspace = true, optional = true } | 98 | 97 | x509-cert = { workspace = true, features = ["pem", "builder"], optional = true } | |
|