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

Unified Diff: third_party/WebKit/Source/platform/exported/WebCryptoUtil.cpp

Issue 1418113002: RTCPeerConnection.generateCertificate taking AlgorithmIdentifier and using WebCrypto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with master Created 5 years, 2 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
Index: third_party/WebKit/Source/platform/exported/WebCryptoUtil.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebCryptoUtil.cpp b/third_party/WebKit/Source/platform/exported/WebCryptoUtil.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3db9a11fce6ffb23716adfc6639b18d94bd9e750
--- /dev/null
+++ b/third_party/WebKit/Source/platform/exported/WebCryptoUtil.cpp
@@ -0,0 +1,24 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "public/platform/WebCryptoUtil.h"
+
+namespace blink {
+
+bool bigIntegerToUint(const WebVector<unsigned char>& bigInteger, unsigned& result)
+{
+ result = 0;
+ for (size_t i = 0; i < bigInteger.size(); ++i) {
+ size_t iReversed = bigInteger.size() - i - 1;
+
+ if (iReversed >= sizeof(result) && bigInteger[i])
+ return false; // Too large for unsigned int.
+
+ result |= bigInteger[i] << 8 * iReversed;
+ }
+ return true;
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/blink_platform.gypi ('k') | third_party/WebKit/public/blink_headers.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698