| Index: net/cert/x509_util_openssl.cc
|
| diff --git a/net/cert/x509_util_openssl.cc b/net/cert/x509_util_openssl.cc
|
| index 2e52221e704bb69cae6d43cbaceaf36ee8126cf2..829c5fe452c088d1e23d0c69cbc73118980664ed 100644
|
| --- a/net/cert/x509_util_openssl.cc
|
| +++ b/net/cert/x509_util_openssl.cc
|
| @@ -88,13 +88,14 @@ X509* CreateCertificate(EVP_PKEY* key,
|
| static_cast<int>(common_name.size() - kCommonNamePrefixLen);
|
|
|
| crypto::ScopedOpenSSL<X509_NAME, X509_NAME_free> name(X509_NAME_new());
|
| - if (!name.get() || !X509_NAME_add_entry_by_NID(name.get(),
|
| - NID_commonName,
|
| - MBSTRING_ASC,
|
| - common_name_str,
|
| - common_name_len,
|
| - -1,
|
| - 0)) {
|
| + if (!name.get() ||
|
| + !X509_NAME_add_entry_by_NID(name.get(),
|
| + NID_commonName,
|
| + MBSTRING_ASC,
|
| + common_name_str,
|
| + common_name_len,
|
| + -1,
|
| + 0)) {
|
| LOG(ERROR) << "Can't parse common name: " << common_name.c_str();
|
| return NULL;
|
| }
|
| @@ -199,10 +200,10 @@ bool IsSupportedValidityRange(base::Time not_valid_before,
|
| const int64 kDaysFromYear0001ToUnixEpoch = 719162;
|
| const int64 kDaysFromUnixEpochToYear10000 = 2932896 + 1;
|
| const base::Time kEpoch = base::Time::UnixEpoch();
|
| - const base::Time kYear0001 = kEpoch -
|
| - base::TimeDelta::FromDays(kDaysFromYear0001ToUnixEpoch);
|
| - const base::Time kYear10000 = kEpoch +
|
| - base::TimeDelta::FromDays(kDaysFromUnixEpochToYear10000);
|
| + const base::Time kYear0001 =
|
| + kEpoch - base::TimeDelta::FromDays(kDaysFromYear0001ToUnixEpoch);
|
| + const base::Time kYear10000 =
|
| + kEpoch + base::TimeDelta::FromDays(kDaysFromUnixEpochToYear10000);
|
|
|
| if (not_valid_before < kYear0001 || not_valid_before >= kYear10000 ||
|
| not_valid_after < kYear0001 || not_valid_after >= kYear10000)
|
| @@ -211,14 +212,13 @@ bool IsSupportedValidityRange(base::Time not_valid_before,
|
| return true;
|
| }
|
|
|
| -bool CreateDomainBoundCertEC(
|
| - crypto::ECPrivateKey* key,
|
| - DigestAlgorithm alg,
|
| - const std::string& domain,
|
| - uint32 serial_number,
|
| - base::Time not_valid_before,
|
| - base::Time not_valid_after,
|
| - std::string* der_cert) {
|
| +bool CreateDomainBoundCertEC(crypto::ECPrivateKey* key,
|
| + DigestAlgorithm alg,
|
| + const std::string& domain,
|
| + uint32 serial_number,
|
| + base::Time not_valid_before,
|
| + base::Time not_valid_after,
|
| + std::string* der_cert) {
|
| crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
|
| // Create certificate.
|
| crypto::ScopedOpenSSL<X509, X509_free> cert(
|
| @@ -330,16 +330,16 @@ bool ParsePrincipalValueByNID(X509_NAME* name, int nid, std::string* value) {
|
| }
|
|
|
| bool ParseDate(ASN1_TIME* x509_time, base::Time* time) {
|
| - if (!x509_time ||
|
| - (x509_time->type != V_ASN1_UTCTIME &&
|
| - x509_time->type != V_ASN1_GENERALIZEDTIME))
|
| + if (!x509_time || (x509_time->type != V_ASN1_UTCTIME &&
|
| + x509_time->type != V_ASN1_GENERALIZEDTIME))
|
| return false;
|
|
|
| base::StringPiece str_date(reinterpret_cast<const char*>(x509_time->data),
|
| x509_time->length);
|
|
|
| - CertDateFormat format = x509_time->type == V_ASN1_UTCTIME ?
|
| - CERT_DATE_FORMAT_UTC_TIME : CERT_DATE_FORMAT_GENERALIZED_TIME;
|
| + CertDateFormat format = x509_time->type == V_ASN1_UTCTIME
|
| + ? CERT_DATE_FORMAT_UTC_TIME
|
| + : CERT_DATE_FORMAT_GENERALIZED_TIME;
|
| return ParseCertificateDate(str_date, format, time);
|
| }
|
|
|
|
|