-
Notifications
You must be signed in to change notification settings - Fork 899
/
Copy pathwindows-disable-encryption.patch
37 lines (31 loc) · 1.31 KB
/
windows-disable-encryption.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Disable encryption of cookies, passwords, settings...
# WARNING! Use ONLY if your hard drive is encrypted or if you know what you are doing.
# See https://github.com/Eloston/ungoogled-chromium/issues/444
--- a/components/os_crypt/os_crypt_win.cc
+++ b/components/os_crypt/os_crypt_win.cc
@@ -6,6 +6,7 @@
#include <windows.h>
+#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
#include "crypto/wincrypt_shim.h"
@@ -26,6 +27,10 @@ bool OSCrypt::DecryptString16(const std::string& ciphertext,
bool OSCrypt::EncryptString(const std::string& plaintext,
std::string* ciphertext) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("disable-encryption")) {
+ *ciphertext = plaintext;
+ return true;
+ }
DATA_BLOB input;
input.pbData = const_cast<BYTE*>(
reinterpret_cast<const BYTE*>(plaintext.data()));
@@ -49,6 +54,11 @@ bool OSCrypt::EncryptString(const std::string& plaintext,
bool OSCrypt::DecryptString(const std::string& ciphertext,
std::string* plaintext) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("disable-encryption")) {
+ *plaintext = ciphertext;
+ return true;
+ }
+
DATA_BLOB input;
input.pbData = const_cast<BYTE*>(
reinterpret_cast<const BYTE*>(ciphertext.data()));