From 8c1d3fe5242e4c5791de59f0ef8575c5f2518823 Mon Sep 17 00:00:00 2001 From: parazyd Date: Wed, 1 Feb 2023 13:03:06 +0100 Subject: [PATCH] Remove openssl dependency throughout the project. --- Cargo.lock | 130 ++++-------------------------- Cargo.toml | 4 +- README.md | 4 +- bin/darkfid/Cargo.toml | 2 +- bin/darkwiki/darkwikid/Cargo.toml | 2 +- bin/drk/Cargo.toml | 2 +- bin/faucetd/Cargo.toml | 2 +- contrib/dependency_setup.sh | 14 ++-- src/contract/dao/Cargo.toml | 2 +- src/contract/money/Cargo.toml | 2 +- 10 files changed, 33 insertions(+), 131 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 85c2687ff..3a3eb6124 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -175,18 +175,6 @@ dependencies = [ "futures-lite", ] -[[package]] -name = "async-native-tls" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d57d4cec3c647232e1094dc013546c0b33ce785d8aeb251e1f20dfaf8a9a13fe" -dependencies = [ - "futures-util", - "native-tls", - "thiserror", - "url", -] - [[package]] name = "async-net" version = "1.7.0" @@ -491,9 +479,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "camino" @@ -2651,24 +2639,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nix" version = "0.26.2" @@ -2793,51 +2763,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl" -version = "0.10.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "os_str_bytes" version = "6.4.1" @@ -3568,15 +3493,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "schannel" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" -dependencies = [ - "windows-sys 0.42.0", -] - [[package]] name = "scopeguard" version = "1.1.0" @@ -3605,29 +3521,6 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" -[[package]] -name = "security-framework" -version = "2.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "0.11.0" @@ -3935,6 +3828,8 @@ dependencies = [ "once_cell", "paste", "percent-encoding", + "rustls", + "rustls-pemfile", "sha2", "smallvec", "sqlformat", @@ -3942,6 +3837,7 @@ dependencies = [ "stringprep", "thiserror", "url", + "webpki-roots", ] [[package]] @@ -3969,9 +3865,8 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396" dependencies = [ - "async-native-tls", "async-std", - "native-tls", + "futures-rustls", ] [[package]] @@ -4524,9 +4419,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" @@ -4956,6 +4851,15 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + [[package]] name = "weezl" version = "0.1.7" diff --git a/Cargo.toml b/Cargo.toml index b6ada0aa8..7430390cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -120,8 +120,8 @@ wasmer-compiler-singlepass = {version = "3.1.1", optional = true} wasmer-middlewares = {version = "3.1.1", optional = true} # Wallet management -libsqlite3-sys = {version = "0.24.2", features = ["bundled-sqlcipher"], optional = true } -sqlx = {version = "0.6.2", features = ["runtime-async-std-native-tls", "sqlite"], optional = true} +libsqlite3-sys = {version = "0.24.1", features = ["bundled-sqlcipher"], optional = true } +sqlx = {version = "0.6.2", features = ["runtime-async-std-rustls", "sqlite"], optional = true} # Blockchain store sled = {version = "0.34.7", optional = true} diff --git a/README.md b/README.md index 8622b81fd..cf707b0de 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,6 @@ The following dependencies are also required: | jq | jq | | gcc | gcc | | pkg-config | pkg-config | -| openssl libs | libssl-dev | Users of Debian-based systems (e.g. Ubuntu) can simply run the following to install the required dependencies: @@ -66,8 +65,7 @@ package manager, please consider adding support for it into the script and sending a patch. To build the necessary binaries, we can just clone the repo, and use -the provided Makefile to build the project. This will download the -trusted setup params, and compile the source code. +the provided Makefile to build the project: ```shell % git clone https://github.com/darkrenaissance/darkfi diff --git a/bin/darkfid/Cargo.toml b/bin/darkfid/Cargo.toml index 70a389063..27ad8bb1f 100644 --- a/bin/darkfid/Cargo.toml +++ b/bin/darkfid/Cargo.toml @@ -23,7 +23,7 @@ serde_json = "1.0.91" simplelog = "0.12.0" sled = "0.34.7" smol = "1.3.0" -sqlx = {version = "0.6.2", features = ["runtime-async-std-native-tls", "sqlite"]} +sqlx = {version = "0.6.2", features = ["runtime-async-std-rustls", "sqlite"]} url = "2.3.1" # Argument parsing diff --git a/bin/darkwiki/darkwikid/Cargo.toml b/bin/darkwiki/darkwikid/Cargo.toml index f82993e14..05372352d 100644 --- a/bin/darkwiki/darkwikid/Cargo.toml +++ b/bin/darkwiki/darkwikid/Cargo.toml @@ -30,5 +30,5 @@ structopt = "0.3.26" structopt-toml = "0.5.1" smol = "1.3.0" toml = "0.7.1" -unicode-segmentation = "1.10.0" +unicode-segmentation = "1.10.1" url = "2.3.1" diff --git a/bin/drk/Cargo.toml b/bin/drk/Cargo.toml index 20762bc5a..8b9242379 100644 --- a/bin/drk/Cargo.toml +++ b/bin/drk/Cargo.toml @@ -29,6 +29,6 @@ smol = "1.3.0" simplelog = "0.12.0" signal-hook-async-std = "0.2.2" signal-hook = "0.3.14" -sqlx = {version = "0.6.2", features = ["runtime-async-std-native-tls", "sqlite"]} +sqlx = {version = "0.6.2", features = ["runtime-async-std-rustls", "sqlite"]} url = "2.3.1" play = {version = "0.5.3", optional = true} diff --git a/bin/faucetd/Cargo.toml b/bin/faucetd/Cargo.toml index a47ef2879..23322ce36 100644 --- a/bin/faucetd/Cargo.toml +++ b/bin/faucetd/Cargo.toml @@ -25,7 +25,7 @@ serde_json = "1.0.91" simplelog = "0.12.0" sled = "0.34.7" smol = "1.3.0" -sqlx = {version = "0.6.2", features = ["runtime-async-std-native-tls", "sqlite"]} +sqlx = {version = "0.6.2", features = ["runtime-async-std-rustls", "sqlite"]} url = "2.3.1" # Argument parsing diff --git a/contrib/dependency_setup.sh b/contrib/dependency_setup.sh index c311bab7b..75085b8c2 100644 --- a/contrib/dependency_setup.sh +++ b/contrib/dependency_setup.sh @@ -22,37 +22,37 @@ setup_mac() { } setup_apt() { - apt_deps="git make jq gcc pkg-config libssl-dev" + apt_deps="git make jq gcc pkg-config" $1 install $apt_deps || return 1 } setup_pacman() { - pacman_deps="git make jq gcc pkgconf openssl" + pacman_deps="git make jq gcc pkgconf" $1 -Sy $pacman_deps || return 1 } setup_xbps() { - xbps_deps="git make jq gcc pkg-config openssl-devel" + xbps_deps="git make jq gcc pkg-config" $1 -S $xbps_deps || return 1 } setup_dnf() { - dnf_deps="git make jq gcc pkg-config openssl-devel findutils lato-fonts" + dnf_deps="git make jq gcc pkg-config findutils lato-fonts" $1 install -y $dnf_deps || return 1 } setup_apk() { - apk_deps="git make jq gcc musl-dev openssl-dev" + apk_deps="git make jq gcc musl-dev" $1 add $apk_deps || return 1 } setup_zypper() { - zypper_deps="git make jq gcc pkg-config openssl-devel findutils" + zypper_deps="git make jq gcc pkg-config findutils" $1 install -y $zypper_deps || return 1 } setup_emerge() { - emerge_deps="dev-vcs/git app-misc/jq dev-util/pkgconf dev-libs/openssl" + emerge_deps="dev-vcs/git app-misc/jq dev-util/pkgconf" $1 $emerge_deps || return 1 } diff --git a/src/contract/dao/Cargo.toml b/src/contract/dao/Cargo.toml index e18c88b37..a20d7c0f3 100644 --- a/src/contract/dao/Cargo.toml +++ b/src/contract/dao/Cargo.toml @@ -29,7 +29,7 @@ darkfi = {path = "../../../", features = ["tx", "blockchain"]} darkfi-money-contract = { path = "../money", features = ["client", "no-entrypoint"] } simplelog = "0.12.0" sled = "0.34.7" -sqlx = {version = "0.6.2", features = ["runtime-async-std-native-tls", "sqlite"]} +sqlx = {version = "0.6.2", features = ["runtime-async-std-rustls", "sqlite"]} # We need to disable random using "custom" which makes the crate a noop # so the wasm32-unknown-unknown target is enabled. diff --git a/src/contract/money/Cargo.toml b/src/contract/money/Cargo.toml index cb8a3bb61..42f14fe2d 100644 --- a/src/contract/money/Cargo.toml +++ b/src/contract/money/Cargo.toml @@ -26,7 +26,7 @@ async-std = {version = "1.12.0", features = ["attributes"]} darkfi = {path = "../../../", features = ["tx", "blockchain"]} simplelog = "0.12.0" sled = "0.34.7" -sqlx = {version = "0.6.2", features = ["runtime-async-std-native-tls", "sqlite"]} +sqlx = {version = "0.6.2", features = ["runtime-async-std-rustls", "sqlite"]} # We need to disable random using "custom" which makes the crate a noop # so the wasm32-unknown-unknown target is enabled.