Add support for GCM cipher suites from RFC 7714.
GCM cipher suites are optional (disabled by default) and can be enabled
through "PeerConnectionFactoryInterface::Options".
If compiled with Chromium (i.e. "ENABLE_EXTERNAL_AUTH" is defined), no
GCM ciphers can be used yet (see https://crbug.com/628400).
BUG=webrtc:5222, 628400
Review-Url: https://codereview.webrtc.org/1528843005
Cr-Commit-Position: refs/heads/master@{#13635}
diff --git a/webrtc/base/helpers.cc b/webrtc/base/helpers.cc
index 0a39ee9..b284cd7 100644
--- a/webrtc/base/helpers.cc
+++ b/webrtc/base/helpers.cc
@@ -245,6 +245,13 @@
static_cast<int>(table.size()), str);
}
+bool CreateRandomData(size_t length, std::string* data) {
+ data->resize(length);
+ // std::string is guaranteed to use contiguous memory in c++11 so we can
+ // safely write directly to it.
+ return Rng().Generate(&data->at(0), length);
+}
+
// Version 4 UUID is of the form:
// xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
// Where 'x' is a hex digit, and 'y' is 8, 9, a or b.