[webrtc-pc] The same connection.peerIdentity promise can be resolved multiple times

soareschen has just created a new issue for https://github.com/w3c/webrtc-pc:

== The same connection.peerIdentity promise can be resolved multiple times ==
In 9.4 Verifying Identity Assertions:

> 10. The RTCPeerConnection resolves the peerIdentity attribute with a new instance of RTCIdentityAssertion that includes the IdP domain and peer identity.

Identity assertion validation is performed every time `setRemoteDescription()` is called with SDP containing a=identity line. Whether the validation succeed or failed, 9.4 attempts to resolve `connection.peerIdentity` promise without considering if it has previously been resolved.

The only time the `peerIdentity` promise is replaced is when _identity validation fails and there is no a target peer identity_. So what happen in other permutations of promise fulfillment/rejection? e.g.:

```javascript
const pc = new RTCPeerConnection({ peerIdentity });
pc.setRemoteDescription(sdpWithInvalidAssertion)
.catch(() => pc.setRemoteDescription(sdpWithValidAssertion));

const pc = new RTCPeerConnection({ peerIdentity });
pc.setRemoteDescription(sdpWithValidAssertion)
.then(() => pc.setRemoteDescription(sdpWithInvalidAssertion));
```

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1513 using your GitHub account

Received on Thursday, 27 July 2017 07:19:28 UTC