diff options
author | backkem <mail@backkem.me> | 2024-05-06 17:05:26 +0200 |
---|---|---|
committer | Openscreen LUCI CQ <openscreen-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-05-06 22:03:56 +0000 |
commit | 63732567274be498156e1a5e3727f19922c72923 (patch) | |
tree | 4d7010648558d5581d5d321d9739cbefa7556da3 | |
parent | 6d1389d5594c4a0009c45c1709f4625cfa05f0ea (diff) | |
download | openscreen-upstream-main.tar.gz |
[OpenScreen] Unpredictable initial Destination Connection IDupstream-main
According to the Quic spec[1], when an Initial packet is sent by
a client that has not previously received an Initial or Retry packet
from the server, the client populates the Destination Connection ID
field with an unpredictable value.
[1] https://datatracker.ietf.org/doc/html/rfc9000#name-negotiating-connection-ids
Bug: none
Change-Id: If3a8f0ece0cfb9e39247431470686d050f2c524e
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/5516585
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Commit-Queue: Mark Foltz <mfoltz@chromium.org>
-rw-r--r-- | osp/impl/quic/quic_connection_factory_client.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/osp/impl/quic/quic_connection_factory_client.cc b/osp/impl/quic/quic_connection_factory_client.cc index ff5a1f9e..c9a7f6b6 100644 --- a/osp/impl/quic/quic_connection_factory_client.cc +++ b/osp/impl/quic/quic_connection_factory_client.cc @@ -11,6 +11,7 @@ #include "osp/impl/quic/quic_packet_writer_impl.h" #include "osp/impl/quic/quic_utils.h" #include "quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.h" +#include "quiche/quic/core/quic_utils.h" #include "util/osp_logging.h" #include "util/std_util.h" #include "util/trace_logging.h" @@ -69,7 +70,7 @@ ErrorOr<std::unique_ptr<QuicConnection>> QuicConnectionFactoryClient::Connect( quic::QuicPacketWriter* writer = new PacketWriterImpl(socket.get()); auto connection = std::make_unique<quic::QuicConnection>( - /*server_connection_id=*/quic::EmptyQuicConnectionId(), + /*server_connection_id=*/quic::QuicUtils::CreateRandomConnectionId(), ToQuicSocketAddress(local_endpoint), ToQuicSocketAddress(remote_endpoint), helper_.get(), alarm_factory_.get(), writer, /*owns_writer=*/true, quic::Perspective::IS_CLIENT, supported_versions_, |