cargo: use openssl crypo backend

This commit is contained in:
Vincent Breitmoser
2024-01-24 17:00:03 +01:00
parent 45c6fcf216
commit dfafe5cdb7
7 changed files with 60 additions and 124 deletions

173
Cargo.lock generated
View File

@@ -197,26 +197,6 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72"
[[package]]
name = "bindgen"
version = "0.68.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078"
dependencies = [
"bitflags 2.4.1",
"cexpr",
"clang-sys",
"lazy_static",
"lazycell",
"peeking_take_while",
"proc-macro2 1.0.71",
"quote 1.0.33",
"regex",
"rustc-hash",
"shlex",
"syn 2.0.43",
]
[[package]]
name = "bit-set"
version = "0.5.3"
@@ -306,15 +286,6 @@ dependencies = [
"libc",
]
[[package]]
name = "cexpr"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
dependencies = [
"nom",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
@@ -341,17 +312,6 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87"
[[package]]
name = "clang-sys"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]]
name = "clap"
version = "2.34.0"
@@ -708,6 +668,21 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "foreign-types"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
"foreign-types-shared",
]
[[package]]
name = "foreign-types-shared"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "fs2"
version = "0.4.3"
@@ -1361,12 +1336,6 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "lazycell"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "lettre"
version = "0.10.0-rc.5"
@@ -1391,16 +1360,6 @@ version = "0.2.151"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
[[package]]
name = "libloading"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
dependencies = [
"cfg-if",
"winapi",
]
[[package]]
name = "libredox"
version = "0.0.1"
@@ -1522,12 +1481,6 @@ dependencies = [
"unicase 2.6.0",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.7.1"
@@ -1607,33 +1560,6 @@ dependencies = [
"serde",
]
[[package]]
name = "nettle"
version = "7.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9fdccf3eae7b161910d2daa2f0155ca35041322e8fe5c5f1f2c9d0b12356336"
dependencies = [
"getrandom",
"libc",
"nettle-sys",
"thiserror",
"typenum",
]
[[package]]
name = "nettle-sys"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b495053a10a19a80e3a26bf1212e92e29350797b5f5bdc58268c3f3f818e66ec"
dependencies = [
"bindgen",
"cc",
"libc",
"pkg-config",
"tempfile",
"vcpkg",
]
[[package]]
name = "new_debug_unreachable"
version = "1.0.4"
@@ -1661,16 +1587,6 @@ dependencies = [
"url",
]
[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]]
name = "normpath"
version = "1.1.1"
@@ -1752,6 +1668,44 @@ version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "openssl"
version = "0.10.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c"
dependencies = [
"bitflags 2.4.1",
"cfg-if",
"foreign-types",
"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 1.0.71",
"quote 1.0.33",
"syn 2.0.43",
]
[[package]]
name = "openssl-sys"
version = "0.9.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "overload"
version = "0.1.1"
@@ -1810,12 +1764,6 @@ dependencies = [
"syn 2.0.43",
]
[[package]]
name = "peeking_take_while"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]]
name = "percent-encoding"
version = "1.0.1"
@@ -2418,12 +2366,6 @@ version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustc_version"
version = "0.4.0"
@@ -2509,8 +2451,9 @@ dependencies = [
"lazy_static",
"libc",
"memsec",
"nettle",
"once_cell",
"openssl",
"openssl-sys",
"rand 0.8.5",
"regex",
"regex-syntax 0.8.2",
@@ -2589,12 +2532,6 @@ dependencies = [
"lazy_static",
]
[[package]]
name = "shlex"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380"
[[package]]
name = "signal-hook-registry"
version = "1.4.1"

View File

@@ -19,7 +19,7 @@ anyhow = "1"
rocket = { version = "0.5", features = [ "json" ] }
rocket_dyn_templates = { version = "0.1", features = ["handlebars"] }
rocket_codegen = "0.5"
sequoia-openpgp = { version = "1", default-features = false, features = ["crypto-nettle"] }
sequoia-openpgp = { version = "1", default-features = false, features = ["crypto-openssl"] }
multipart = "0"
serde = "1"
serde_derive = "1"

View File

@@ -37,7 +37,7 @@ Additionally, some external dependencies are required.
Get them (on Debian or Ubuntu) with
```bash
sudo apt install gnutls-bin nettle-dev gcc llvm-dev libclang-dev build-essential pkg-config gettext
sudo apt install gnutls-bin libssl-dev gcc llvm-dev libclang-dev build-essential pkg-config gettext
```
After Rust and the other dependencies are installed, copy the config file, then simply compile and run:

View File

@@ -5,7 +5,7 @@ authors = ["Kai Michaelis <kai@sequoia-pgp.org>"]
[dependencies]
anyhow = "1"
sequoia-openpgp = { version = "1", default-features = false, features = ["crypto-nettle"] }
sequoia-openpgp = { version = "1", default-features = false, features = ["crypto-openssl"] }
log = "0"
rand = "0.6"
serde = { version = "1.0", features = ["derive"] }

View File

@@ -1,6 +1,6 @@
FROM rustlang/rust:nightly
RUN apt update -qy
RUN apt install -qy libclang-dev build-essential pkg-config clang nettle-dev gettext zsh
RUN apt install -qy libclang-dev build-essential pkg-config clang libssl-dev gettext zsh
RUN useradd -u 1000 -d /home/user user && mkdir /home/user && chown user:user /home/user
USER user

View File

@@ -6,7 +6,7 @@ authors = ["Vincent Breitmoser <look@my.amazin.horse>"]
[dependencies]
hagrid-database = { path = "../database" }
anyhow = "1"
sequoia-openpgp = { version = "1", default-features = false, features = ["crypto-nettle"] }
sequoia-openpgp = { version = "1", default-features = false, features = ["crypto-openssl"] }
multipart = "0"
log = "0"
rand = "0.6"

View File

@@ -20,7 +20,6 @@ pkgs.mkShell {
openssl
clang
nettle
pkg-config
gettext