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

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

Issue 2327973002: Add CertErrors* parameter to the main Certificate parsing functions. (Closed)
Patch Set: StringPiece is kind of dangerous... Created 4 years, 3 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 | « net/cert/internal/test_helpers.cc ('k') | net/cert/internal/verify_certificate_chain_pkits_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/trust_store_nss.cc
diff --git a/net/cert/internal/trust_store_nss.cc b/net/cert/internal/trust_store_nss.cc
index b5b8ab624500fc99c6b616688bee39670c64926d..1a01875ecdfcced55049df537806cf7e0e5b5c57 100644
--- a/net/cert/internal/trust_store_nss.cc
+++ b/net/cert/internal/trust_store_nss.cc
@@ -13,6 +13,7 @@
#include "base/memory/weak_ptr.h"
#include "base/task_runner.h"
#include "crypto/nss_util.h"
+#include "net/cert/internal/cert_errors.h"
#include "net/cert/internal/parsed_certificate.h"
// TODO(mattm): structure so that supporting ChromeOS multi-profile stuff is
@@ -56,13 +57,13 @@ void GetAnchors(const scoped_refptr<ParsedCertificate>& cert,
if ((SEC_GET_TRUST_FLAGS(&trust, trust_type) & ca_trust) != ca_trust)
continue;
- scoped_refptr<ParsedCertificate> anchor_cert =
- ParsedCertificate::CreateFromCertificateData(
- node->cert->derCert.data, node->cert->derCert.len,
- ParsedCertificate::DataSource::INTERNAL_COPY, {});
+ CertErrors errors;
+ scoped_refptr<ParsedCertificate> anchor_cert = ParsedCertificate::Create(
+ node->cert->derCert.data, node->cert->derCert.len, {}, &errors);
if (!anchor_cert) {
- // TODO(mattm): return errors better.
- LOG(ERROR) << "error parsing issuer certificate";
+ // TODO(crbug.com/634443): return errors better.
+ LOG(ERROR) << "Error parsing issuer certificate:\n"
+ << errors.ToDebugString();
continue;
}
« no previous file with comments | « net/cert/internal/test_helpers.cc ('k') | net/cert/internal/verify_certificate_chain_pkits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698