| Index: webrtc/base/opensslidentity.cc
|
| diff --git a/webrtc/base/opensslidentity.cc b/webrtc/base/opensslidentity.cc
|
| index de4e6a771e04f5f0c1924ba83313f790a16988a2..db61531c26c2173f3cfcd217bf052a4c76d8fbc6 100644
|
| --- a/webrtc/base/opensslidentity.cc
|
| +++ b/webrtc/base/opensslidentity.cc
|
| @@ -33,9 +33,6 @@ namespace rtc {
|
| // We could have exposed a myriad of parameters for the crypto stuff,
|
| // but keeping it simple seems best.
|
|
|
| -// Strength of generated keys. Those are RSA.
|
| -static const int KEY_LENGTH = 1024;
|
| -
|
| // Random bits for certificate serial number
|
| static const int SERIAL_RAND_BITS = 64;
|
|
|
| @@ -49,12 +46,13 @@ static const int CERTIFICATE_WINDOW = -60*60*24;
|
| static EVP_PKEY* MakeKey(KeyType key_type) {
|
| LOG(LS_INFO) << "Making key pair";
|
| EVP_PKEY* pkey = EVP_PKEY_new();
|
| - if (key_type == KT_RSA) {
|
| + if (key_type == KT_RSA1024 || key_type == KT_RSA2048) {
|
| + int key_length = key_type == KT_RSA1024 ? 1024 : 2048;
|
| BIGNUM* exponent = BN_new();
|
| RSA* rsa = RSA_new();
|
| if (!pkey || !exponent || !rsa ||
|
| !BN_set_word(exponent, 0x10001) || // 65537 RSA exponent
|
| - !RSA_generate_key_ex(rsa, KEY_LENGTH, exponent, NULL) ||
|
| + !RSA_generate_key_ex(rsa, key_length, exponent, NULL) ||
|
| !EVP_PKEY_assign_RSA(pkey, rsa)) {
|
| EVP_PKEY_free(pkey);
|
| BN_free(exponent);
|
|
|