Lines 1-38
Link Here
|
1 |
--- components/webauthn/core/browser/passkey_sync_bridge.cc.orig 2023-08-17 12:40:56 UTC |
1 |
--- components/webauthn/core/browser/passkey_sync_bridge.cc.orig 2023-08-28 12:53:33 UTC |
2 |
+++ components/webauthn/core/browser/passkey_sync_bridge.cc |
2 |
+++ components/webauthn/core/browser/passkey_sync_bridge.cc |
3 |
@@ -267,6 +267,7 @@ PasskeySyncBridge::GetAllPasskeys() const { |
3 |
@@ -268,7 +268,11 @@ PasskeySyncBridge::GetAllPasskeys() const { |
4 |
|
|
|
5 |
bool PasskeySyncBridge::DeletePasskey(const std::string& credential_id) { |
4 |
bool PasskeySyncBridge::DeletePasskey(const std::string& credential_id) { |
6 |
// Find the credential with the given |credential_id|. |
5 |
// Find the credential with the given |credential_id|. |
7 |
+#if BUILDFLAG(IS_OPENBSD) || (BUILDFLAG(IS_FREEBSD) && (_LIBCPP_VERSION > 15000)) |
|
|
8 |
const auto passkey_it = |
6 |
const auto passkey_it = |
|
|
7 |
+#if (_LIBCPP_VERSION >= 160000) |
9 |
std::ranges::find_if(data_, [&credential_id](const auto& passkey) { |
8 |
std::ranges::find_if(data_, [&credential_id](const auto& passkey) { |
10 |
return passkey.second.credential_id() == credential_id; |
|
|
11 |
@@ -313,11 +314,16 @@ bool PasskeySyncBridge::DeletePasskey(const std::strin |
12 |
weak_ptr_factory_.GetWeakPtr())); |
13 |
NotifyPasskeysChanged(); |
14 |
return true; |
15 |
+#else |
9 |
+#else |
16 |
+ LOG(ERROR) << "Unable to delete passkey"; |
10 |
+ base::ranges::find_if(data_, [&credential_id](const auto& passkey) { |
17 |
+ return false; |
|
|
18 |
+#endif |
11 |
+#endif |
19 |
} |
12 |
return passkey.second.credential_id() == credential_id; |
20 |
|
13 |
}); |
21 |
bool PasskeySyncBridge::UpdatePasskey(const std::string& credential_id, |
14 |
if (passkey_it == data_.end()) { |
|
|
15 |
@@ -319,7 +323,11 @@ bool PasskeySyncBridge::UpdatePasskey(const std::strin |
22 |
PasskeyChange change) { |
16 |
PasskeyChange change) { |
23 |
// Find the credential with the given |credential_id|. |
17 |
// Find the credential with the given |credential_id|. |
24 |
+#if BUILDFLAG(IS_OPENBSD) || (BUILDFLAG(IS_FREEBSD) && (_LIBCPP_VERSION > 15000)) |
|
|
25 |
const auto passkey_it = |
18 |
const auto passkey_it = |
|
|
19 |
+#if (_LIBCPP_VERSION >= 160000) |
26 |
std::ranges::find_if(data_, [&credential_id](const auto& passkey) { |
20 |
std::ranges::find_if(data_, [&credential_id](const auto& passkey) { |
27 |
return passkey.second.credential_id() == credential_id; |
|
|
28 |
@@ -341,6 +347,10 @@ bool PasskeySyncBridge::UpdatePasskey(const std::strin |
29 |
weak_ptr_factory_.GetWeakPtr())); |
30 |
NotifyPasskeysChanged(); |
31 |
return true; |
32 |
+#else |
21 |
+#else |
33 |
+ LOG(ERROR) << "Unable to update passkey"; |
22 |
+ base::ranges::find_if(data_, [&credential_id](const auto& passkey) { |
34 |
+ return false; |
|
|
35 |
+#endif |
23 |
+#endif |
36 |
} |
24 |
return passkey.second.credential_id() == credential_id; |
37 |
|
25 |
}); |
38 |
std::string PasskeySyncBridge::AddNewPasskeyForTesting( |
26 |
if (passkey_it == data_.end()) { |
39 |
- |
|
|