Index: webrtc/base/opensslidentity.cc |
diff --git a/webrtc/base/opensslidentity.cc b/webrtc/base/opensslidentity.cc |
index 24b97b136e84a5f80d908fd14c6f8111d58cfa99..9c2112e157c0dc71099b57a764c58c4e48d4c28b 100644 |
--- a/webrtc/base/opensslidentity.cc |
+++ b/webrtc/base/opensslidentity.cc |
@@ -407,16 +407,18 @@ OpenSSLIdentity* OpenSSLIdentity::GenerateInternal( |
return NULL; |
} |
-OpenSSLIdentity* OpenSSLIdentity::Generate(const std::string& common_name, |
- const KeyParams& key_params, |
- time_t certificate_lifetime) { |
+OpenSSLIdentity* OpenSSLIdentity::GenerateWithExpiration( |
+ const std::string& common_name, |
+ const KeyParams& key_params, |
+ time_t certificate_lifetime) { |
SSLIdentityParams params; |
params.key_params = key_params; |
params.common_name = common_name; |
time_t now = time(NULL); |
- params.not_before = now + kCertificateWindow; |
+ params.not_before = now + kCertificateWindowInSeconds; |
params.not_after = now + certificate_lifetime; |
- RTC_DCHECK(params.not_before < params.not_after); |
+ if (params.not_before > params.not_after) |
+ return nullptr; |
perkj_webrtc
2016/03/31 13:01:41
RTC_CHECK(... ) ?
torbjorng (webrtc)
2016/03/31 13:58:18
I removed the RTC_CHECK here since it would not be
|
return GenerateInternal(params); |
} |