Chromium Code Reviews| Index: webrtc/base/fakesslidentity.h |
| diff --git a/webrtc/base/fakesslidentity.h b/webrtc/base/fakesslidentity.h |
| index 69d590b5eb8fcd42483c5dd6cffa6821b4b99c3d..659135f398d41265e4f6baa8202cb93797297157 100644 |
| --- a/webrtc/base/fakesslidentity.h |
| +++ b/webrtc/base/fakesslidentity.h |
| @@ -25,9 +25,11 @@ class FakeSSLCertificate : public rtc::SSLCertificate { |
| // SHA-1 is the default digest algorithm because it is available in all build |
| // configurations used for unit testing. |
| explicit FakeSSLCertificate(const std::string& data) |
| - : data_(data), digest_algorithm_(DIGEST_SHA_1) {} |
| + : data_(data), digest_algorithm_(DIGEST_SHA_1), expiration_time_(-1) {} |
| explicit FakeSSLCertificate(const std::vector<std::string>& certs) |
| - : data_(certs.front()), digest_algorithm_(DIGEST_SHA_1) { |
| + : data_(certs.front()), |
| + digest_algorithm_(DIGEST_SHA_1), |
| + expiration_time_(-1) { |
| std::vector<std::string>::const_iterator it; |
| // Skip certs[0]. |
| for (it = certs.begin() + 1; it != certs.end(); ++it) { |
| @@ -45,7 +47,12 @@ class FakeSSLCertificate : public rtc::SSLCertificate { |
| VERIFY(SSLIdentity::PemToDer(kPemTypeCertificate, data_, &der_string)); |
| der_buffer->SetData(der_string.c_str(), der_string.size()); |
| } |
| - int64_t CertificateExpirationTime() const override { return -1; } |
| + int64_t CertificateExpirationTime() const override { |
| + return expiration_time_; |
| + } |
| + void SetCertificateExpirationTime(int64_t expiration_time) { |
| + expiration_time_ = expiration_time; |
| + } |
| void set_digest_algorithm(const std::string& algorithm) { |
| digest_algorithm_ = algorithm; |
| } |
| @@ -79,6 +86,7 @@ class FakeSSLCertificate : public rtc::SSLCertificate { |
| std::string data_; |
| std::vector<FakeSSLCertificate> certs_; |
| std::string digest_algorithm_; |
| + int64_t expiration_time_; |
|
torbjorng (webrtc)
2015/12/07 14:53:26
nit: Please add comment about unit (seconds?)
hbos
2015/12/07 15:59:36
Done.
|
| }; |
| class FakeSSLIdentity : public rtc::SSLIdentity { |