compressed EC keys are not supported
Categories
(Core :: DOM: Web Crypto, defect, P4)
Tracking
()
People
(Reporter: me, Assigned: anna.weine)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 1 obsolete file)
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Steps to reproduce:
run the following code on console
const key = Uint8Array.from([
3, 87, 75, 142, 100, 252, 120, 242,
8, 242, 222, 34, 108, 146, 53, 135,
204, 118, 48, 149, 121, 41, 42, 145,
42, 77, 63, 130, 148, 148, 159, 107,
46
]);
await crypto.subtle.importKey('raw', key, { name: 'ECDSA', namedCurve: 'P-256' }, true, ['verify']);
Actual results:
it should've returned a CryptoKey instance
Expected results:
an error is thrown, "DOMException: Data provided to an operation does not meet requirements"
Updated•1 year ago
|
think it has to do with the key having compressed points? but yeah this works on Chrome 137.
the context is
| Assignee | ||
Comment 2•1 year ago
|
||
Yes, we do not support the compressed points.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
Could you tell me more why do you need the compressed points? I'd like to understand if there is any requirement/interest such that we implement this feature :)
oops didn't realize I had a draft comment written when I was just going to edit the title.
the specific context here is that I'm dealing with atproto cryptography. I have a web tool that lets anyone push updates to their did:plc identity using whatever signing key they have..
atproto's cryptography expects compressed keys, so it would be nice if Firefox supported it rather than work around it by uncompressing the points before passing to WebCrypto.
| Assignee | ||
Comment 5•1 year ago
|
||
No worries, thanks for the information.
I can't promise a specific time just yet, but we’ll do our best to make it work when we can :)
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 6•10 months ago
|
||
Updated•10 months ago
|
| Assignee | ||
Comment 7•10 months ago
|
||
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Comment 9•9 months ago
|
||
Comment on attachment 9516972 [details]
Bug 1971499 - Support for NIST Curves compressed points
Revision D266694 was moved to bug 1995512. Setting attachment 9516972 [details] to obsolete.
Comment 10•9 months ago
|
||
Updated•9 months ago
|
Comment 11•9 months ago
|
||
| bugherder | ||
| Assignee | ||
Comment 12•9 months ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: A lot of external libraries use the compressed form keys.
[Affects Firefox for Android]: yes
[Suggested wording]: Added support for compressed elliptic curve points in WebCrypto.
[Links (documentation, blog post, etc)]:
| Assignee | ||
Updated•9 months ago
|
Comment 13•9 months ago
|
||
Added to Fx146 release notes https://www.firefox.com/en-US/firefox/146.0a1/releasenotes/
Updated•9 months ago
|
Comment 14•9 months ago
•
|
||
FF146 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/41870
My understanding is that this change allows SubtleCrypto.importKey() to import Elliptic Curve public keys (algorithm ECDSA or ECDH) that define the key in terms of compressed points.
-
updated the compatibility data
-
added line to docs in Supported formats > raw section to append:
Note that when importing Elliptic Curve public keys the data may contain compressed elliptic curve points.
Can you confirm that this is accurate/OK. Specifically I think this "support" only covers import of key data - you can't export compressed points right? Is there anything else you might do?
Updated•8 months ago
|
| Assignee | ||
Updated•3 months ago
|
Description
•