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

Side by Side Diff: chrome/utility/importer/nss_decryptor.cc

Issue 306123004: NSSDecryptor::ReadAndParseSignons() - improved password form scheme detection, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fixups Created 6 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/utility/importer/nss_decryptor.h" 5 #include "chrome/utility/importer/nss_decryptor.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } else { 277 } else {
278 url = GURL(s2.ColumnString(0)); 278 url = GURL(s2.ColumnString(0));
279 } 279 }
280 // Skip this row if the URL is not valid. 280 // Skip this row if the URL is not valid.
281 if (!url.is_valid()) 281 if (!url.is_valid())
282 continue; 282 continue;
283 283
284 autofill::PasswordForm form; 284 autofill::PasswordForm form;
285 form.origin = url.ReplaceComponents(rep); 285 form.origin = url.ReplaceComponents(rep);
286 form.signon_realm = form.origin.GetOrigin().spec(); 286 form.signon_realm = form.origin.GetOrigin().spec();
287 if (!realm.empty()) 287 if (!realm.empty()) {
288 form.signon_realm += realm; 288 form.signon_realm += realm;
289 // Non-empty realm indicates that it's not html form authentication entry.
290 // Extracted data doesn't allow us to distinguish basic_auth entry from
291 // digest_auth entry, so let's assume basic_auth.
292 form.scheme = autofill::PasswordForm::SCHEME_BASIC;
293 }
289 form.ssl_valid = form.origin.SchemeIsSecure(); 294 form.ssl_valid = form.origin.SchemeIsSecure();
290 // The user name, password and action. 295 // The user name, password and action.
291 form.username_element = s2.ColumnString16(3); 296 form.username_element = s2.ColumnString16(3);
292 form.username_value = Decrypt(s2.ColumnString(5)); 297 form.username_value = Decrypt(s2.ColumnString(5));
293 form.password_element = s2.ColumnString16(4); 298 form.password_element = s2.ColumnString16(4);
294 form.password_value = Decrypt(s2.ColumnString(6)); 299 form.password_value = Decrypt(s2.ColumnString(6));
295 form.action = GURL(s2.ColumnString(2)).ReplaceComponents(rep); 300 form.action = GURL(s2.ColumnString(2)).ReplaceComponents(rep);
296 forms->push_back(form); 301 forms->push_back(form);
297 } 302 }
298 return true; 303 return true;
299 } 304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698