fix(identity): remove prost dependency

Pull-Request: #3713.
This commit is contained in:
Thomas Eizinger
2023-04-09 16:48:43 +01:00
committed by GitHub
parent 23c3d24610
commit 6b6187bd1c
4 changed files with 18 additions and 31 deletions

24
Cargo.lock generated
View File

@ -2505,7 +2505,6 @@ dependencies = [
"multiaddr", "multiaddr",
"multihash", "multihash",
"p256 0.12.0", "p256 0.12.0",
"prost",
"quick-protobuf", "quick-protobuf",
"quickcheck-ext", "quickcheck-ext",
"rand 0.8.5", "rand 0.8.5",
@ -3843,29 +3842,6 @@ dependencies = [
"syn 1.0.109", "syn 1.0.109",
] ]
[[package]]
name = "prost"
version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537"
dependencies = [
"bytes",
"prost-derive",
]
[[package]]
name = "prost-derive"
version = "0.11.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b"
dependencies = [
"anyhow",
"itertools",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]] [[package]]
name = "quick-error" name = "quick-error"
version = "1.2.3" version = "1.2.3"

View File

@ -20,8 +20,7 @@ log = "0.4"
multiaddr = { version = "0.17.1", optional = true } multiaddr = { version = "0.17.1", optional = true }
multihash = { version = "0.17.0", default-features = false, features = ["std"], optional = true } multihash = { version = "0.17.0", default-features = false, features = ["std"], optional = true }
p256 = { version = "0.12", default-features = false, features = ["ecdsa", "std"], optional = true } p256 = { version = "0.12", default-features = false, features = ["ecdsa", "std"], optional = true }
prost = { version = "0.11", optional = true } quick-protobuf = { version = "0.8.1", optional = true }
quick-protobuf = "0.8.1"
rand = { version = "0.8", optional = true } rand = { version = "0.8", optional = true }
sec1 = { version = "0.3.0", features = ["std"], optional = true } # Activate `std` feature until https://github.com/RustCrypto/traits/pull/1131 is released. sec1 = { version = "0.3.0", features = ["std"], optional = true } # Activate `std` feature until https://github.com/RustCrypto/traits/pull/1131 is released.
serde = { version = "1", optional = true, features = ["derive"] } serde = { version = "1", optional = true, features = ["derive"] }
@ -34,11 +33,11 @@ zeroize = { version = "1.6", optional = true }
ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false, optional = true} ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false, optional = true}
[features] [features]
secp256k1 = [ "libsecp256k1", "asn1_der", "prost", "rand", "sha2", "zeroize" ] secp256k1 = [ "dep:libsecp256k1", "dep:asn1_der", "dep:rand", "dep:sha2", "dep:zeroize", "dep:quick-protobuf" ]
ecdsa = [ "p256", "prost", "rand", "void", "zeroize", "sec1" ] ecdsa = [ "dep:p256", "dep:rand", "dep:void", "dep:zeroize", "dep:sec1", "dep:quick-protobuf" ]
rsa = [ "dep:ring", "asn1_der", "prost", "rand", "zeroize" ] rsa = [ "dep:ring", "dep:asn1_der", "dep:rand", "dep:zeroize", "dep:quick-protobuf" ]
ed25519 = [ "ed25519-dalek", "prost", "rand", "zeroize" ] ed25519 = [ "dep:ed25519-dalek", "dep:rand", "dep:zeroize", "dep:quick-protobuf" ]
peerid = [ "multihash", "multiaddr", "bs58", "rand", "thiserror", "sha2" ] peerid = [ "dep:multihash", "dep:multiaddr", "dep:bs58", "dep:rand", "dep:thiserror", "dep:sha2" ]
[dev-dependencies] [dev-dependencies]
quickcheck = { package = "quickcheck-ext", path = "../misc/quickcheck-ext" } quickcheck = { package = "quickcheck-ext", path = "../misc/quickcheck-ext" }

View File

@ -81,6 +81,12 @@ impl DecodingError {
} }
} }
#[cfg(any(
feature = "ecdsa",
feature = "secp256k1",
feature = "ed25519",
feature = "rsa"
))]
pub(crate) fn decoding_unsupported(key_type: &'static str) -> Self { pub(crate) fn decoding_unsupported(key_type: &'static str) -> Self {
Self { Self {
msg: format!("decoding {key_type} key from Protobuf is unsupported"), msg: format!("decoding {key_type} key from Protobuf is unsupported"),

View File

@ -33,6 +33,12 @@
//! (e.g. [ed25519 binary format](https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.5)). //! (e.g. [ed25519 binary format](https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.5)).
//! All key types have functions to enable conversion to/from their binary representations. //! All key types have functions to enable conversion to/from their binary representations.
#[cfg(any(
feature = "ecdsa",
feature = "secp256k1",
feature = "ed25519",
feature = "rsa"
))]
mod proto { mod proto {
include!("generated/mod.rs"); include!("generated/mod.rs");
pub use self::keys_proto::*; pub use self::keys_proto::*;