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

Unified Diff: extensions/browser/verified_contents.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 | « crypto/signature_verifier_unittest.cc ('k') | net/quic/crypto/proof_verifier_chromium.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/verified_contents.cc
diff --git a/extensions/browser/verified_contents.cc b/extensions/browser/verified_contents.cc
index 28ed16a771550f01d9b520930d7993603902c123..fc2471dc79a6c086a67ecec1e67bcbc36d9f5c89 100644
--- a/extensions/browser/verified_contents.cc
+++ b/extensions/browser/verified_contents.cc
@@ -21,14 +21,6 @@ using base::Value;
namespace {
-// Note: this structure is an ASN.1 which encodes the algorithm used with its
-// parameters. The signature algorithm is "RSA256" aka "RSASSA-PKCS-v1_5 using
-// SHA-256 hash algorithm". This is defined in PKCS #1 (RFC 3447).
-// It is encoding: { OID sha256WithRSAEncryption PARAMETERS NULL }
-const uint8_t kSignatureAlgorithm[15] = {0x30, 0x0d, 0x06, 0x09, 0x2a,
- 0x86, 0x48, 0x86, 0xf7, 0x0d,
- 0x01, 0x01, 0x0b, 0x05, 0x00};
-
const char kBlockSizeKey[] = "block_size";
const char kContentHashesKey[] = "content_hashes";
const char kDescriptionKey[] = "description";
@@ -308,7 +300,7 @@ bool VerifiedContents::VerifySignature(const std::string& protected_value,
const std::string& signature_bytes) {
crypto::SignatureVerifier signature_verifier;
if (!signature_verifier.VerifyInit(
- kSignatureAlgorithm, sizeof(kSignatureAlgorithm),
+ crypto::SignatureVerifier::RSA_PKCS1_SHA256,
reinterpret_cast<const uint8_t*>(signature_bytes.data()),
signature_bytes.size(), public_key_, public_key_size_)) {
VLOG(1) << "Could not verify signature - VerifyInit failure";
« no previous file with comments | « crypto/signature_verifier_unittest.cc ('k') | net/quic/crypto/proof_verifier_chromium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698