Open Bug 1743583 Opened 2 years ago Updated 1 year ago

PKCS8 EC private keys without the public key component cannot be imported with SubtleCrypto.importKey

Categories

(Core :: DOM: Web Crypto, defect)

Firefox 94
defect

Tracking

()

UNCONFIRMED

People

(Reporter: panva.ip, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(2 files)

Steps to reproduce:

// PKCS8 representation of a private P-384 EC key with the public key omitted
const pkcs8 = new Uint8Array([48, 78, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 4, 55, 48, 53, 2, 1, 1, 4, 48, 32, 52, 118, 9, 96, 116, 119, 172, 168, 251, 251, 197, 230, 33, 132, 85, 243, 25, 150, 105, 121, 46, 248, 180, 102, 250, 168, 123, 220, 103, 121, 129, 68, 200, 72, 221, 3, 102, 30, 237, 90, 198, 36, 97, 52, 12, 234, 150])

await crypto.subtle.importKey('pkcs8', pkcs8, { name: 'ECDSA', namedCurve: 'P-384' }, false, ['sign'])

Actual results:

importKey is rejected with DOMException: Data provided to an operation does not meet requirements

Expected results:
EC private key PKCS8 without the public key component should import as in other browsers

working in Chrome

The Bugbug bot thinks this bug should belong to the 'Core::JavaScript Engine' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/b9191663cc08
set secure-payment-confirmation/enrollment.https.html as timing out on Linux code coverage. DONTBUILD
Component: JavaScript Engine → DOM: Web Crypto
Backout by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/59657b0dd5aa
Backed out changeset b9191663cc08 because it landed with wrong bug number
Severity: -- → S4
Depends on: 1159216
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: