Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: components/password_manager/core/browser/login_database.cc

Issue 2095383002: Log error if decryption fails in LoginDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/password_manager/core/browser/login_database.h" 5 #include "components/password_manager/core/browser/login_database.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 1056
1057 // static 1057 // static
1058 LoginDatabase::EncryptionResult LoginDatabase::InitPasswordFormFromStatement( 1058 LoginDatabase::EncryptionResult LoginDatabase::InitPasswordFormFromStatement(
1059 PasswordForm* form, 1059 PasswordForm* form,
1060 sql::Statement& s) { 1060 sql::Statement& s) {
1061 std::string encrypted_password; 1061 std::string encrypted_password;
1062 s.ColumnBlobAsString(COLUMN_PASSWORD_VALUE, &encrypted_password); 1062 s.ColumnBlobAsString(COLUMN_PASSWORD_VALUE, &encrypted_password);
1063 base::string16 decrypted_password; 1063 base::string16 decrypted_password;
1064 EncryptionResult encryption_result = 1064 EncryptionResult encryption_result =
1065 DecryptedString(encrypted_password, &decrypted_password); 1065 DecryptedString(encrypted_password, &decrypted_password);
1066 if (encryption_result != ENCRYPTION_RESULT_SUCCESS) 1066 if (encryption_result != ENCRYPTION_RESULT_SUCCESS) {
1067 VLOG(0) << "Password decryption failed";
vasilii 2016/06/27 13:54:18 Print encryption_result?
vabr (Chromium) 2016/06/27 14:36:39 Good point, done.
1067 return encryption_result; 1068 return encryption_result;
1069 }
1068 1070
1069 std::string tmp = s.ColumnString(COLUMN_ORIGIN_URL); 1071 std::string tmp = s.ColumnString(COLUMN_ORIGIN_URL);
1070 form->origin = GURL(tmp); 1072 form->origin = GURL(tmp);
1071 tmp = s.ColumnString(COLUMN_ACTION_URL); 1073 tmp = s.ColumnString(COLUMN_ACTION_URL);
1072 form->action = GURL(tmp); 1074 form->action = GURL(tmp);
1073 form->username_element = s.ColumnString16(COLUMN_USERNAME_ELEMENT); 1075 form->username_element = s.ColumnString16(COLUMN_USERNAME_ELEMENT);
1074 form->username_value = s.ColumnString16(COLUMN_USERNAME_VALUE); 1076 form->username_value = s.ColumnString16(COLUMN_USERNAME_VALUE);
1075 form->password_element = s.ColumnString16(COLUMN_PASSWORD_ELEMENT); 1077 form->password_element = s.ColumnString16(COLUMN_PASSWORD_ELEMENT);
1076 form->password_value = decrypted_password; 1078 form->password_value = decrypted_password;
1077 form->submit_element = s.ColumnString16(COLUMN_SUBMIT_ELEMENT); 1079 form->submit_element = s.ColumnString16(COLUMN_SUBMIT_ELEMENT);
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", 1350 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering",
1349 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); 1351 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT);
1350 } 1352 }
1351 1353
1352 if (!statement->Succeeded()) 1354 if (!statement->Succeeded())
1353 return false; 1355 return false;
1354 return true; 1356 return true;
1355 } 1357 }
1356 1358
1357 } // namespace password_manager 1359 } // namespace password_manager
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698