Land Recent QUIC changes.
Add an explicit FlushAllQueuedFrames method to QuicPacketGenerator. This
differs from FinishBatchOperations in that it flushes *all* queued frames,
even those which might not be currently sendable.
This is necessary to ensure that crypto messages go out in their own
packets, regardless of the current writability of the socket.
Fixes a bug in which crypto messages might not be sent in dedicated
packets.
Merge internal change: 54521255
Fixes to make the following reverted QUIC CL's to work.
https://codereview.chromium.org/26385004/
https://codereview.chromium.org/26739002/
- Changed "DCHECK(retransmission_alarm_->IsSet())" to if
retransmission_alarm_->IsSet() then cancel the alarm.
- Added call to OnPacketSent from QuicConnectionHelper::OnWriteComplete.
- If QUIC version from client or server is version 10 and the other side
supports version 11, then only set Encrypter/Decryter.
- Disabled QuiConnectionHelper's WritePacketToWireAsync. Will be
rewriting this code in the next merge CL.
Remove unused IsWriteBlocked method from QuicConnectionHelperInterface.
Merge internal change: 53803217
Add missing QUIC_VERSION_Q011 case in QuicVersionToString.
Merge internal change: 53749976
QUIC: don't ignore SetKey and SetNoncePrefix return values.
This change causes failures to set the AES-GCM key and nonce to bubble
up and kill the connection. I don't think that we've had any failures,
but you never know and it would be bad to, say, start transmitting
plaintext or something because we didn't notice that we failed to set
a key.
(The OpenSSL AEAD API doesn't actually let that happen: it zeros the
output buffer on any failure, but things might change in the future.)
(This is a follow up from a previous CL which altered our AES-128-GCM
implementation.)
Merge internal change: 53742674
Reduce the length of the QUIC null encryption auth hash from 16 bytes to 12
bytes to match the length of the AES auth hash.
Merge internal change: 53693995
Addressing comments in Jana's review of cr/52231261.
Merge internal change: 53582401
QUIC: disable P-256 support on the server.
The P-256 key generation is done with OpenSSL, which doesn't use the
QuicRandom passed to DefaultConfig(). This is causing the generated
server configs to be non-deterministic and breaking 0-RTT handshakes.
Merge internal change: 53501783
Fix an LOG to use the correct condition in QuicReceivedPacketManager and
change it to a DFATAL so in the future tests will prevent re-occurrence.
Merge internal change: 53483753
Cleanup: Rename OnIncomingAck to OnPacketAcked, and remove unneeeded argument
from SentPacketManager::OnIncomingAck.
Merge internal change: 53483155
Fix a bug in QuicConnection/QuicConnectionHelper if the helper buffered the
write (as is the case in chrome). In this case, the sent packet was not
accounted for properly.
Merge internal change: 53462749
Refactor to change WritePacket to return a WriteResult struct.
Merge internal change: 53382221
Fixing a bug where the version negotiation packet would get dropped on the
floor if the socket was write blocked at the time it was sent. The packet is
now queued.
Merge internal change: 53317846
Create a new QUIC_INVALID_CHANNEL_ID_SIGNATURE error to replace a usage of
QUIC_INTERNAL_ERROR.
Merge internal change: 53277933
Added a todo to merge internal CL 53267501 when chromium's version of OpenSSL
has latest AEAD code.
Didn't merge internal change: 53267501
[email protected]
Review URL: https://codereview.chromium.org/26930003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228438 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h
index 8532a22..ad42eb4c 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -191,7 +191,8 @@
QUIC_VERSION_UNSUPPORTED = 0,
QUIC_VERSION_9 = 9,
- QUIC_VERSION_10 = 10, // Current version.
+ QUIC_VERSION_10 = 10,
+ QUIC_VERSION_11 = 11, // Current version.
};
// This vector contains QUIC versions which we currently support.
@@ -199,7 +200,7 @@
// element, with subsequent elements in descending order (versions can be
// skipped as necessary).
static const QuicVersion kSupportedQuicVersions[] =
- {QUIC_VERSION_10, QUIC_VERSION_9};
+ {QUIC_VERSION_11, QUIC_VERSION_10, QUIC_VERSION_9};
typedef std::vector<QuicVersion> QuicVersionVector;
@@ -377,6 +378,8 @@
QUIC_INVALID_CRYPTO_MESSAGE_TYPE = 33,
// A crypto message was received with an illegal parameter.
QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER = 34,
+ // An invalid channel id signature was supplied.
+ QUIC_INVALID_CHANNEL_ID_SIGNATURE = 52,
// A crypto message was received with a mandatory parameter missing.
QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND = 35,
// A crypto message was received with a parameter that has no overlap
@@ -403,9 +406,11 @@
QUIC_CRYPTO_ENCRYPTION_LEVEL_INCORRECT = 44,
// The server config for a server has expired.
QUIC_CRYPTO_SERVER_CONFIG_EXPIRED = 45,
+ // We failed to setup the symmetric keys for a connection.
+ QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED = 53,
// No error. Used as bound while iterating.
- QUIC_LAST_ERROR = 52,
+ QUIC_LAST_ERROR = 54,
};
struct NET_EXPORT_PRIVATE QuicPacketPublicHeader {
@@ -870,6 +875,26 @@
bool fin_consumed;
};
+enum WriteStatus {
+ WRITE_STATUS_OK,
+ WRITE_STATUS_BLOCKED,
+ WRITE_STATUS_ERROR,
+};
+
+// A struct used to return the result of write calls including either the number
+// of bytes written or the error code, depending upon the status.
+struct NET_EXPORT_PRIVATE WriteResult {
+ WriteResult(WriteStatus status, int bytes_written_or_error_code) :
+ status(status), bytes_written(bytes_written_or_error_code) {
+ }
+
+ WriteStatus status;
+ union {
+ int bytes_written; // only valid when status is OK
+ int error_code; // only valid when status is ERROR
+ };
+};
+
} // namespace net
#endif // NET_QUIC_QUIC_PROTOCOL_H_