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

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

Issue 2342973003: Remove the externs for VerifyCertificateChain()'s errors. (Closed)
Patch Set: 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/verify_certificate_chain.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/verify_certificate_chain.cc
diff --git a/net/cert/internal/verify_certificate_chain.cc b/net/cert/internal/verify_certificate_chain.cc
index f636e88ea484c307221c7f8978125a35937136bb..8c9376bdf2de239f8dabab1edb94917b410edbc0 100644
--- a/net/cert/internal/verify_certificate_chain.cc
+++ b/net/cert/internal/verify_certificate_chain.cc
@@ -22,10 +22,40 @@
namespace net {
-using namespace verify_certificate_chain_errors;
-
namespace {
+// -----------------------------------------------
+// Errors/Warnings set by VerifyCertificateChain
+// -----------------------------------------------
+
+DEFINE_CERT_ERROR_ID(
+ kSignatureAlgorithmMismatch,
+ "Certificate.signatureAlgorithm != TBSCertificate.signature");
+DEFINE_CERT_ERROR_ID(kInvalidOrUnsupportedSignatureAlgorithm,
+ "Invalid or unsupported signature algorithm");
+DEFINE_CERT_ERROR_ID(kChainIsEmpty, "Chain is empty");
+DEFINE_CERT_ERROR_ID(kUnconsumedCriticalExtension,
+ "Unconsumed critical extension");
+DEFINE_CERT_ERROR_ID(
+ kTargetCertInconsistentCaBits,
+ "Target certificate looks like a CA but does not set all CA properties");
+DEFINE_CERT_ERROR_ID(kKeyCertSignBitNotSet, "keyCertSign bit is not set");
+DEFINE_CERT_ERROR_ID(kMaxPathLengthViolated, "max_path_length reached");
+DEFINE_CERT_ERROR_ID(kBasicConstraintsIndicatesNotCa,
+ "Basic Constraints indicates not a CA");
+DEFINE_CERT_ERROR_ID(kMissingBasicConstraints,
+ "Does not have Basic Constraints");
+DEFINE_CERT_ERROR_ID(kNotPermittedByNameConstraints,
+ "Not permitted by name constraints");
+DEFINE_CERT_ERROR_ID(kSubjectDoesNotMatchIssuer,
+ "subject does not match issuer");
+DEFINE_CERT_ERROR_ID(kVerifySignedDataFailed, "VerifySignedData failed");
+DEFINE_CERT_ERROR_ID(kValidityFailedNotAfter, "Time is after notAfter");
+DEFINE_CERT_ERROR_ID(kValidityFailedNotBefore, "Time is before notBefore");
+DEFINE_CERT_ERROR_ID(kSignatureAlgorithmsDifferentEncoding,
+ "Certificate.signatureAlgorithm is encoded differently "
+ "than TBSCertificate.signature");
+
DEFINE_CERT_ERROR_ID(kContextTrustAnchor, "Processing Trust Anchor");
DEFINE_CERT_ERROR_ID(kContextCertificate, "Processing Certificate");
@@ -593,36 +623,4 @@ bool VerifyCertificateChain(const ParsedCertificateList& certs,
return true;
}
-namespace verify_certificate_chain_errors {
-
-DEFINE_CERT_ERROR_ID(
- kSignatureAlgorithmMismatch,
- "Certificate.signatureAlgorithm != TBSCertificate.signature");
-DEFINE_CERT_ERROR_ID(kInvalidOrUnsupportedSignatureAlgorithm,
- "Invalid or unsupported signature algorithm");
-DEFINE_CERT_ERROR_ID(kChainIsEmpty, "Chain is empty");
-DEFINE_CERT_ERROR_ID(kUnconsumedCriticalExtension,
- "Unconsumed critical extension");
-DEFINE_CERT_ERROR_ID(
- kTargetCertInconsistentCaBits,
- "Target certificate looks like a CA but does not set all CA properties");
-DEFINE_CERT_ERROR_ID(kKeyCertSignBitNotSet, "keyCertSign bit is not set");
-DEFINE_CERT_ERROR_ID(kMaxPathLengthViolated, "max_path_length reached");
-DEFINE_CERT_ERROR_ID(kBasicConstraintsIndicatesNotCa,
- "Basic Constraints indicates not a CA");
-DEFINE_CERT_ERROR_ID(kMissingBasicConstraints,
- "Does not have Basic Constraints");
-DEFINE_CERT_ERROR_ID(kNotPermittedByNameConstraints,
- "Not permitted by name constraints");
-DEFINE_CERT_ERROR_ID(kSubjectDoesNotMatchIssuer,
- "subject does not match issuer");
-DEFINE_CERT_ERROR_ID(kVerifySignedDataFailed, "VerifySignedData failed");
-DEFINE_CERT_ERROR_ID(kValidityFailedNotAfter, "Time is after notAfter");
-DEFINE_CERT_ERROR_ID(kValidityFailedNotBefore, "Time is before notBefore");
-DEFINE_CERT_ERROR_ID(kSignatureAlgorithmsDifferentEncoding,
- "Certificate.signatureAlgorithm is encoded differently "
- "than TBSCertificate.signature");
-
-} // verify_certificate_chain_errors
-
} // namespace net
« no previous file with comments | « net/cert/internal/verify_certificate_chain.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698