OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/password_manager/native_backend_libsecret.h" | 5 #include "chrome/browser/password_manager/native_backend_libsecret.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <libsecret/secret.h> | 10 #include <libsecret/secret.h> |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 attrs.Append("origin_url", lookup_form.origin.spec()); | 311 attrs.Append("origin_url", lookup_form.origin.spec()); |
312 attrs.Append("username_element", UTF16ToUTF8(lookup_form.username_element)); | 312 attrs.Append("username_element", UTF16ToUTF8(lookup_form.username_element)); |
313 attrs.Append("username_value", UTF16ToUTF8(lookup_form.username_value)); | 313 attrs.Append("username_value", UTF16ToUTF8(lookup_form.username_value)); |
314 attrs.Append("password_element", UTF16ToUTF8(lookup_form.password_element)); | 314 attrs.Append("password_element", UTF16ToUTF8(lookup_form.password_element)); |
315 attrs.Append("signon_realm", lookup_form.signon_realm); | 315 attrs.Append("signon_realm", lookup_form.signon_realm); |
316 attrs.Append("application", app_string_); | 316 attrs.Append("application", app_string_); |
317 | 317 |
318 GError* error = nullptr; | 318 GError* error = nullptr; |
319 GList* found = LibsecretLoader::secret_service_search_sync( | 319 GList* found = LibsecretLoader::secret_service_search_sync( |
320 nullptr, // default secret service | 320 nullptr, // default secret service |
321 &kLibsecretSchema, attrs.Get(), SECRET_SEARCH_ALL, | 321 &kLibsecretSchema, attrs.Get(), |
| 322 static_cast<SecretSearchFlags>(SECRET_SEARCH_ALL | SECRET_SEARCH_UNLOCK), |
322 nullptr, // no cancellable ojbect | 323 nullptr, // no cancellable ojbect |
323 &error); | 324 &error); |
324 if (error) { | 325 if (error) { |
325 LOG(ERROR) << "Unable to get logins " << error->message; | 326 LOG(ERROR) << "Unable to get logins " << error->message; |
326 g_error_free(error); | 327 g_error_free(error); |
327 if (found) | 328 if (found) |
328 g_list_free(found); | 329 g_list_free(found); |
329 return false; | 330 return false; |
330 } | 331 } |
331 | 332 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 if (lookup_form && | 415 if (lookup_form && |
415 !password_manager::ShouldPSLDomainMatchingApply( | 416 !password_manager::ShouldPSLDomainMatchingApply( |
416 password_manager::GetRegistryControlledDomain( | 417 password_manager::GetRegistryControlledDomain( |
417 GURL(lookup_form->signon_realm))) && | 418 GURL(lookup_form->signon_realm))) && |
418 lookup_form->scheme != PasswordForm::SCHEME_HTML) | 419 lookup_form->scheme != PasswordForm::SCHEME_HTML) |
419 attrs.Append("signon_realm", lookup_form->signon_realm); | 420 attrs.Append("signon_realm", lookup_form->signon_realm); |
420 | 421 |
421 GError* error = nullptr; | 422 GError* error = nullptr; |
422 GList* found = LibsecretLoader::secret_service_search_sync( | 423 GList* found = LibsecretLoader::secret_service_search_sync( |
423 nullptr, // default secret service | 424 nullptr, // default secret service |
424 &kLibsecretSchema, attrs.Get(), SECRET_SEARCH_ALL, | 425 &kLibsecretSchema, attrs.Get(), |
| 426 static_cast<SecretSearchFlags>(SECRET_SEARCH_ALL | SECRET_SEARCH_UNLOCK), |
425 nullptr, // no cancellable ojbect | 427 nullptr, // no cancellable ojbect |
426 &error); | 428 &error); |
427 if (error) { | 429 if (error) { |
428 LOG(ERROR) << "Unable to get logins " << error->message; | 430 LOG(ERROR) << "Unable to get logins " << error->message; |
429 g_error_free(error); | 431 g_error_free(error); |
430 if (found) | 432 if (found) |
431 g_list_free(found); | 433 g_list_free(found); |
432 return false; | 434 return false; |
433 } | 435 } |
434 | 436 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 if (lookup_form) { | 560 if (lookup_form) { |
559 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", | 561 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", |
560 allow_psl_match | 562 allow_psl_match |
561 ? psl_domain_match_metric | 563 ? psl_domain_match_metric |
562 : password_manager::PSL_DOMAIN_MATCH_NOT_USED, | 564 : password_manager::PSL_DOMAIN_MATCH_NOT_USED, |
563 password_manager::PSL_DOMAIN_MATCH_COUNT); | 565 password_manager::PSL_DOMAIN_MATCH_COUNT); |
564 } | 566 } |
565 g_list_free(found); | 567 g_list_free(found); |
566 return forms; | 568 return forms; |
567 } | 569 } |
OLD | NEW |