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 #include "chrome/browser/extensions/extension_creator.h" | 5 #include "chrome/browser/extensions/extension_creator.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/crypto/rsa_private_key.h" | 10 #include "base/crypto/rsa_private_key.h" |
11 #include "base/crypto/signature_creator.h" | 11 #include "base/crypto/signature_creator.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/scoped_handle.h" | 13 #include "base/scoped_handle.h" |
14 #include "base/scoped_temp_dir.h" | 14 #include "base/scoped_temp_dir.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "chrome/browser/extensions/extension_file_util.h" | 16 #include "chrome/browser/extensions/extension_file_util.h" |
17 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 17 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
18 #include "chrome/common/extensions/extension.h" | 18 #include "chrome/common/extensions/extension.h" |
19 #include "chrome/common/zip.h" | 19 #include "chrome/common/zip.h" |
20 #include "net/base/base64.h" | |
21 | 20 |
22 namespace { | 21 namespace { |
23 const int kRSAKeySize = 1024; | 22 const int kRSAKeySize = 1024; |
24 }; | 23 }; |
25 | 24 |
26 bool ExtensionCreator::InitializeInput( | 25 bool ExtensionCreator::InitializeInput( |
27 const FilePath& extension_dir, | 26 const FilePath& extension_dir, |
28 const FilePath& private_key_path, | 27 const FilePath& private_key_path, |
29 const FilePath& private_key_output_path) { | 28 const FilePath& private_key_output_path) { |
30 // Validate input |extension_dir|. | 29 // Validate input |extension_dir|. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 bool result = false; | 241 bool result = false; |
243 if (CreateZip(extension_dir, temp_dir.path(), &zip_path) && | 242 if (CreateZip(extension_dir, temp_dir.path(), &zip_path) && |
244 SignZip(zip_path, key_pair.get(), &signature) && | 243 SignZip(zip_path, key_pair.get(), &signature) && |
245 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { | 244 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { |
246 result = true; | 245 result = true; |
247 } | 246 } |
248 | 247 |
249 file_util::Delete(zip_path, false); | 248 file_util::Delete(zip_path, false); |
250 return result; | 249 return result; |
251 } | 250 } |
OLD | NEW |