Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Unified Diff: net/quic/crypto/crypto_utils.h

Issue 12381018: QUIC - Some sketching of the crypto handshake. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/crypto_protocol.cc ('k') | net/quic/crypto/crypto_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/crypto_utils.h
===================================================================
--- net/quic/crypto/crypto_utils.h (revision 184750)
+++ net/quic/crypto/crypto_utils.h (working copy)
@@ -8,47 +8,28 @@
#define NET_QUIC_CRYPTO_CRYPTO_UTILS_H_
#include <string>
-#include <vector>
#include "net/base/net_export.h"
+#include "net/quic/crypto/crypto_protocol.h"
namespace net {
class QuicClock;
class QuicRandom;
-struct CryptoHandshakeMessage;
-struct QuicCryptoConfig;
-struct QuicCryptoNegotiatedParams;
class NET_EXPORT_PRIVATE CryptoUtils {
public:
- // Encodes a single value as a string for CryptoTagValueMap.
- template <class T>
- static std::string EncodeSingleValue(const T& value) {
- return std::string(reinterpret_cast<const char*>(&value), sizeof(value));
- }
+ // FindMutualTag sets |out_result| to the first tag in |preference| that is
+ // also in |supported| and returns true. If there is no intersection between
+ // |preference| and |supported| it returns false.
+ static bool FindMutualTag(const CryptoTagVector& preference,
+ const CryptoTagVector& supported,
+ CryptoTag* out_result);
- // Encodes a vector value as a string for CryptoTagValueMap.
- template <class T>
- static std::string EncodeVectorValue(const std::vector<T>& value) {
- return std::string(reinterpret_cast<const char*>(&value[0]),
- value.size() * sizeof(value[0]));
- }
-
// Generates the connection nonce.
static void GenerateNonce(const QuicClock* clock,
QuicRandom* random_generator,
std::string* nonce);
-
- static void FillClientHelloMessage(const QuicCryptoConfig& client_config,
- const std::string& nonce,
- const std::string& server_hostname,
- CryptoHandshakeMessage* message);
-
- static void FillServerHelloMessage(
- const QuicCryptoNegotiatedParams& negotiated_params,
- const std::string& nonce,
- CryptoHandshakeMessage* message);
};
} // namespace net
« no previous file with comments | « net/quic/crypto/crypto_protocol.cc ('k') | net/quic/crypto/crypto_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698