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

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

Issue 1690123002: Reduce Certificate Parsing Strictness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing tests. 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
Index: net/cert/internal/signature_algorithm.cc
diff --git a/net/cert/internal/signature_algorithm.cc b/net/cert/internal/signature_algorithm.cc
index 23812546e366a954cd1f4d435f031d386e7671b2..e9253b23b9a267297e30e7ed2b8b765fb6cf7a85 100644
--- a/net/cert/internal/signature_algorithm.cc
+++ b/net/cert/internal/signature_algorithm.cc
@@ -226,7 +226,8 @@ WARN_UNUSED_RESULT bool IsNull(const der::Input& input) {
// Returns a nullptr on failure.
//
// RFC 5912 requires that the parameters for RSA PKCS#1 v1.5 algorithms be NULL
-// ("PARAMS TYPE NULL ARE required"):
+// ("PARAMS TYPE NULL ARE required"), however due to some non-compliance, we
eroman 2016/02/12 21:09:44 Can this be re-phrased without using a pronoun? Se
svaldez 2016/02/12 22:00:11 Done.
+// also accept empty parameters:
//
// sa-rsaWithSHA1 SIGNATURE-ALGORITHM ::= {
// IDENTIFIER sha1WithRSAEncryption
@@ -261,7 +262,7 @@ WARN_UNUSED_RESULT bool IsNull(const der::Input& input) {
// }
scoped_ptr<SignatureAlgorithm> ParseRsaPkcs1(DigestAlgorithm digest,
const der::Input& params) {
- if (!IsNull(params))
+ if (!IsNull(params) && !IsEmpty(params))
return nullptr;
return SignatureAlgorithm::CreateRsaPkcs1(digest);
« no previous file with comments | « no previous file | net/cert/internal/signature_algorithm_unittest.cc » ('j') | net/cert/internal/signature_algorithm_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698