OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/crypto/quic_crypto_server_config.h" | 5 #include "net/quic/crypto/quic_crypto_server_config.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 } | 745 } |
746 | 746 |
747 char plaintext[kMaxPacketSize]; | 747 char plaintext[kMaxPacketSize]; |
748 size_t plaintext_length = 0; | 748 size_t plaintext_length = 0; |
749 const bool success = crypters.decrypter->DecryptPacket( | 749 const bool success = crypters.decrypter->DecryptPacket( |
750 kDefaultPathId, 0 /* packet number */, | 750 kDefaultPathId, 0 /* packet number */, |
751 StringPiece() /* associated data */, cetv_ciphertext, plaintext, | 751 StringPiece() /* associated data */, cetv_ciphertext, plaintext, |
752 &plaintext_length, kMaxPacketSize); | 752 &plaintext_length, kMaxPacketSize); |
753 if (!success) { | 753 if (!success) { |
754 *error_details = "CETV decryption failure"; | 754 *error_details = "CETV decryption failure"; |
755 return QUIC_PACKET_TOO_LARGE; | 755 return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER; |
756 } | 756 } |
757 scoped_ptr<CryptoHandshakeMessage> cetv( | 757 scoped_ptr<CryptoHandshakeMessage> cetv( |
758 CryptoFramer::ParseMessage(StringPiece(plaintext, plaintext_length))); | 758 CryptoFramer::ParseMessage(StringPiece(plaintext, plaintext_length))); |
759 if (!cetv.get()) { | 759 if (!cetv.get()) { |
760 *error_details = "CETV parse error"; | 760 *error_details = "CETV parse error"; |
761 return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER; | 761 return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER; |
762 } | 762 } |
763 | 763 |
764 StringPiece key, signature; | 764 StringPiece key, signature; |
765 if (cetv->GetStringPiece(kCIDK, &key) && | 765 if (cetv->GetStringPiece(kCIDK, &key) && |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 priority(0), | 1807 priority(0), |
1808 source_address_token_boxer(nullptr) {} | 1808 source_address_token_boxer(nullptr) {} |
1809 | 1809 |
1810 QuicCryptoServerConfig::Config::~Config() { | 1810 QuicCryptoServerConfig::Config::~Config() { |
1811 STLDeleteElements(&key_exchanges); | 1811 STLDeleteElements(&key_exchanges); |
1812 } | 1812 } |
1813 | 1813 |
1814 QuicCryptoProof::QuicCryptoProof() : certs(nullptr) {} | 1814 QuicCryptoProof::QuicCryptoProof() : certs(nullptr) {} |
1815 QuicCryptoProof::~QuicCryptoProof() {} | 1815 QuicCryptoProof::~QuicCryptoProof() {} |
1816 } // namespace net | 1816 } // namespace net |
OLD | NEW |