Closed Bug 941394 Opened 10 years ago Closed 5 years ago

valid keygen keytypes are returning undefined


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






(Reporter: patrickkettner, Assigned: jkt)



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 (, if the keytype is anything other than rsa, it should return an empty string. This is the only way ( 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 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

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,
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"/>
Priority: -- → P5

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

Assignee: nobody → jkt
Closed: 5 years ago
Resolution: --- → WORKSFORME
Depends on: 1315460
You need to log in before you can comment on or make changes to this bug.