Changeset 249798 in webkit


Ignore:
Timestamp:
Sep 11, 2019 11:51:46 PM (5 years ago)
Author:
youenn@apple.com
Message:

Source/ThirdParty/libwebrtc:
Disable DTLS1.0
https://bugs.webkit.org/show_bug.cgi?id=201679

Reviewed by Alex Christensen.

  • Source/webrtc/rtc_base/opensslstreamadapter.cc:

Set minimum version to DTLS1.2 when DTLS1.2 is supported.
This makes sure any client will never downgrade to DTLS1.0.

Source/WebCore:
Disable DTLS1.0
https://bugs.webkit.org/show_bug.cgi?id=201679

Reviewed by Alex Christensen.

Add an option to force to use DTLS1.0 and nothing else.
Add internals API to enter in that mode to verify that normal configurations cannot communicate with DTLS1.0.

Test: webrtc/datachannel/dtls10.html

  • platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:

(WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
(WebCore::LibWebRTCProvider::setUseDTLS10):

  • platform/mediastream/libwebrtc/LibWebRTCProvider.h:
  • testing/Internals.cpp:

(WebCore::Internals::setUseDTLS10):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:
Disable DTLS10
https://bugs.webkit.org/show_bug.cgi?id=201679

Reviewed by Alex Christensen.

  • webrtc/datachannel/dtls10-expected.txt: Added.
  • webrtc/datachannel/dtls10.html: Added.
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r249787 r249798  
     12019-09-11  Youenn Fablet  <youenn@apple.com>
     2
     3        Disable DTLS10
     4        https://bugs.webkit.org/show_bug.cgi?id=201679
     5
     6        Reviewed by Alex Christensen.
     7
     8        * webrtc/datachannel/dtls10-expected.txt: Added.
     9        * webrtc/datachannel/dtls10.html: Added.
     10
    1112019-09-11  Saam Barati  <sbarati@apple.com>
    212
  • trunk/Source/ThirdParty/libwebrtc/ChangeLog

    r249312 r249798  
     12019-09-11  Youenn Fablet  <youenn@apple.com>
     2
     3        Disable DTLS1.0
     4        https://bugs.webkit.org/show_bug.cgi?id=201679
     5
     6        Reviewed by Alex Christensen.
     7
     8        * Source/webrtc/rtc_base/opensslstreamadapter.cc:
     9        Set minimum version to DTLS1.2 when DTLS1.2 is supported.
     10        This makes sure any client will never downgrade to DTLS1.0.
     11
    1122019-08-29  Keith Rollin  <krollin@apple.com>
    213
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/opensslstreamadapter.cc

    r238967 r249798  
    10321032    case SSL_PROTOCOL_TLS_12:
    10331033    default:
     1034#if defined(WEBRTC_WEBKIT_BUILD)
     1035      SSL_CTX_set_min_proto_version(
     1036          ctx, ssl_mode_ == SSL_MODE_DTLS ? DTLS1_2_VERSION : TLS1_2_VERSION);
     1037#endif
    10341038      SSL_CTX_set_max_proto_version(
    10351039          ctx, ssl_mode_ == SSL_MODE_DTLS ? DTLS1_2_VERSION : TLS1_2_VERSION);
  • trunk/Source/WebCore/ChangeLog

    r249795 r249798  
     12019-09-11  Youenn Fablet  <youenn@apple.com>
     2
     3        Disable DTLS1.0
     4        https://bugs.webkit.org/show_bug.cgi?id=201679
     5
     6        Reviewed by Alex Christensen.
     7
     8        Add an option to force to use DTLS1.0 and nothing else.
     9        Add internals API to enter in that mode to verify that normal configurations cannot communicate with DTLS1.0.
     10
     11        Test: webrtc/datachannel/dtls10.html
     12
     13        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
     14        (WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
     15        (WebCore::LibWebRTCProvider::setUseDTLS10):
     16        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
     17        * testing/Internals.cpp:
     18        (WebCore::Internals::setUseDTLS10):
     19        * testing/Internals.h:
     20        * testing/Internals.idl:
     21
    1222019-09-11  Keith Rollin  <krollin@apple.com>
    223
  • trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp

    r248846 r249798  
    307307    webrtc::PeerConnectionFactoryInterface::Options options;
    308308    options.disable_encryption = !enableWebRTCEncryption;
     309    options.ssl_max_version = m_useDTLS10 ? rtc::SSL_PROTOCOL_DTLS_10 : rtc::SSL_PROTOCOL_DTLS_12;
     310    m_factory->SetOptions(options);
     311}
     312
     313void LibWebRTCProvider::setUseDTLS10(bool useDTLS10)
     314{
     315    m_useDTLS10 = useDTLS10;
     316
     317    auto* factory = this->factory();
     318    if (!factory)
     319        return;
     320
     321    webrtc::PeerConnectionFactoryInterface::Options options;
     322    options.ssl_max_version = useDTLS10 ? rtc::SSL_PROTOCOL_DTLS_10 : rtc::SSL_PROTOCOL_DTLS_12;
    309323    m_factory->SetOptions(options);
    310324}
  • trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h

    r248762 r249798  
    119119    void setEnableLogging(bool);
    120120    void setEnableWebRTCEncryption(bool);
     121    void setUseDTLS10(bool);
    121122
    122123    virtual std::unique_ptr<rtc::PacketSocketFactory> createSocketFactory(PAL::SessionID, String&& /* userAgent */) { return nullptr; }
     
    139140    bool m_supportsVP8 { false };
    140141    bool m_enableLogging { true };
     142    bool m_useDTLS10 { false };
    141143#endif
    142144};
  • trunk/Source/WebCore/testing/Internals.cpp

    r249594 r249798  
    15131513#endif
    15141514}
     1515
     1516void Internals::setUseDTLS10(bool useDTLS10)
     1517{
     1518#if USE(LIBWEBRTC)
     1519    auto* document = contextDocument();
     1520    if (!document || !document->page())
     1521        return;
     1522    document->page()->libWebRTCProvider().setUseDTLS10(useDTLS10);
     1523#endif
     1524}
     1525
    15151526#endif
    15161527
  • trunk/Source/WebCore/testing/Internals.h

    r249594 r249798  
    542542    void applyRotationForOutgoingVideoSources(RTCPeerConnection&);
    543543    void setEnableWebRTCEncryption(bool);
     544    void setUseDTLS10(bool);
    544545#endif
    545546
  • trunk/Source/WebCore/testing/Internals.idl

    r249594 r249798  
    619619    [Conditional=WEB_RTC] void clearPeerConnectionFactory();
    620620    [Conditional=WEB_RTC] void setEnableWebRTCEncryption(boolean enabled);
     621    [Conditional=WEB_RTC] void setUseDTLS10(boolean use);
    621622
    622623    [Conditional=VIDEO] void simulateSystemSleep();
Note: See TracChangeset for help on using the changeset viewer.