Skip to content

Commit 2924e01

Browse files
committed
add weak-crypto feature
This commit disables by default a few of the weaker cryptographical algorithms that are not directly exposed through the rust-openssl crate. The compilation of these can be re-enabled by selecting the "weak-crypto" feature. This should slighly reduce compilation time and compiled size. Signed-off-by: Petre Eftime <[email protected]>
1 parent 9713ad8 commit 2924e01

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ exclude = [
1616
'openssl/test/*',
1717
]
1818

19+
[features]
20+
default = []
21+
weak-crypto = []
22+
1923
[workspace]
2024
members = ['testcrate']
2125

src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ impl Build {
104104
.arg("no-zlib")
105105
.arg("no-zlib-dynamic");
106106

107+
#[cfg(not(feature = "weak-crypto"))]
108+
{
109+
configure
110+
.arg("no-md2")
111+
.arg("no-rc5")
112+
.arg("no-seed")
113+
.arg("no-idea")
114+
.arg("no-camellia")
115+
.arg("no-weak-ssl-ciphers");
116+
}
117+
107118
if target.contains("musl") || target.contains("windows") {
108119
// This actually fails to compile on musl (it needs linux/version.h
109120
// right now) but we don't actually need this most of the time.

0 commit comments

Comments
 (0)