OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_WIN_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_WIN_H_ |
6 #define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_WIN_H_ | 6 #define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/native_library.h" | 13 #include "base/native_library.h" |
| 14 #include "base/string16.h" |
14 | 15 |
15 // The following declarations of functions and types are from Firefox | 16 // The following declarations of functions and types are from Firefox |
16 // NSS library. | 17 // NSS library. |
17 // source code: | 18 // source code: |
18 // security/nss/lib/util/seccomon.h | 19 // security/nss/lib/util/seccomon.h |
19 // security/nss/lib/nss/nss.h | 20 // security/nss/lib/nss/nss.h |
20 // The license block is: | 21 // The license block is: |
21 | 22 |
22 /* ***** BEGIN LICENSE BLOCK ***** | 23 /* ***** BEGIN LICENSE BLOCK ***** |
23 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 24 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // Loads NSS3 library and returns true if successful. | 118 // Loads NSS3 library and returns true if successful. |
118 // |dll_path| indicates the location of NSS3 DLL files, and |db_path| | 119 // |dll_path| indicates the location of NSS3 DLL files, and |db_path| |
119 // is the location of the database file that stores the keys. | 120 // is the location of the database file that stores the keys. |
120 bool Init(const FilePath& dll_path, const FilePath& db_path); | 121 bool Init(const FilePath& dll_path, const FilePath& db_path); |
121 | 122 |
122 // Frees the libraries. | 123 // Frees the libraries. |
123 void Free(); | 124 void Free(); |
124 | 125 |
125 // Decrypts Firefox stored passwords. Before using this method, | 126 // Decrypts Firefox stored passwords. Before using this method, |
126 // make sure Init() returns true. | 127 // make sure Init() returns true. |
127 std::wstring Decrypt(const std::string& crypt) const; | 128 string16 Decrypt(const std::string& crypt) const; |
128 | 129 |
129 // Parses the Firefox password file content, decrypts the | 130 // Parses the Firefox password file content, decrypts the |
130 // username/password and reads other related information. | 131 // username/password and reads other related information. |
131 // The result will be stored in |forms|. | 132 // The result will be stored in |forms|. |
132 void ParseSignons(const std::string& content, | 133 void ParseSignons(const std::string& content, |
133 std::vector<webkit_glue::PasswordForm>* forms); | 134 std::vector<webkit_glue::PasswordForm>* forms); |
134 | 135 |
135 // Reads and parses the Firefox password sqlite db, decrypts the | 136 // Reads and parses the Firefox password sqlite db, decrypts the |
136 // username/password and reads other related information. | 137 // username/password and reads other related information. |
137 // The result will be stored in |forms|. | 138 // The result will be stored in |forms|. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 base::NativeLibrary nss3_dll_; | 170 base::NativeLibrary nss3_dll_; |
170 base::NativeLibrary softokn3_dll_; | 171 base::NativeLibrary softokn3_dll_; |
171 | 172 |
172 // True if NSS_Init() has been called | 173 // True if NSS_Init() has been called |
173 bool is_nss_initialized_; | 174 bool is_nss_initialized_; |
174 | 175 |
175 DISALLOW_COPY_AND_ASSIGN(NSSDecryptor); | 176 DISALLOW_COPY_AND_ASSIGN(NSSDecryptor); |
176 }; | 177 }; |
177 | 178 |
178 #endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_WIN_H_ | 179 #endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_WIN_H_ |
OLD | NEW |