Closed
Bug 1312306
Opened 9 years ago
Closed 9 years ago
Treat expires=0 on RTCPeerConnection.generateCertificate() as 0
Categories
(Core :: WebRTC: Signaling, defect, P2)
Core
WebRTC: Signaling
Tracking
()
RESOLVED
FIXED
mozilla52
| Tracking | Status | |
|---|---|---|
| firefox52 | --- | fixed |
People
(Reporter: mt, Assigned: mt)
Details
Attachments
(1 file, 1 obsolete file)
See https://github.com/w3c/webrtc-pc/issues/879
This might be used to improve tests a little at the same time.
| Assignee | ||
Updated•9 years ago
|
Summary: Treat expires=0 as 0 → Treat expires=0 on RTCPeerConnection.generateCertificate() as 0
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•9 years ago
|
Attachment #8803766 -
Attachment is obsolete: true
| Assignee | ||
Comment 5•9 years ago
|
||
Note to DOM reviewer: I have a PR open on the spec here: https://github.com/w3c/webrtc-pc/pull/880/files
The underlying implementation uses WebCrypto, which is a nightmare API that takes an `object` argument. That means that I need to use `object` here also. I opted to go with ObjectOrString (aka AlgorithmIdentifier) to make passing data to webcrypto easier.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Updated•9 years ago
|
Assignee: nobody → martin.thomson
Status: NEW → ASSIGNED
Rank: 25
Priority: -- → P2
Comment 8•9 years ago
|
||
Comment on attachment 8803765 [details]
Bug 1312306 - Update expires handling on RTCCertificate to match spec,
I don't have cycles for generic DOM stuff right now, sorry. :-(
Attachment #8803765 -
Flags: review?(bobbyholley)
Comment 9•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8803765 [details]
Bug 1312306 - Update expires handling on RTCCertificate to match spec,
https://reviewboard.mozilla.org/r/87908/#review87128
Lgtm.
::: dom/webidl/RTCPeerConnection.webidl:90
(Diff revision 5)
> + // Note: this takes an AlgorithmIdentifier rather than the specified
> + // RTCGenerateCertificateOptions so that we can ensure that all the
> + // attributes that webcrypto needs survive properly.
> [Throws, StaticClassOverride="mozilla::dom::RTCCertificate"]
> static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm);
Doesn't this ugliness need to be reflected in the spec also?
Attachment #8803765 -
Flags: review?(jib) → review+
| Assignee | ||
Updated•9 years ago
|
Attachment #8803765 -
Flags: review?(bkelly)
Comment 10•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8803765 [details]
Bug 1312306 - Update expires handling on RTCCertificate to match spec,
https://reviewboard.mozilla.org/r/87906/#review87760
::: dom/webidl/RTCPeerConnection.webidl:92
(Diff revision 5)
> Constructor (optional RTCConfiguration configuration,
> optional object? constraints)]
> interface RTCPeerConnection : EventTarget {
> + // Note: this takes an AlgorithmIdentifier rather than the specified
> + // RTCGenerateCertificateOptions so that we can ensure that all the
> + // attributes that webcrypto needs survive properly.
Doesn't this mean we still accept `DOMString` here when the spec is being changed not to accept it?
Also, what do you mean by "survive properly"? Is this a limitation in our binding code? Have you talked to Boris or Peter to see if its something we can fix?
| Assignee | ||
Comment 12•9 years ago
|
||
Thanks for the prod. The conclusion is that the *spec* needs to use AlgorithmIdentifier here for all the same reasons that I added it to gecko. I'll get to this next week (I've a few deadlines on Monday that will push this aside).
Also, DOMString might be valid if we implement Ed25519 certificates (which is waaay off).
Flags: needinfo?(martin.thomson)
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•9 years ago
|
Attachment #8803765 -
Flags: review?(bkelly)
Comment 15•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8803765 [details]
Bug 1312306 - Update expires handling on RTCCertificate to match spec,
https://reviewboard.mozilla.org/r/87908/#review89048
::: dom/media/webrtc/RTCCertificate.cpp:242
(Diff revision 7)
> + if (!aOptions.IsObject()) {
> + return EXPIRATION_DEFAULT;
> + }
> + JS::RootedValue value(aCx, JS::ObjectValue(*aOptions.GetAsObject()));
> + if (!expiration.Init(aCx, value)) {
> + aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
You want:
aRv.NoteJSContextException(aCx);
since there's an exception on aCx already, placed there by Init().
Comment 16•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8803765 [details]
Bug 1312306 - Update expires handling on RTCCertificate to match spec,
https://reviewboard.mozilla.org/r/87908/#review89040
Also, is there a WPT test for this addition anywhere? Can you add one?
r=me with comments addressed.
::: dom/media/webrtc/RTCCertificate.cpp:50
(Diff revision 7)
> {
> public:
> GenerateRTCCertificateTask(nsIGlobalObject* aGlobal, JSContext* aCx,
> const ObjectOrString& aAlgorithm,
> - const Sequence<nsString>& aKeyUsages)
> + const Sequence<nsString>& aKeyUsages,
> + PRTime expires)
nit: Current style guidelines and the rest of this file use argument names like `aExpires`.
::: dom/media/webrtc/RTCCertificate.cpp:243
(Diff revision 7)
> + return EXPIRATION_DEFAULT;
> + }
> + JS::RootedValue value(aCx, JS::ObjectValue(*aOptions.GetAsObject()));
> + if (!expiration.Init(aCx, value)) {
> + aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
> + return 0;
Why throw an error and return 0 here? It seems this method falls back to the default value on all other errors.
Or alternatively, under what conditions can this fail, but also pass normal webidl binding checking?
Attachment #8803765 -
Flags: review?(bkelly) → review+
Comment 17•9 years ago
|
||
> > + JS::RootedValue value(aCx, JS::ObjectValue(*aOptions.GetAsObject()));
> > + if (!expiration.Init(aCx, value)) {
> > + aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
> > + return 0;
>
> Why throw an error and return 0 here? It seems this method falls back to
> the default value on all other errors.
>
> Or alternatively, under what conditions can this fail, but also pass normal
> webidl binding checking?
Boris tells me this can happen if the init object has a getter that throws, etc. So you can ignore my comment here.
| Assignee | ||
Comment 18•9 years ago
|
||
> Also, is there a WPT test for this addition anywhere? Can you add one?
Philip Jägenstedt is working on some of these, this is why I ended up making this change. Thanks for the comments, I'll fix and land.
| Comment hidden (mozreview-request) |
Comment 20•9 years ago
|
||
Pushed by martin.thomson@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2694e55d5972
Update expires handling on RTCCertificate to match spec, r=bkelly,jib
Comment 21•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment 22•9 years ago
|
||
Pushed by martin.thomson@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fa1f25d45d8e
Followup to fix operator error, a=bustage
Comment 23•9 years ago
|
||
| bugherder | ||
You need to log in
before you can comment on or make changes to this bug.
Description
•