OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef NET_QUIC_QUIC_CRYPTO_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_CRYPTO_STREAM_H_ |
6 #define NET_QUIC_QUIC_CRYPTO_STREAM_H_ | 6 #define NET_QUIC_QUIC_CRYPTO_STREAM_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "net/quic/crypto/crypto_framer.h" | 9 #include "net/quic/crypto/crypto_framer.h" |
10 #include "net/quic/crypto/crypto_utils.h" | 10 #include "net/quic/crypto/crypto_utils.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 const CryptoHandshakeMessage& message) OVERRIDE; | 39 const CryptoHandshakeMessage& message) OVERRIDE; |
40 | 40 |
41 // ReliableQuicStream implementation | 41 // ReliableQuicStream implementation |
42 virtual uint32 ProcessRawData(const char* data, uint32 data_len) OVERRIDE; | 42 virtual uint32 ProcessRawData(const char* data, uint32 data_len) OVERRIDE; |
43 virtual QuicPriority EffectivePriority() const OVERRIDE; | 43 virtual QuicPriority EffectivePriority() const OVERRIDE; |
44 | 44 |
45 // Sends |message| to the peer. | 45 // Sends |message| to the peer. |
46 // TODO(wtc): return a success/failure status. | 46 // TODO(wtc): return a success/failure status. |
47 void SendHandshakeMessage(const CryptoHandshakeMessage& message); | 47 void SendHandshakeMessage(const CryptoHandshakeMessage& message); |
48 | 48 |
| 49 // Performs key extraction to derive a new secret of |result_len| bytes |
| 50 // dependent on |label|, |context|, and the stream's negotiated subkey secret. |
| 51 // Returns false if the handshake has not been confirmed or the parameters are |
| 52 // invalid (e.g. |label| contains null bytes); returns true on success. |
| 53 bool ExportKeyingMaterial(base::StringPiece label, |
| 54 base::StringPiece context, |
| 55 size_t result_len, |
| 56 std::string* result) const; |
| 57 |
49 bool encryption_established() const { return encryption_established_; } | 58 bool encryption_established() const { return encryption_established_; } |
50 bool handshake_confirmed() const { return handshake_confirmed_; } | 59 bool handshake_confirmed() const { return handshake_confirmed_; } |
51 | 60 |
52 const QuicCryptoNegotiatedParameters& crypto_negotiated_params() const; | 61 const QuicCryptoNegotiatedParameters& crypto_negotiated_params() const; |
53 | 62 |
54 protected: | 63 protected: |
55 bool encryption_established_; | 64 bool encryption_established_; |
56 bool handshake_confirmed_; | 65 bool handshake_confirmed_; |
57 | 66 |
58 QuicCryptoNegotiatedParameters crypto_negotiated_params_; | 67 QuicCryptoNegotiatedParameters crypto_negotiated_params_; |
59 | 68 |
60 private: | 69 private: |
61 CryptoFramer crypto_framer_; | 70 CryptoFramer crypto_framer_; |
62 | 71 |
63 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStream); | 72 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStream); |
64 }; | 73 }; |
65 | 74 |
66 } // namespace net | 75 } // namespace net |
67 | 76 |
68 #endif // NET_QUIC_QUIC_CRYPTO_STREAM_H_ | 77 #endif // NET_QUIC_QUIC_CRYPTO_STREAM_H_ |
OLD | NEW |