aboutsummaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-components_os__crypt_os__crypt.h
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium/files/patch-components_os__crypt_os__crypt.h')
-rw-r--r--www/chromium/files/patch-components_os__crypt_os__crypt.h49
1 files changed, 37 insertions, 12 deletions
diff --git a/www/chromium/files/patch-components_os__crypt_os__crypt.h b/www/chromium/files/patch-components_os__crypt_os__crypt.h
index 25a8a5a21a60..5ea36009e617 100644
--- a/www/chromium/files/patch-components_os__crypt_os__crypt.h
+++ b/www/chromium/files/patch-components_os__crypt_os__crypt.h
@@ -1,6 +1,6 @@
---- components/os_crypt/os_crypt.h.orig 2022-04-21 18:48:31 UTC
+--- components/os_crypt/os_crypt.h.orig 2022-06-17 14:20:10 UTC
+++ components/os_crypt/os_crypt.h
-@@ -14,7 +14,7 @@
+@@ -15,7 +15,7 @@
#include "build/build_config.h"
#include "build/chromecast_buildflags.h"
@@ -9,7 +9,16 @@
class KeyStorageLinux;
#endif // BUILDFLAG(IS_LINUX)
-@@ -30,7 +30,7 @@ struct Config;
+@@ -24,7 +24,7 @@ class PrefRegistrySimple;
+ class PrefService;
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ namespace crypto {
+ class SymmetricKey;
+ }
+@@ -37,7 +37,7 @@ struct Config;
// Temporary interface due to OSCrypt refactor. See OSCryptImpl for descriptions
// of what each function does.
namespace OSCrypt {
@@ -18,7 +27,7 @@
COMPONENT_EXPORT(OS_CRYPT)
void SetConfig(std::unique_ptr<os_crypt::Config> config);
#endif // BUILDFLAG(IS_LINUX)
-@@ -75,7 +75,7 @@ COMPONENT_EXPORT(OS_CRYPT) void UseMockKeyForTesting(b
+@@ -82,7 +82,7 @@ COMPONENT_EXPORT(OS_CRYPT) void UseMockKeyForTesting(b
COMPONENT_EXPORT(OS_CRYPT) void SetLegacyEncryptionForTesting(bool legacy);
COMPONENT_EXPORT(OS_CRYPT) void ResetStateForTesting();
#endif // BUILDFLAG(IS_WIN)
@@ -26,22 +35,38 @@
+#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMECAST))
COMPONENT_EXPORT(OS_CRYPT)
void UseMockKeyStorageForTesting(
- std::unique_ptr<KeyStorageLinux> (*get_key_storage_mock)());
-@@ -95,7 +95,7 @@ class OSCryptImpl {
- OSCryptImpl(const OSCryptImpl&) = delete;
- OSCryptImpl& operator=(const OSCryptImpl&) = delete;
+ base::OnceCallback<std::unique_ptr<KeyStorageLinux>()>
+@@ -109,7 +109,7 @@ class COMPONENT_EXPORT(OS_CRYPT) OSCryptImpl {
+ // Returns singleton instance of OSCryptImpl.
+ static OSCryptImpl* GetInstance();
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
// Set the configuration of OSCryptImpl.
// This method, or SetRawEncryptionKey(), must be called before using
// EncryptString() and DecryptString().
-@@ -200,7 +200,7 @@ class OSCryptImpl {
- static void ResetStateForTesting();
+@@ -201,7 +201,7 @@ class COMPONENT_EXPORT(OS_CRYPT) OSCryptImpl {
+ void ResetStateForTesting();
#endif
-#if (BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMECAST))
+#if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)) && !BUILDFLAG(IS_CHROMECAST))
// For unit testing purposes, inject methods to be used.
- // |get_key_storage_mock| provides the desired |KeyStorage| implementation.
- // If the provider returns |nullptr|, a hardcoded password will be used.
+ // |storage_provider_factory| provides the desired |KeyStorage|
+ // implementation. If the provider returns |nullptr|, a hardcoded password
+@@ -226,13 +226,13 @@ class COMPONENT_EXPORT(OS_CRYPT) OSCryptImpl {
+ crypto::SymmetricKey* GetEncryptionKey();
+ #endif // BUILDFLAG(IS_APPLE)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_BSD)
+ // This lock is used to make the GetEncryptionKey and
+ // GetRawEncryptionKey methods thread-safe.
+ static base::Lock& GetLock();
+ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_APPLE)
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Create the KeyStorage. Will be null if no service is found. A Config must
+ // be set before every call to this method.
+ std::unique_ptr<KeyStorageLinux> CreateKeyStorage();