Ignore ufrag/password in "a=candidate" lines in SDP.

These attributes should be parsed in candidate trickling, but when
parsing a full session description, only "a=ice-ufrag"/"a=ice-pwd"
should be used to communicate the ufrag/password.

BUG=chromium:681286

Review-Url: https://codereview.webrtc.org/2639183002
Cr-Original-Commit-Position: refs/heads/master@{#16194}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 7bcdb6995777b282564359df4328328d1a58f78e
diff --git a/api/webrtcsdp.cc b/api/webrtcsdp.cc
index e19840b..c79c851 100644
--- a/api/webrtcsdp.cc
+++ b/api/webrtcsdp.cc
@@ -2676,6 +2676,12 @@
       if (!ParseCandidate(line, &candidate, error, false)) {
         return false;
       }
+      // ParseCandidate will parse non-standard ufrag and password attributes,
+      // since it's used for candidate trickling, but we only want to process
+      // the "a=ice-ufrag"/"a=ice-pwd" values in a session description, so
+      // strip them off at this point.
+      candidate.set_username(std::string());
+      candidate.set_password(std::string());
       candidates_orig.push_back(candidate);
     } else if (HasAttribute(line, kAttributeIceUfrag)) {
       if (!GetValue(line, kAttributeIceUfrag, &transport->ice_ufrag, error)) {