| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_MAC_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_MAC_H_ |
| 6 #define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_MAC_H_ | 6 #define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_MAC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // make sure Init() returns true. | 130 // make sure Init() returns true. |
| 131 std::wstring Decrypt(const std::string& crypt) const; | 131 std::wstring Decrypt(const std::string& crypt) const; |
| 132 | 132 |
| 133 // Parses the Firefox password file content, decrypts the | 133 // Parses the Firefox password file content, decrypts the |
| 134 // username/password and reads other related information. | 134 // username/password and reads other related information. |
| 135 // The result will be stored in |forms|. | 135 // The result will be stored in |forms|. |
| 136 void ParseSignons(const std::string& content, | 136 void ParseSignons(const std::string& content, |
| 137 std::vector<webkit_glue::PasswordForm>* forms); | 137 std::vector<webkit_glue::PasswordForm>* forms); |
| 138 | 138 |
| 139 private: | 139 private: |
| 140 PK11SlotInfo* GetKeySlotForDB() const { return PK11_GetInternalKeySlot(); } |
| 141 void FreeSlot(PK11SlotInfo* slot) const { PK11_FreeSlot(slot); } |
| 142 |
| 140 // Methods in Firefox security components. | 143 // Methods in Firefox security components. |
| 141 NSSInitFunc NSS_Init; | 144 NSSInitFunc NSS_Init; |
| 142 NSSShutdownFunc NSS_Shutdown; | 145 NSSShutdownFunc NSS_Shutdown; |
| 143 PK11GetInternalKeySlotFunc PK11_GetInternalKeySlot; | 146 PK11GetInternalKeySlotFunc PK11_GetInternalKeySlot; |
| 144 PK11CheckUserPasswordFunc PK11_CheckUserPassword; | 147 PK11CheckUserPasswordFunc PK11_CheckUserPassword; |
| 145 PK11FreeSlotFunc PK11_FreeSlot; | 148 PK11FreeSlotFunc PK11_FreeSlot; |
| 146 PK11AuthenticateFunc PK11_Authenticate; | 149 PK11AuthenticateFunc PK11_Authenticate; |
| 147 PK11SDRDecryptFunc PK11SDR_Decrypt; | 150 PK11SDRDecryptFunc PK11SDR_Decrypt; |
| 148 SECITEMFreeItemFunc SECITEM_FreeItem; | 151 SECITEMFreeItemFunc SECITEM_FreeItem; |
| 149 PLArenaFinishFunc PL_ArenaFinish; | 152 PLArenaFinishFunc PL_ArenaFinish; |
| 150 PRCleanupFunc PR_Cleanup; | 153 PRCleanupFunc PR_Cleanup; |
| 151 | 154 |
| 152 // True if NSS_Init() has been called | 155 // True if NSS_Init() has been called |
| 153 bool is_nss_initialized_; | 156 bool is_nss_initialized_; |
| 154 | 157 |
| 155 DISALLOW_COPY_AND_ASSIGN(NSSDecryptor); | 158 DISALLOW_COPY_AND_ASSIGN(NSSDecryptor); |
| 156 }; | 159 }; |
| 157 | 160 |
| 158 #endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_MAC_H_ | 161 #endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_MAC_H_ |
| OLD | NEW |