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

Side by Side Diff: net/cert/x509_util_openssl.cc

Issue 356713005: Rename ServerBoundCert => ChannelID to reflect the current name (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/cert/x509_util_openssl.h" 5 #include "net/cert/x509_util_openssl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <openssl/asn1.h> 8 #include <openssl/asn1.h>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 const base::Time kYear10000 = kEpoch + 204 const base::Time kYear10000 = kEpoch +
205 base::TimeDelta::FromDays(kDaysFromUnixEpochToYear10000); 205 base::TimeDelta::FromDays(kDaysFromUnixEpochToYear10000);
206 206
207 if (not_valid_before < kYear0001 || not_valid_before >= kYear10000 || 207 if (not_valid_before < kYear0001 || not_valid_before >= kYear10000 ||
208 not_valid_after < kYear0001 || not_valid_after >= kYear10000) 208 not_valid_after < kYear0001 || not_valid_after >= kYear10000)
209 return false; 209 return false;
210 210
211 return true; 211 return true;
212 } 212 }
213 213
214 bool CreateDomainBoundCertEC( 214 bool CreateChannelIDEC(
215 crypto::ECPrivateKey* key, 215 crypto::ECPrivateKey* key,
216 DigestAlgorithm alg, 216 DigestAlgorithm alg,
217 const std::string& domain, 217 const std::string& domain,
218 uint32 serial_number, 218 uint32 serial_number,
219 base::Time not_valid_before, 219 base::Time not_valid_before,
220 base::Time not_valid_after, 220 base::Time not_valid_after,
221 std::string* der_cert) { 221 std::string* der_cert) {
222 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); 222 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
223 // Create certificate. 223 // Create certificate.
224 crypto::ScopedOpenSSL<X509, X509_free> cert( 224 crypto::ScopedOpenSSL<X509, X509_free> cert(
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 x509_time->length); 345 x509_time->length);
346 346
347 CertDateFormat format = x509_time->type == V_ASN1_UTCTIME ? 347 CertDateFormat format = x509_time->type == V_ASN1_UTCTIME ?
348 CERT_DATE_FORMAT_UTC_TIME : CERT_DATE_FORMAT_GENERALIZED_TIME; 348 CERT_DATE_FORMAT_UTC_TIME : CERT_DATE_FORMAT_GENERALIZED_TIME;
349 return ParseCertificateDate(str_date, format, time); 349 return ParseCertificateDate(str_date, format, time);
350 } 350 }
351 351
352 } // namespace x509_util 352 } // namespace x509_util
353 353
354 } // namespace net 354 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698