From fae57f41a00543b1dc31078d8ac2ff0aa85381f5 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Thu, 20 Mar 2014 15:49:33 -0700 Subject: [PATCH] Bug 985762 - Remove displayname from IdP protocol. r=jib --- dom/media/PeerConnection.js | 2 +- dom/media/PeerConnectionIdp.jsm | 9 ++++----- dom/media/tests/identity/idp-proxy.js | 4 +--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index 7c7e1fe3b451..f3ba3184a657 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -676,7 +676,7 @@ RTCPeerConnection.prototype = { _processIdentity: function(message) { if (message) { this._peerIdentity = new this._win.RTCIdentityAssertion( - this._remoteIdp.provider, message.identity.name); + this._remoteIdp.provider, message.identity); let args = { peerIdentity: this._peerIdentity }; this.dispatchEvent(new this._win.Event("peeridentity")); diff --git a/dom/media/PeerConnectionIdp.jsm b/dom/media/PeerConnectionIdp.jsm index 849dde8a9b01..4511aa72cc7a 100644 --- a/dom/media/PeerConnectionIdp.jsm +++ b/dom/media/PeerConnectionIdp.jsm @@ -182,14 +182,13 @@ PeerConnectionIdp.prototype = { try { let contents = JSON.parse(message.contents); - if (typeof contents.fingerprint !== "object" || - typeof message.identity !== "object") { - warn("fingerprint or identity not objects"); + if (typeof contents.fingerprint !== "object") { + warn("fingerprint is not an object"); } else if (contents.fingerprint.digest !== fingerprint.digest || - contents.fingerprint.algorithm !== fingerprint.algorithm) { + contents.fingerprint.algorithm !== fingerprint.algorithm) { warn("fingerprint does not match"); } else { - let error = this._validateName(message.identity.name); + let error = this._validateName(message.identity); if (error) { warn(error); } else { diff --git a/dom/media/tests/identity/idp-proxy.js b/dom/media/tests/identity/idp-proxy.js index 90080673fd0c..4fce15e46628 100644 --- a/dom/media/tests/identity/idp-proxy.js +++ b/dom/media/tests/identity/idp-proxy.js @@ -86,9 +86,7 @@ type : "SUCCESS", id : message.id, message : { - identity : { - name : payload.username - }, + identity : payload.username, contents : payload.contents } });