Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(identity): make Keypair and Publickey opaque #3866

Merged
merged 35 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e525203
work in progress Keypair
tcoratger May 2, 2023
65d6546
clean up
tcoratger May 2, 2023
7940834
remove KeypairType return and replace by Keypair
tcoratger May 4, 2023
8670e74
move pub Keypair to the top of file and replace KeypairType by Inner
tcoratger May 4, 2023
1be78fa
add ? to let ed25519_keypair
tcoratger May 4, 2023
2ae737c
clean up and remove some deprecated warnings
tcoratger May 4, 2023
bf065eb
remove other deprecated warnings
tcoratger May 4, 2023
fdd2b51
encapsulate PublicKeyType
tcoratger May 4, 2023
c649da8
clean up
tcoratger May 4, 2023
c5c5125
clean up
tcoratger May 4, 2023
f4b172f
move doc from private to public struct
tcoratger May 4, 2023
5c7d3cb
remove keypair_dummy.rs
tcoratger May 4, 2023
c3ad64f
Merge branch 'master' into identity-keypair-publickey-opaque
tcoratger May 4, 2023
894d22b
rename Inner to KeyPairInner and PublicKeyType to PublicKeyInner
tcoratger May 4, 2023
d96e3f5
pub(crate) publickey
tcoratger May 4, 2023
9d4fe3d
keypair module def unconditional
tcoratger May 4, 2023
1eb59bb
pub(crate) enum PublicKeyInner
tcoratger May 4, 2023
bb38ced
Merge branch 'master' into identity-keypair-publickey-opaque
tcoratger May 4, 2023
ab11cd1
clean up after merge
tcoratger May 4, 2023
e1dcbdb
clean up
tcoratger May 5, 2023
2e6baef
clean up useless ok()?
tcoratger May 5, 2023
e852a0c
clean up cfg
tcoratger May 5, 2023
c71b26e
Merge branch 'master' into identity-keypair-publickey-opaque
tcoratger May 5, 2023
d9969f9
remove all allow(deprecated) in keypair.rs
tcoratger May 5, 2023
a0d9267
add changelog
tcoratger May 5, 2023
c3bd310
clean up and fix quick_protobuf dependencies
tcoratger May 5, 2023
a6e45ec
fix self.keypair
tcoratger May 5, 2023
18e77d1
fix clippy
tcoratger May 5, 2023
60808fa
fix clippy
tcoratger May 5, 2023
f5781f0
Merge branch 'master' into identity-keypair-publickey-opaque
tcoratger May 5, 2023
9cb06fa
fix clippy
tcoratger May 5, 2023
c98dfd1
fix clippy
tcoratger May 5, 2023
b255326
fix due to keypair_protobuf_roundtrip_secp256k1 update
tcoratger May 5, 2023
e65f045
add features to keypair_from_protobuf_encoding test
tcoratger May 5, 2023
b998372
Minor tidy-up
thomaseizinger May 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
- Add support for exporting and importing ECDSA keys via the libp2p [protobuf format].
See [PR 3863].

- Make `Keypair` and `PublicKey` opaque.
See [PR 3866].

[PR 3715]: https://github.com/libp2p/rust-libp2p/pull/3715
[PR 3863]: https://github.com/libp2p/rust-libp2p/pull/3863
[PR 3866]: https://github.com/libp2p/rust-libp2p/pull/3866
[protobuf format]: https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md#keys

## 0.1.2
Expand Down
10 changes: 5 additions & 5 deletions identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ log = "0.4"
multiaddr = { version = "0.17.1", optional = true }
multihash = { version = "0.17.0", default-features = false, features = ["std"], optional = true }
p256 = { version = "0.13", default-features = false, features = ["ecdsa", "std", "pem"], optional = true }
quick-protobuf = { version = "0.8.1", optional = true }
quick-protobuf = "0.8.1"
rand = { version = "0.8", optional = true }
sec1 = { version = "0.7", default-features = false, optional = true }
serde = { version = "1", optional = true, features = ["derive"] }
Expand All @@ -33,10 +33,10 @@ zeroize = { version = "1.6", optional = true }
ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false, optional = true}

[features]
secp256k1 = [ "dep:libsecp256k1", "dep:asn1_der", "dep:rand", "dep:sha2", "dep:zeroize", "dep:quick-protobuf" ]
ecdsa = [ "dep:p256", "dep:rand", "dep:void", "dep:zeroize", "dep:sec1", "dep:quick-protobuf" ]
rsa = [ "dep:ring", "dep:asn1_der", "dep:rand", "dep:zeroize", "dep:quick-protobuf" ]
ed25519 = [ "dep:ed25519-dalek", "dep:rand", "dep:zeroize", "dep:quick-protobuf" ]
secp256k1 = [ "dep:libsecp256k1", "dep:asn1_der", "dep:rand", "dep:sha2", "dep:zeroize" ]
ecdsa = [ "dep:p256", "dep:rand", "dep:void", "dep:zeroize", "dep:sec1" ]
rsa = [ "dep:ring", "dep:asn1_der", "dep:rand", "dep:zeroize" ]
ed25519 = [ "dep:ed25519-dalek", "dep:rand", "dep:zeroize" ]
peerid = [ "dep:multihash", "dep:multiaddr", "dep:bs58", "dep:rand", "dep:thiserror", "dep:sha2" ]

[dev-dependencies]
Expand Down
1 change: 1 addition & 0 deletions identity/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub struct DecodingError {
}

impl DecodingError {
#[allow(dead_code)]
pub(crate) fn missing_feature(feature_name: &'static str) -> Self {
Self {
msg: format!("cargo feature `{feature_name}` is not enabled"),
Expand Down
Loading