Commit f3afa17a authored by Will Harris's avatar Will Harris Committed by Commit Bot

Revert "Tolerate setting same os_crypt key twice in the same process."

This reverts commit 76f496a7.

Reason for revert: decided to take a different approach

https://chromium-review.googlesource.com/c/chromium/src/+/1872475 fixes
this in a better way, that doesn't rely on oscrypt behavior.

Original change's description:
> Tolerate setting same os_crypt key twice in the same process.
>
> Setting the same key twice is allowed but a different key is still
> something that should never happen.
>
> This permits service such as network process to run in-process
> and also fixes --single-process mode.
>
> BUG=1000799,1016384
>
> Change-Id: I9da8221adc763d1188b64589dafedeee866d585f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872155
> Reviewed-by: Christos Froussios <cfroussios@chromium.org>
> Commit-Queue: Will Harris <wfh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#707865}

TBR=wfh@chromium.org,cfroussios@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1000799, 1016384
Change-Id: I572d066180a2d2438732072c6806e21cddfacdbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874612
Commit-Queue: Will Harris <wfh@chromium.org>
Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708416}
parent bc0d25b9
......@@ -7,7 +7,6 @@
#include <windows.h>
#include "base/base64.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
......@@ -231,12 +230,7 @@ bool OSCrypt::Init(PrefService* local_state) {
void OSCrypt::SetRawEncryptionKey(const std::string& raw_key) {
DCHECK(!g_use_mock_key) << "Mock key in use.";
DCHECK(!raw_key.empty()) << "Bad key.";
#if DCHECK_IS_ON()
if (!GetEncryptionKeyFactory().empty()) {
DCHECK_EQ(raw_key, GetEncryptionKeyFactory())
<< "Different key already set.";
}
#endif
DCHECK(GetEncryptionKeyFactory().empty()) << "Key already set.";
GetEncryptionKeyFactory().assign(raw_key);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment