Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2892)

Unified Diff: chrome/common/extensions/extension_unpacker.cc

Issue 118328: chrome.exe --package-extension (Closed)
Patch Set: final Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/test/data/extensions/good.crx » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_unpacker.cc
diff --git a/chrome/common/extensions/extension_unpacker.cc b/chrome/common/extensions/extension_unpacker.cc
index bc7b25ab00fac944098f2678062aadcaf3ea2033..d07b6b4e6412ab51dd9d545a1a8e2206a3ad30e9 100644
--- a/chrome/common/extensions/extension_unpacker.cc
+++ b/chrome/common/extensions/extension_unpacker.cc
@@ -148,43 +148,6 @@ DictionaryValue* ExtensionUnpacker::ReadPackageHeader() {
}
DictionaryValue* manifest = static_cast<DictionaryValue*>(val.get());
- std::string zip_hash;
- if (!manifest->GetString(Extension::kZipHashKey, &zip_hash)) {
- SetError("missing zip_hash key");
- return NULL;
- }
- if (zip_hash.size() != kZipHashHexBytes) {
- SetError("invalid zip_hash key");
- return NULL;
- }
-
- // Read the rest of the zip file and compute a hash to compare against
- // what the manifest claims. Compute the hash incrementally since the
- // zip file could be large.
- const unsigned char* ubuf = reinterpret_cast<const unsigned char*>(buf);
- SHA256Context ctx;
- SHA256_Begin(&ctx);
- while ((len = fread(buf, 1, sizeof(buf), file.get())) > 0)
- SHA256_Update(&ctx, ubuf, len);
- uint8 hash[32];
- SHA256_End(&ctx, hash, NULL, sizeof(hash));
-
- std::vector<uint8> zip_hash_bytes;
- if (!HexStringToBytes(zip_hash, &zip_hash_bytes)) {
- SetError("invalid zip_hash key");
- return NULL;
- }
- if (zip_hash_bytes.size() != kZipHashBytes) {
- SetError("invalid zip_hash key");
- return NULL;
- }
- for (size_t i = 0; i < kZipHashBytes; ++i) {
- if (zip_hash_bytes[i] != hash[i]) {
- SetError("zip_hash key didn't match zip hash");
- return NULL;
- }
- }
-
// TODO(erikkay): The manifest will also contain a signature of the hash
// (or perhaps the whole manifest) for authentication purposes.
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/test/data/extensions/good.crx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698