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

Unified Diff: chrome/renderer/extensions/enterprise_platform_keys_natives.cc

Issue 306433003: enterprise.platformKeys: Support the publicExponent parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 6 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: chrome/renderer/extensions/enterprise_platform_keys_natives.cc
diff --git a/chrome/renderer/extensions/enterprise_platform_keys_natives.cc b/chrome/renderer/extensions/enterprise_platform_keys_natives.cc
index 8d9ea9a9fb1af227b110031ecd06899b741e7dd6..2e11b25d09b642d2448fd1f8cc650dc720ada04e 100644
--- a/chrome/renderer/extensions/enterprise_platform_keys_natives.cc
+++ b/chrome/renderer/extensions/enterprise_platform_keys_natives.cc
@@ -12,6 +12,7 @@
#include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/WebKit/public/platform/WebString.h"
+#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebCryptoNormalize.h"
namespace extensions {
@@ -48,6 +49,13 @@ scoped_ptr<base::DictionaryValue> WebCryptoAlgorithmToBaseValue(
if (rsaHashedKeyGen) {
dict->SetIntegerWithoutPathExpansion("modulusLength",
rsaHashedKeyGen->modulusLengthBits());
+ const blink::WebVector<unsigned char>& public_exponent =
+ rsaHashedKeyGen->publicExponent();
+ dict->SetWithoutPathExpansion(
+ "publicExponent",
+ base::BinaryValue::CreateWithCopiedBuffer(
+ reinterpret_cast<const char*>(public_exponent.data()),
+ public_exponent.size()));
}
// Otherwise, |algorithm| is missing support here or no parameters were
// required.

Powered by Google App Engine
This is Rietveld 408576698