| Index: webrtc/base/sslidentity.h
|
| diff --git a/webrtc/base/sslidentity.h b/webrtc/base/sslidentity.h
|
| index a143ee4108bc4585174e2a19838133273751a5d9..2fcd28a61dc61158fd008ac280708e8b3bf18acf 100644
|
| --- a/webrtc/base/sslidentity.h
|
| +++ b/webrtc/base/sslidentity.h
|
| @@ -125,6 +125,12 @@ static const int kRsaDefaultExponent = 0x10001; // = 2^16+1 = 65537
|
| static const int kRsaMinModSize = 1024;
|
| static const int kRsaMaxModSize = 8192;
|
|
|
| +// Certificate default validity lifetime.
|
| +static const int CERTIFICATE_LIFETIME = 60*60*24*30; // 30 days, arbitrarily
|
| +// Certificate validity window.
|
| +// This is to compensate for slightly incorrect system clocks.
|
| +static const int CERTIFICATE_WINDOW = -60*60*24;
|
| +
|
| struct RSAParams {
|
| unsigned int mod_size;
|
| unsigned int pub_exp;
|
| @@ -189,7 +195,12 @@ class SSLIdentity {
|
| // Returns NULL on failure.
|
| // Caller is responsible for freeing the returned object.
|
| static SSLIdentity* Generate(const std::string& common_name,
|
| - const KeyParams& key_param);
|
| + const KeyParams& key_param,
|
| + time_t certificate_lifetime);
|
| + static SSLIdentity* Generate(const std::string& common_name,
|
| + const KeyParams& key_param) {
|
| + return Generate(common_name, key_param, CERTIFICATE_LIFETIME);
|
| + }
|
| static SSLIdentity* Generate(const std::string& common_name,
|
| KeyType key_type) {
|
| return Generate(common_name, KeyParams(key_type));
|
|
|