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

Unified Diff: net/cert/cert_verify_proc_nss.cc

Issue 2760723002: Check X509Certificate::CreateFromHandle result. (Closed)
Patch Set: 2nd round of updates Created 3 years, 9 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/cert_verify_proc_nss.cc
diff --git a/net/cert/cert_verify_proc_nss.cc b/net/cert/cert_verify_proc_nss.cc
index 27558f79d36a4a73e1010cf975d53357b083e47f..1347dc41413cf2cf544b0378c5b6c6ac6b17abd5 100644
--- a/net/cert/cert_verify_proc_nss.cc
+++ b/net/cert/cert_verify_proc_nss.cc
@@ -195,8 +195,13 @@ void GetCertChainInfo(CERTCertList* cert_list,
if (root_cert)
verified_chain.push_back(root_cert);
- verify_result->verified_cert =
+
+ scoped_refptr<X509Certificate> verified_cert_with_chain =
X509Certificate::CreateFromHandle(verified_cert, verified_chain);
+ if (verified_cert_with_chain)
+ verify_result->verified_cert = std::move(verified_cert_with_chain);
+ else
+ verify_result->cert_status |= CERT_STATUS_INVALID;
}
// IsKnownRoot returns true if the given certificate is one that we believe

Powered by Google App Engine
This is Rietveld 408576698