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

Unified Diff: webrtc/p2p/base/jseptransport.h

Issue 2770903003: Accept remote offers with current DTLS role, rather than "actpass". (Closed)
Patch Set: Adding link to spec and section number. Created 3 years, 9 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
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel_unittest.cc ('k') | webrtc/p2p/base/jseptransport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/jseptransport.h
diff --git a/webrtc/p2p/base/jseptransport.h b/webrtc/p2p/base/jseptransport.h
index e29dd0d02ae743b60b51627c9f32679117280b7c..7b81be06f6307c366b092c8153f4eaf91b436f76 100644
--- a/webrtc/p2p/base/jseptransport.h
+++ b/webrtc/p2p/base/jseptransport.h
@@ -298,7 +298,9 @@ class JsepTransport : public sigslot::has_slots<> {
// changed ufrag/password).
bool NeedsIceRestart() const;
- void GetSslRole(rtc::SSLRole* ssl_role) const;
+ // Returns role if negotiated, or empty Optional if it hasn't been negotiated
+ // yet.
+ rtc::Optional<rtc::SSLRole> GetSslRole() const;
// TODO(deadbeef): Make this const. See comment in transportcontroller.h.
bool GetStats(TransportStats* stats);
@@ -325,22 +327,21 @@ class JsepTransport : public sigslot::has_slots<> {
const rtc::SSLFingerprint* fingerprint,
std::string* error_desc) const;
- // Negotiates the SSL role based off the offer and answer as specified by
- // RFC 4145, section-4.1. Returns false if the SSL role cannot be determined
- // from the local description and remote description.
- bool NegotiateRole(ContentAction local_role,
- rtc::SSLRole* ssl_role,
- std::string* error_desc) const;
-
private:
// Negotiates the transport parameters based on the current local and remote
// transport description, such as the ICE role to use, and whether DTLS
// should be activated.
//
// Called when an answer TransportDescription is applied.
- bool NegotiateTransportDescription(ContentAction local_role,
+ bool NegotiateTransportDescription(ContentAction local_description_type,
std::string* error_desc);
+ // Negotiates the SSL role based off the offer and answer as specified by
+ // RFC 4145, section-4.1. Returns false if the SSL role cannot be determined
+ // from the local description and remote description.
+ bool NegotiateRole(ContentAction local_description_type,
+ std::string* error_desc);
+
// Pushes down the transport parameters from the local description, such
// as the ICE ufrag and pwd.
bool ApplyLocalTransportDescription(DtlsTransportInternal* dtls_transport,
@@ -360,7 +361,7 @@ class JsepTransport : public sigslot::has_slots<> {
// needs-ice-restart bit as described in JSEP.
bool needs_ice_restart_ = false;
rtc::scoped_refptr<rtc::RTCCertificate> certificate_;
- rtc::SSLRole secure_role_ = rtc::SSL_CLIENT;
+ rtc::Optional<rtc::SSLRole> ssl_role_;
std::unique_ptr<rtc::SSLFingerprint> remote_fingerprint_;
std::unique_ptr<TransportDescription> local_description_;
std::unique_ptr<TransportDescription> remote_description_;
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel_unittest.cc ('k') | webrtc/p2p/base/jseptransport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698