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

Unified Diff: chrome/browser/policy/test/local_policy_test_server.cc

Issue 2530023002: Fix policy test server key rotation feature (Closed)
Patch Set: Rename, add comments Created 4 years, 1 month 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/browser/policy/test/local_policy_test_server.cc
diff --git a/chrome/browser/policy/test/local_policy_test_server.cc b/chrome/browser/policy/test/local_policy_test_server.cc
index f336af1d07e37b7373272052e2a1f4d9a210fe9f..d2fa7db11f9349178f812641ff035bfc17ba4612 100644
--- a/chrome/browser/policy/test/local_policy_test_server.cc
+++ b/chrome/browser/policy/test/local_policy_test_server.cc
@@ -15,6 +15,7 @@
#include "base/json/json_writer.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
+#include "base/values.h"
#include "build/build_config.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "crypto/rsa_private_key.h"
@@ -114,6 +115,10 @@ bool LocalPolicyTestServer::SetSigningKeyAndSignature(
return bytes_written == static_cast<int>(signature.size());
}
+void LocalPolicyTestServer::EnableAutomaticRotationOfSigningKeys() {
+ automatic_rotation_of_signing_keys_enabled_ = true;
+}
+
void LocalPolicyTestServer::RegisterClient(const std::string& dm_token,
const std::string& device_id) {
CHECK(server_data_dir_.IsValid());
@@ -237,6 +242,10 @@ bool LocalPolicyTestServer::GenerateAdditionalArguments(
arguments->SetString("config-file", config_file_.AsUTF8Unsafe());
if (!policy_key_.empty())
arguments->SetString("policy-key", policy_key_.AsUTF8Unsafe());
+ if (automatic_rotation_of_signing_keys_enabled_) {
+ arguments->Set("rotate-policy-keys-automatically",
+ base::Value::CreateNullValue());
+ }
if (server_data_dir_.IsValid()) {
arguments->SetString("data-dir", server_data_dir_.GetPath().AsUTF8Unsafe());
« no previous file with comments | « chrome/browser/policy/test/local_policy_test_server.h ('k') | chrome/browser/policy/test/policy_testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698