Changeset 202628 in webkit
- Timestamp:
- Jun 29, 2016 10:36:33 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202626 r202628 1 2016-06-29 Alejandro G. Castro <alex@igalia.com> 2 3 WebRTC: ice-char can not contain '=' characters for credentials 4 https://bugs.webkit.org/show_bug.cgi?id=159207 5 6 Reviewed by Eric Carlson. 7 8 Modified the parser to make the regexp similar to the one we have 9 in WebCore. 10 11 * fast/mediastream/resources/sdp-utils.js: 12 (printComparableSessionDescription): 13 1 14 2016-06-29 David Kilzer <ddkilzer@apple.com> 2 15 -
trunk/LayoutTests/fast/mediastream/resources/sdp-utils.js
r201728 r202628 16 16 "msid": "^a=(ssrc:\\d+ )?msid:([\\w+/\\-=]+) +([\\w+/\\-=]+).*$", 17 17 "iceufrag": "^a=ice-ufrag:([\\w+/]*).*$", 18 "icepwd": "^a=ice-pwd:([\\w+/]* =*).*$",18 "icepwd": "^a=ice-pwd:([\\w+/]*).*$", 19 19 }; 20 20 -
trunk/Source/WebCore/ChangeLog
r202626 r202628 1 2016-06-29 Alejandro G. Castro <alex@igalia.com> 2 3 WebRTC: ice-char can not contain '=' characters for credentials 4 https://bugs.webkit.org/show_bug.cgi?id=159207 5 6 Reviewed by Eric Carlson. 7 8 Avoid a general calculation to get a base64 without padding which 9 was wrong in the randomString function. Because each parameter 10 using the function requires a different setup depending of the 11 specification and this is not a general API, it is a better 12 solution to calculate and store the sizes we want to use, comment 13 them and test them, considering we use base64 to generate the 14 strings we just need to avoid padding. 15 16 Existing test modified to match the correct behavior. 17 18 * Modules/mediastream/MediaEndpointPeerConnection.cpp: 19 (WebCore::randomString): Now the size is the one passed. 20 (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): 21 Used different valid values following the sdp parser in each case. 22 1 23 2016-06-29 David Kilzer <ddkilzer@apple.com> 2 24 -
trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
r202624 r202628 54 54 using namespace PeerConnectionStates; 55 55 56 // We use base64 to generate the random strings so we need a size that avoids padding to get ice-chars. 57 static const size_t cnameSize = 18; 58 // Size range from 4 to 256 ice-chars defined in RFC 5245. 59 static const size_t iceUfragSize = 6; 60 // Size range from 22 to 256 ice-chars defined in RFC 5245. 61 static const size_t icePasswordSize = 24; 62 56 63 static std::unique_ptr<PeerConnectionBackend> createMediaEndpointPeerConnection(PeerConnectionBackendClient* client) 57 64 { … … 61 68 CreatePeerConnectionBackend PeerConnectionBackend::create = createMediaEndpointPeerConnection; 62 69 63 static String randomString(size_t length) 64 { 65 const size_t size = ceil(length * 3 / 4); 70 static String randomString(size_t size) 71 { 66 72 unsigned char randomValues[size]; 67 73 cryptographicallyRandomValues(randomValues, size); … … 73 79 , m_mediaEndpoint(MediaEndpoint::create(*this)) 74 80 , m_sdpProcessor(std::unique_ptr<SDPProcessor>(new SDPProcessor(m_client->scriptExecutionContext()))) 75 , m_cname(randomString( 16))76 , m_iceUfrag(randomString( 4))77 , m_icePassword(randomString( 22))81 , m_cname(randomString(cnameSize)) 82 , m_iceUfrag(randomString(iceUfragSize)) 83 , m_icePassword(randomString(icePasswordSize)) 78 84 { 79 85 ASSERT(m_mediaEndpoint);
Note: See TracChangeset
for help on using the changeset viewer.