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

Unified Diff: net/cert/internal/signature_algorithm.cc

Issue 1223763002: Recognize the legacy OID 1.3.14.3.2.29 (sha1WithRSASignature) as equivalent to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sign_parse_alg
Patch Set: rebase Created 5 years, 5 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 | « no previous file | net/cert/internal/signature_algorithm_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/signature_algorithm.cc
diff --git a/net/cert/internal/signature_algorithm.cc b/net/cert/internal/signature_algorithm.cc
index 0ef171d72bb3d08f7a739185b9663afa17add123..62d50eaf0f60d66ace3c0b40b06d34414ca5c87f 100644
--- a/net/cert/internal/signature_algorithm.cc
+++ b/net/cert/internal/signature_algorithm.cc
@@ -21,6 +21,20 @@ namespace {
const uint8_t kOidSha1WithRsaEncryption[] =
{0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05};
+// sha1WithRSASignature is a deprecated equivalent of
+// sha1WithRSAEncryption.
+//
+// It originates from the NIST Open Systems Environment (OSE)
+// Implementor's Workshop (OIW).
+//
+// It is supported for compatibility with Microsoft's certificate APIs and
+// tools, particularly makecert.exe, which default(ed/s) to this OID for SHA-1.
+//
+// See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1042479
+//
+// In dotted notation: 1.3.14.3.2.29
+const uint8_t kOidSha1WithRsaSignature[] = {0x2b, 0x0e, 0x03, 0x02, 0x1d};
+
// From RFC 5912:
//
// pkcs-1 OBJECT IDENTIFIER ::=
@@ -296,6 +310,9 @@ scoped_ptr<SignatureAlgorithm> SignatureAlgorithm::CreateFromDer(
// TODO(eroman): Add parsing of RSASSA-PSS
+ if (oid.Equals(der::Input(kOidSha1WithRsaSignature)))
+ return ParseRsaPkcs1(DigestAlgorithm::Sha1, params);
+
return nullptr; // Unsupported OID.
}
« no previous file with comments | « no previous file | net/cert/internal/signature_algorithm_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698