Closed Bug 941394 Opened 7 years ago Closed 1 year ago

valid keygen keytypes are returning undefined

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86
macOS
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: patrickkettner, Assigned: jkt)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36

Steps to reproduce:

1. go to  data:text/html, <keygen keytype="notrsa">
2. inspect the keytype of the element, using javascript


Actual results:

keygen.keytype returns notrsa


Expected results:

According to the spec (http://www.w3.org/TR/2012/WD-html5-20121025/the-keygen-element.html#attr-keygen-keytype), if the keytype is anything other than rsa, it should return an empty string. This is the only way (http://lists.w3.org/Archives/Public/public-html/2009Sep/0550.html) to detect if a platform can support it properly.
> 2. inspect the keytype of the element, using javascript

How exactly are you doing this?
Flags: needinfo?(patrickkettner)
Oh, I see, something like this:

data:text/html,<keygen id="foo" keytype="notrsa"><script>alert(document.getElementById("foo").keytype)</script>

That alerts empty string for me in Firefox.  Are you sure you shouldn't be filing your bug on Chrome instead (where it does in fact return "notrsa")?
Apologies, all around. I did in fact open up bugs with every browser, however Firefox's was supposed to be the inverse is the issue. keytype never shows up.

Check http://jsbin.com/EdUWoXo/3/edit for the example.

This should be alerting rsa, but it is returning undefined. I believe this is because your implementation of keygen is just a select element, and the keygen attribute is not on it's IDL
Flags: needinfo?(patrickkettner)
Summary: invalid keygen keytypes are not returning an empty string → valid keygen keytypes are returning undefined
Ah, so like this:

data:text/html,<keygen id="foo" keytype="notrsa"><script>alert(typeof document.getElementById("foo").keytype)</script>

Presumably this will be fixed when bug 101019 is fixed.
Depends on: html5-keygen
Actually, like this

data:text/html,<keygen id="foo" keytype="rsa"><script>alert(typeof document.getElementById("foo").keytype)</script>

I would hope it is fixed when bug 101019 is fixed. This means that it is not really possible to accurately detect the keygen attribute. It would be great if you'd be able to fix this bug in the mean time, however I understand if you want to mark it as a dupe and hope for the best.
There's really no sane way to fix this without fixing bug 101019 as far as I can tell...
haha, so it is the IDL issue then? Okey doke.
No longer blocks: 971892
Hi,

Due to the fact this issue is still reproducible and depends on bug 101019, which is in NEW status, I shall mark this issue as NEW.

Thank you,
Vlad
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
(In reply to patrickkettner from comment #0)
> if the keytype is anything other than rsa, it should return an empty string.

Please don't break keytype "ec":
<keygen name="name" challenge="random" keytype="ec" keyparams="secp521r1"/>

https://github.com/fx-dev-playground/gecko/blob/central_default/security/manager/ssl/nsKeygenHandler.cpp#L503
https://github.com/fx-dev-playground/gecko/blob/central_default/security/manager/ssl/nsKeygenHandler.cpp#L96
Priority: -- → P5

Bug 1315460 resolved this by removing support completely to match the web standard and also Chrome.

Assignee: nobody → jkt
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.