Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: talk/app/webrtc/peerconnectioninterface.h

Issue 1151943005: Ability to specify KeyType (RSA, ECDSA) for SSLIdentity generation in libjingle (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressing ASAN, LSAN issues in unittests Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/peerconnectioninterface.h
diff --git a/talk/app/webrtc/peerconnectioninterface.h b/talk/app/webrtc/peerconnectioninterface.h
index 3e4cb556fb5f51826734c719a5cf3f6e46bc36e8..ea131872585bba120c32b53e869c407a2943c922 100644
--- a/talk/app/webrtc/peerconnectioninterface.h
+++ b/talk/app/webrtc/peerconnectioninterface.h
@@ -79,6 +79,7 @@
#include "talk/app/webrtc/umametrics.h"
#include "webrtc/base/fileutils.h"
#include "webrtc/base/network.h"
+#include "webrtc/base/sslidentity.h"
#include "webrtc/base/sslstreamadapter.h"
#include "webrtc/base/socketaddress.h"
@@ -95,6 +96,7 @@ class WebRtcVideoEncoderFactory;
namespace webrtc {
class AudioDeviceModule;
+class DtlsIdentityStoreInterface;
class MediaConstraintsInterface;
// MediaStream container interface.
@@ -458,53 +460,6 @@ class PortAllocatorFactoryInterface : public rtc::RefCountInterface {
~PortAllocatorFactoryInterface() {}
};
-// Used to receive callbacks of DTLS identity requests.
-class DTLSIdentityRequestObserver : public rtc::RefCountInterface {
hbos 2015/06/12 12:46:55 Moved to dtlsidentitystore.h (and renamed DTLS ->
- public:
- virtual void OnFailure(int error) = 0;
- // TODO(jiayl): Unify the OnSuccess method once Chrome code is updated.
- virtual void OnSuccess(const std::string& der_cert,
- const std::string& der_private_key) = 0;
- // |identity| is a scoped_ptr because rtc::SSLIdentity is not copyable and the
- // client has to get the ownership of the object to make use of it.
- virtual void OnSuccessWithIdentityObj(
- rtc::scoped_ptr<rtc::SSLIdentity> identity) = 0;
-
- protected:
- virtual ~DTLSIdentityRequestObserver() {}
-};
-
-class DTLSIdentityServiceInterface {
hbos 2015/06/12 12:46:55 Nuked.
- public:
- // Asynchronously request a DTLS identity, including a self-signed certificate
- // and the private key used to sign the certificate, from the identity store
- // for the given identity name.
- // DTLSIdentityRequestObserver::OnSuccess will be called with the identity if
- // the request succeeded; DTLSIdentityRequestObserver::OnFailure will be
- // called with an error code if the request failed.
- //
- // Only one request can be made at a time. If a second request is called
- // before the first one completes, RequestIdentity will abort and return
- // false.
- //
- // |identity_name| is an internal name selected by the client to identify an
- // identity within an origin. E.g. an web site may cache the certificates used
- // to communicate with differnent peers under different identity names.
- //
- // |common_name| is the common name used to generate the certificate. If the
- // certificate already exists in the store, |common_name| is ignored.
- //
- // |observer| is the object to receive success or failure callbacks.
- //
- // Returns true if either OnFailure or OnSuccess will be called.
- virtual bool RequestIdentity(
- const std::string& identity_name,
- const std::string& common_name,
- DTLSIdentityRequestObserver* observer) = 0;
-
- virtual ~DTLSIdentityServiceInterface() {}
-};
-
// PeerConnectionFactoryInterface is the factory interface use for creating
// PeerConnection, MediaStream and media tracks.
// PeerConnectionFactoryInterface will create required libjingle threads,
@@ -546,8 +501,9 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
const PeerConnectionInterface::RTCConfiguration& configuration,
const MediaConstraintsInterface* constraints,
PortAllocatorFactoryInterface* allocator_factory,
- DTLSIdentityServiceInterface* dtls_identity_service,
- PeerConnectionObserver* observer) = 0;
+ PeerConnectionObserver* observer,
+ DtlsIdentityStoreInterface* dtls_identity_store,
+ rtc::KeyType key_type = rtc::KT_DEFAULT) = 0;
// TODO(mallinath) : Remove below versions after clients are updated
// to above method.
@@ -560,12 +516,13 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
const PeerConnectionInterface::IceServers& servers,
const MediaConstraintsInterface* constraints,
PortAllocatorFactoryInterface* allocator_factory,
- DTLSIdentityServiceInterface* dtls_identity_service,
- PeerConnectionObserver* observer) {
+ PeerConnectionObserver* observer,
+ DtlsIdentityStoreInterface* dtls_identity_store,
+ rtc::KeyType key_type = rtc::KT_DEFAULT) {
PeerConnectionInterface::RTCConfiguration rtc_config;
rtc_config.servers = servers;
return CreatePeerConnection(rtc_config, constraints, allocator_factory,
- dtls_identity_service, observer);
+ observer, dtls_identity_store, key_type);
}
virtual rtc::scoped_refptr<MediaStreamInterface>

Powered by Google App Engine
This is Rietveld 408576698