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

Unified Diff: components/crx_file/crx_file.cc

Issue 1679873005: Switch SignatureVerifier to taking an algorithm enum. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix iOS build Created 4 years, 10 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 | « components/crx_file/constants.h ('k') | components/policy/core/common/cloud/cloud_policy_validator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/crx_file/crx_file.cc
diff --git a/components/crx_file/crx_file.cc b/components/crx_file/crx_file.cc
index 0bb60e0a7eca4f91d019274cb3f2f3c8abd36658..7a6240d265a1ff1997e9d70c4ef7271f5920f5c1 100644
--- a/components/crx_file/crx_file.cc
+++ b/components/crx_file/crx_file.cc
@@ -13,7 +13,6 @@
#include "base/numerics/safe_math.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
-#include "components/crx_file/constants.h"
#include "components/crx_file/id_util.h"
#include "crypto/secure_hash.h"
#include "crypto/sha2.h"
@@ -160,10 +159,9 @@ CrxFile::ValidateError CrxFile::ValidateSignature(
return ValidateError::CRX_SIGNATURE_INVALID;
crypto::SignatureVerifier verifier;
- if (!verifier.VerifyInit(
- crx_file::kSignatureAlgorithm, sizeof(crx_file::kSignatureAlgorithm),
- &signature.front(), static_cast<int>(signature.size()), &key.front(),
- static_cast<int>(key.size()))) {
+ if (!verifier.VerifyInit(crypto::SignatureVerifier::RSA_PKCS1_SHA1,
+ signature.data(), static_cast<int>(signature.size()),
+ key.data(), static_cast<int>(key.size()))) {
// Signature verification initialization failed. This is most likely
// caused by a public key in the wrong format (should encode algorithm).
return ValidateError::CRX_SIGNATURE_VERIFICATION_INITIALIZATION_FAILED;
« no previous file with comments | « components/crx_file/constants.h ('k') | components/policy/core/common/cloud/cloud_policy_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698