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

Unified Diff: webrtc/base/helpers.cc

Issue 1528843005: Add support for GCM cipher suites from RFC 7714. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Disable GCM if ENABLE_EXTERNAL_AUTH is defined. Created 4 years, 5 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 | « webrtc/base/helpers.h ('k') | webrtc/base/helpers_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/helpers.cc
diff --git a/webrtc/base/helpers.cc b/webrtc/base/helpers.cc
index 0a39ee923e1d61b3db9fa6399aee34049595fff6..b284cd7a73237b5c4608cd4dd7187c79d4029ed4 100644
--- a/webrtc/base/helpers.cc
+++ b/webrtc/base/helpers.cc
@@ -245,6 +245,13 @@ bool CreateRandomString(size_t len, const std::string& table,
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.
« no previous file with comments | « webrtc/base/helpers.h ('k') | webrtc/base/helpers_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698