OLD | NEW |
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/os_crypt/ie7_password_win.h" | 5 #include "components/os_crypt/ie7_password_win.h" |
6 | 6 |
7 #include <wincrypt.h> | |
8 #include <string> | 7 #include <string> |
9 #include <vector> | 8 #include <vector> |
10 | 9 |
11 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
12 #include "base/sha1.h" | 11 #include "base/sha1.h" |
13 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "crypto/wincrypt_shim.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // Structures that IE7/IE8 use to store a username/password. | 18 // Structures that IE7/IE8 use to store a username/password. |
19 // Some of the fields might have been incorrectly reverse engineered. | 19 // Some of the fields might have been incorrectly reverse engineered. |
20 struct PreHeader { | 20 struct PreHeader { |
21 DWORD pre_header_size; // Size of this header structure. Always 12. | 21 DWORD pre_header_size; // Size of this header structure. Always 12. |
22 DWORD header_size; // Size of the real Header: sizeof(Header) + | 22 DWORD header_size; // Size of the real Header: sizeof(Header) + |
23 // item_count * sizeof(Entry); | 23 // item_count * sizeof(Entry); |
24 DWORD data_size; // Size of the data referenced by the entries. | 24 DWORD data_size; // Size of the data referenced by the entries. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 GetUserPassFromData(decrypted_data, credentials); | 139 GetUserPassFromData(decrypted_data, credentials); |
140 | 140 |
141 LocalFree(output.pbData); | 141 LocalFree(output.pbData); |
142 return true; | 142 return true; |
143 } | 143 } |
144 | 144 |
145 return false; | 145 return false; |
146 } | 146 } |
147 | 147 |
148 } // namespace ie7_password | 148 } // namespace ie7_password |
OLD | NEW |