Closed Bug 1159216 Opened 10 years ago Closed 4 months ago

Support PKCS8 import for private (EC)DH keys without a public key

Categories

(NSS :: Libraries, enhancement, P5)

enhancement

Tracking

(firefox40 affected)

RESOLVED DUPLICATE of bug 1915792
Tracking Status
firefox40 --- affected

People

(Reporter: ttaubert, Assigned: anna.weine)

References

(Blocks 1 open bug)

Details

RFC 5915 (ECDH) and RFC 5208 (others) state that a public key SHOULD be provided with the PKCS8 structure but isn't required. We can simply compute the public key from the given params and private key but NSS's PK11_ API doesn't seem to expose anything for that currently. A somewhat high-level function that allows to pass in a private key and returns a public key should be sufficient.
Depends on: 1159202, 1048931
So I found EC_NewKeyFromSeed(), which seems great for reconstructing a public key from private one. But it unfortunately is only available via freebl. The same for EC_ValidatePublicKey() which we really should use instead of the other troublesome function we currently use in WebCrypto. I managed to expose both functions via freebl, softoken, and then PKCS#11. I wondered, is there an easier way to do this or is that the way we have to go? Dana, you know a lot about this. Any suggestions? :)
Flags: needinfo?(dkeeler)
From a policy standpoint, it's my understanding that exposing freebl directly isn't something that's done. I'm sure this decision could be revisited (it would be something to bring up on the nss-dev mailing list or at the weekly meeting). In the absence of that, though, freebl -> softoken -> PK11_* is probably the way to go. (To be clear, adding to the PK11_ API it totally fine (I'm fairly sure), and if doing so would improve the WebCrypto implementation, we should do it.)
Flags: needinfo?(dkeeler)
Thanks Dana! I'll try the freebl -> softoken -> PK11_ way to get those exposed.
Component: DOM: Security → Security
Assignee: nobody → nobody
Type: defect → enhancement
Component: Security → Libraries
Product: Core → NSS
Version: Trunk → other
Severity: normal → --
Severity: -- → N/A
Priority: -- → P5
Assignee: nobody → nkulatova
Status: NEW → RESOLVED
Closed: 4 months ago
Duplicate of bug: 1915792
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.