| OLD | NEW |
| 1 // Copyright (c) 2011 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 #include "chrome/browser/extensions/extension_creator.h" | 5 #include "chrome/browser/extensions/extension_creator.h" |
| 6 | 6 |
| 7 #include <string> |
| 7 #include <vector> | 8 #include <vector> |
| 8 #include <string> | |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/memory/scoped_handle.h" | 11 #include "base/memory/scoped_handle.h" |
| 12 #include "base/memory/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "crypto/rsa_private_key.h" | |
| 15 #include "crypto/signature_creator.h" | |
| 16 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 14 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
| 17 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
| 18 #include "chrome/common/extensions/extension_file_util.h" | 16 #include "chrome/common/extensions/extension_file_util.h" |
| 19 #include "chrome/common/zip.h" | 17 #include "chrome/common/zip.h" |
| 18 #include "crypto/rsa_private_key.h" |
| 19 #include "crypto/signature_creator.h" |
| 20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 const int kRSAKeySize = 1024; | 24 const int kRSAKeySize = 1024; |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 bool ExtensionCreator::InitializeInput( | 27 bool ExtensionCreator::InitializeInput( |
| 28 const FilePath& extension_dir, | 28 const FilePath& extension_dir, |
| 29 const FilePath& private_key_path, | 29 const FilePath& private_key_path, |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 bool result = false; | 264 bool result = false; |
| 265 if (CreateZip(extension_dir, temp_dir.path(), &zip_path) && | 265 if (CreateZip(extension_dir, temp_dir.path(), &zip_path) && |
| 266 SignZip(zip_path, key_pair.get(), &signature) && | 266 SignZip(zip_path, key_pair.get(), &signature) && |
| 267 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { | 267 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { |
| 268 result = true; | 268 result = true; |
| 269 } | 269 } |
| 270 | 270 |
| 271 file_util::Delete(zip_path, false); | 271 file_util::Delete(zip_path, false); |
| 272 return result; | 272 return result; |
| 273 } | 273 } |
| OLD | NEW |