 Chromium Code Reviews
 Chromium Code Reviews Issue 1329493005:
  Provide RSA2048 as per RFC  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master
    
  
    Issue 1329493005:
  Provide RSA2048 as per RFC  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 
| 3 * | 3 * | 
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license | 
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source | 
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found | 
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may | 
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. | 
| 9 */ | 9 */ | 
| 10 | 10 | 
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 namespace rtc { | 25 namespace rtc { | 
| 26 | 26 | 
| 27 // OpenSSLKeyPair encapsulates an OpenSSL EVP_PKEY* keypair object, | 27 // OpenSSLKeyPair encapsulates an OpenSSL EVP_PKEY* keypair object, | 
| 28 // which is reference counted inside the OpenSSL library. | 28 // which is reference counted inside the OpenSSL library. | 
| 29 class OpenSSLKeyPair { | 29 class OpenSSLKeyPair { | 
| 30 public: | 30 public: | 
| 31 explicit OpenSSLKeyPair(EVP_PKEY* pkey) : pkey_(pkey) { | 31 explicit OpenSSLKeyPair(EVP_PKEY* pkey) : pkey_(pkey) { | 
| 32 ASSERT(pkey_ != NULL); | 32 ASSERT(pkey_ != NULL); | 
| 33 } | 33 } | 
| 34 | 34 | 
| 35 static OpenSSLKeyPair* Generate(const KeyParams& key_params); | |
| 35 static OpenSSLKeyPair* Generate(KeyType key_type); | 36 static OpenSSLKeyPair* Generate(KeyType key_type); | 
| 36 | 37 | 
| 37 virtual ~OpenSSLKeyPair(); | 38 virtual ~OpenSSLKeyPair(); | 
| 38 | 39 | 
| 39 virtual OpenSSLKeyPair* GetReference(); | 40 virtual OpenSSLKeyPair* GetReference(); | 
| 40 | 41 | 
| 41 EVP_PKEY* pkey() const { return pkey_; } | 42 EVP_PKEY* pkey() const { return pkey_; } | 
| 42 | 43 | 
| 43 private: | 44 private: | 
| 44 void AddReference(); | 45 void AddReference(); | 
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 X509* x509_; | 94 X509* x509_; | 
| 94 | 95 | 
| 95 RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLCertificate); | 96 RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLCertificate); | 
| 96 }; | 97 }; | 
| 97 | 98 | 
| 98 // Holds a keypair and certificate together, and a method to generate | 99 // Holds a keypair and certificate together, and a method to generate | 
| 99 // them consistently. | 100 // them consistently. | 
| 100 class OpenSSLIdentity : public SSLIdentity { | 101 class OpenSSLIdentity : public SSLIdentity { | 
| 101 public: | 102 public: | 
| 102 static OpenSSLIdentity* Generate(const std::string& common_name, | 103 static OpenSSLIdentity* Generate(const std::string& common_name, | 
| 104 const KeyParams& key_params); | |
| 105 static OpenSSLIdentity* Generate(const std::string& common_name, | |
| 103 KeyType key_type); | 106 KeyType key_type); | 
| 
hbos
2015/10/05 15:17:05
You forgot to remove this one now that SSLIdentity
 
torbjorng (webrtc)
2015/10/05 16:16:49
Done.
 | |
| 104 static OpenSSLIdentity* GenerateForTest(const SSLIdentityParams& params); | 107 static OpenSSLIdentity* GenerateForTest(const SSLIdentityParams& params); | 
| 105 static SSLIdentity* FromPEMStrings(const std::string& private_key, | 108 static SSLIdentity* FromPEMStrings(const std::string& private_key, | 
| 106 const std::string& certificate); | 109 const std::string& certificate); | 
| 107 ~OpenSSLIdentity() override; | 110 ~OpenSSLIdentity() override; | 
| 108 | 111 | 
| 109 const OpenSSLCertificate& certificate() const override; | 112 const OpenSSLCertificate& certificate() const override; | 
| 110 OpenSSLIdentity* GetReference() const override; | 113 OpenSSLIdentity* GetReference() const override; | 
| 111 | 114 | 
| 112 // Configure an SSL context object to use our key and certificate. | 115 // Configure an SSL context object to use our key and certificate. | 
| 113 bool ConfigureIdentity(SSL_CTX* ctx); | 116 bool ConfigureIdentity(SSL_CTX* ctx); | 
| 114 | 117 | 
| 115 private: | 118 private: | 
| 116 OpenSSLIdentity(OpenSSLKeyPair* key_pair, OpenSSLCertificate* certificate); | 119 OpenSSLIdentity(OpenSSLKeyPair* key_pair, OpenSSLCertificate* certificate); | 
| 117 | 120 | 
| 118 static OpenSSLIdentity* GenerateInternal(const SSLIdentityParams& params); | 121 static OpenSSLIdentity* GenerateInternal(const SSLIdentityParams& params); | 
| 119 | 122 | 
| 120 scoped_ptr<OpenSSLKeyPair> key_pair_; | 123 scoped_ptr<OpenSSLKeyPair> key_pair_; | 
| 121 scoped_ptr<OpenSSLCertificate> certificate_; | 124 scoped_ptr<OpenSSLCertificate> certificate_; | 
| 122 | 125 | 
| 123 RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLIdentity); | 126 RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLIdentity); | 
| 124 }; | 127 }; | 
| 125 | 128 | 
| 126 | 129 | 
| 127 } // namespace rtc | 130 } // namespace rtc | 
| 128 | 131 | 
| 129 #endif // WEBRTC_BASE_OPENSSLIDENTITY_H_ | 132 #endif // WEBRTC_BASE_OPENSSLIDENTITY_H_ | 
| OLD | NEW |