Skip to content

Commit

Permalink
- Get rid of barebones-x509
Browse files Browse the repository at this point in the history
- Add more comments to x509 code
  • Loading branch information
kpp committed Dec 14, 2021
1 parent e51fd82 commit 63e4696
Show file tree
Hide file tree
Showing 5 changed files with 487 additions and 185 deletions.
5 changes: 2 additions & 3 deletions transports/quic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ license = "MIT"
[dependencies]
async-global-executor = "2.0.2"
async-io = "1.6.0"
barebones-x509 = { version = "0.5.0", features = ["webpki", "rustls", "std"] }
bytes = "1.0.1"
der-parser = { version = "6.0.0", default-features = false }
futures = "0.3.15"
if-watch = "0.2.2"
libp2p-core = { version = "0.31.0", path = "../../core" }
multihash = { version = "0.14.0", default-features = false }
parking_lot = "0.11.1"
quinn-proto = { version = "0.7.3", default-features = false, features = ["tls-rustls"] }
rcgen = { version = "0.8.11" }
Expand All @@ -24,8 +23,8 @@ rustls = { version = "0.19.1", features = ["dangerous_configuration"] }
thiserror = "1.0.26"
tracing = "0.1.26"
udp-socket = "0.1.5"
untrusted = { version = "0.7.1" }
webpki = { version = "0.21.4", features = ["std"] }
x509-parser = "0.12.0"
yasna = { version = "0.4.0" }

[dev-dependencies]
Expand Down
5 changes: 2 additions & 3 deletions transports/quic/src/muxer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ impl QuicMuxer {
let inner = self.inner.lock();
let session = inner.connection.crypto_session();
let certificate = session.get_peer_certificates()?.into_iter().next()?;
Some(crate::tls::extract_peerid_or_panic(
quinn_proto::Certificate::from(certificate).as_der(),
))
let certificate = crate::tls::certificate::parse_certificate(&certificate.0).ok()?;
Some(PeerId::from_public_key(&certificate.extension.public_key))
}

pub fn local_addr(&self) -> Multiaddr {
Expand Down
Loading

0 comments on commit 63e4696

Please sign in to comment.