Skip to content

Commit a0429f2

Browse files
authored
Merge branch 'main' into configure-probes
2 parents fa53600 + 197d8db commit a0429f2

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

iroh/src/endpoint.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ pub use self::{
8787
quic::{
8888
AcceptBi, AcceptUni, AckFrequencyConfig, ApplicationClose, Chunk, ClosedStream,
8989
ConnectionClose, ConnectionError, ConnectionStats, Controller, ControllerFactory,
90-
ControllerMetrics, CryptoError, Dir, ExportKeyingMaterialError, FrameStats, FrameType,
91-
HandshakeTokenKey, HeaderKey, IdleTimeout, Keys, MtuDiscoveryConfig, OpenBi, OpenUni,
92-
PacketKey, PathId, PathStats, QuicConnectError, QuicTransportConfig,
93-
QuicTransportConfigBuilder, ReadDatagram, ReadError, ReadExactError, ReadToEndError,
94-
RecvStream, ResetError, RttEstimator, SendDatagram, SendDatagramError, SendStream,
95-
ServerConfig, ServerConfigBuilder, Side, StoppedError, StreamId, TimeSource, TokenLog,
96-
TokenReuseError, TransportError, TransportErrorCode, TransportParameters, UdpStats,
97-
UnorderedRecvStream, UnsupportedVersion, ValidationTokenConfig, VarInt,
90+
ControllerMetrics, CryptoError, DecryptedInitial, Dir, ExportKeyingMaterialError,
91+
FrameStats, FrameType, HandshakeTokenKey, HeaderKey, IdleTimeout, IncomingAlpns, Keys,
92+
MtuDiscoveryConfig, OpenBi, OpenUni, PacketKey, PathId, PathStats, QuicConnectError,
93+
QuicTransportConfig, QuicTransportConfigBuilder, ReadDatagram, ReadError, ReadExactError,
94+
ReadToEndError, RecvStream, ResetError, RttEstimator, SendDatagram, SendDatagramError,
95+
SendStream, ServerConfig, ServerConfigBuilder, Side, StoppedError, StreamId, TimeSource,
96+
TokenLog, TokenReuseError, TransportError, TransportErrorCode, TransportParameters,
97+
UdpStats, UnorderedRecvStream, UnsupportedVersion, ValidationTokenConfig, VarInt,
9898
VarIntBoundsExceeded, WriteError, Written,
9999
},
100100
};

iroh/src/endpoint/connection.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use noq::WeakConnectionHandle;
3434
use pin_project::pin_project;
3535
use tracing::{event, warn};
3636

37+
use super::quic::DecryptedInitial;
3738
use crate::{
3839
Endpoint,
3940
endpoint::{
@@ -212,6 +213,14 @@ impl Incoming {
212213
pub fn remote_addr_validated(&self) -> bool {
213214
self.inner.remote_address_validated()
214215
}
216+
217+
/// Decrypt the Initial packet payload
218+
///
219+
/// This clones and decrypts the packet payload (~1200 bytes).
220+
/// Can be used to extract information from the TLS ClientHello without completing the handshake.
221+
pub fn decrypt(&self) -> Option<DecryptedInitial> {
222+
self.inner.decrypt()
223+
}
215224
}
216225

217226
impl IntoFuture for Incoming {

iroh/src/endpoint/quic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ pub use noq_proto::{
5252
Chunk, // noq::RecvStream
5353
ConnectError as QuicConnectError, // iroh::endpoint::ConnectWithOptsError
5454
ConnectionClose, // noq::ConnectionError
55+
DecryptedInitial, // iroh::endpoint::connection::Incoming
5556
FrameStats, // noq::ConnectionStats
5657
FrameType, // noq_proto::TransportError
58+
IncomingAlpns, // iroh::endpoint::DecryptedInitial
5759
PathId, // noq_proto::crypto::PacketKey
5860
RttEstimator, // noq_proto::congestion::Controller
5961
TimeSource, // iroh::endpoint::quic::ServerConfig

0 commit comments

Comments
 (0)