| Index: net/quic/crypto/crypto_server_config.cc
|
| diff --git a/net/quic/crypto/crypto_server_config.cc b/net/quic/crypto/crypto_server_config.cc
|
| index 7c7d0ff7f767252e33e3e50860dca6c92971b789..4ff51c438992e9cd5c569875aa9fec04a1b0367c 100644
|
| --- a/net/quic/crypto/crypto_server_config.cc
|
| +++ b/net/quic/crypto/crypto_server_config.cc
|
| @@ -449,9 +449,12 @@ QuicErrorCode QuicCryptoServerConfig::ProcessClientHello(
|
| hkdf_input.append(requested_config->serialized);
|
|
|
| CrypterPair crypters;
|
| - CryptoUtils::DeriveKeys(params->initial_premaster_secret, params->aead,
|
| - info.client_nonce, info.server_nonce, hkdf_input,
|
| - CryptoUtils::SERVER, &crypters);
|
| + if (!CryptoUtils::DeriveKeys(params->initial_premaster_secret, params->aead,
|
| + info.client_nonce, info.server_nonce,
|
| + hkdf_input, CryptoUtils::SERVER, &crypters)) {
|
| + *error_details = "Symmetric key setup failed";
|
| + return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED;
|
| + }
|
|
|
| scoped_ptr<QuicData> cetv_plaintext(crypters.decrypter->DecryptPacket(
|
| 0 /* sequence number */, StringPiece() /* associated data */,
|
| @@ -486,9 +489,13 @@ QuicErrorCode QuicCryptoServerConfig::ProcessClientHello(
|
| hkdf_input.append(QuicCryptoConfig::kInitialLabel, label_len);
|
| hkdf_input.append(hkdf_suffix);
|
|
|
| - CryptoUtils::DeriveKeys(params->initial_premaster_secret, params->aead,
|
| - info.client_nonce, info.server_nonce, hkdf_input,
|
| - CryptoUtils::SERVER, ¶ms->initial_crypters);
|
| + if (!CryptoUtils::DeriveKeys(params->initial_premaster_secret, params->aead,
|
| + info.client_nonce, info.server_nonce, hkdf_input,
|
| + CryptoUtils::SERVER,
|
| + ¶ms->initial_crypters)) {
|
| + *error_details = "Symmetric key setup failed";
|
| + return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED;
|
| + }
|
|
|
| string forward_secure_public_value;
|
| if (ephemeral_key_source_.get()) {
|
| @@ -515,10 +522,13 @@ QuicErrorCode QuicCryptoServerConfig::ProcessClientHello(
|
| label_len);
|
| forward_secure_hkdf_input.append(hkdf_suffix);
|
|
|
| - CryptoUtils::DeriveKeys(params->forward_secure_premaster_secret, params->aead,
|
| - info.client_nonce, info.server_nonce,
|
| - forward_secure_hkdf_input, CryptoUtils::SERVER,
|
| - ¶ms->forward_secure_crypters);
|
| + if (!CryptoUtils::DeriveKeys(
|
| + params->forward_secure_premaster_secret, params->aead,
|
| + info.client_nonce, info.server_nonce, forward_secure_hkdf_input,
|
| + CryptoUtils::SERVER, ¶ms->forward_secure_crypters)) {
|
| + *error_details = "Symmetric key setup failed";
|
| + return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED;
|
| + }
|
|
|
| out->set_tag(kSHLO);
|
| out->SetStringPiece(kSourceAddressTokenTag,
|
|
|