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

Unified Diff: net/cert/internal/parse_certificate.h

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/cert_issuer_source_static_unittest.cc ('k') | net/cert/internal/parse_certificate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/parse_certificate.h
diff --git a/net/cert/internal/parse_certificate.h b/net/cert/internal/parse_certificate.h
index 13409dc3be54896d4287629f933a9be90d269e5c..2277a4e8efc05b7b9418be37ae2a116154987c42 100644
--- a/net/cert/internal/parse_certificate.h
+++ b/net/cert/internal/parse_certificate.h
@@ -17,6 +17,7 @@
namespace net {
+class CertErrors;
struct ParsedTbsCertificate;
// Returns true if the given serial number (CertificateSerialNumber in RFC 5280)
@@ -55,14 +56,17 @@ struct NET_EXPORT ParseCertificateOptions {
};
// Parses a DER-encoded "Certificate" as specified by RFC 5280. Returns true on
-// success and sets the results in the |out_*| parameters.
+// success and sets the results in the |out_*| parameters. On both the failure
+// and success case, if |out_errors| was non-null it may contain extra error
+// information.
//
// Note that on success the out parameters alias data from the input
// |certificate_tlv|. Hence the output values are only valid as long as
// |certificate_tlv| remains valid.
//
-// On failure the out parameters have an undefined state. Some of them may have
-// been updated during parsing, whereas others may not have been changed.
+// On failure the out parameters have an undefined state, except for
+// out_errors. Some of them may have been updated during parsing, whereas
+// others may not have been changed.
//
// The out parameters represent each field of the Certificate SEQUENCE:
// Certificate ::= SEQUENCE {
@@ -91,8 +95,8 @@ struct NET_EXPORT ParseCertificateOptions {
NET_EXPORT bool ParseCertificate(const der::Input& certificate_tlv,
der::Input* out_tbs_certificate_tlv,
der::Input* out_signature_algorithm_tlv,
- der::BitString* out_signature_value)
- WARN_UNUSED_RESULT;
+ der::BitString* out_signature_value,
+ CertErrors* out_errors) WARN_UNUSED_RESULT;
// Parses a DER-encoded "TBSCertificate" as specified by RFC 5280. Returns true
// on success and sets the results in |out|. Certain invalid inputs may
« no previous file with comments | « net/cert/internal/cert_issuer_source_static_unittest.cc ('k') | net/cert/internal/parse_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698