Bug 170546 - [GCrypt] Implement raw and JWK imports and exports for EC keys
Summary: [GCrypt] Implement raw and JWK imports and exports for EC keys
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks: 133122
  Show dependency treegraph
 
Reported: 2017-04-06 06:52 PDT by Zan Dobersek
Modified: 2017-04-07 00:36 PDT (History)
3 users (show)

See Also:


Attachments
Patch (11.97 KB, patch)
2017-04-06 07:19 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch for landing (12.14 KB, patch)
2017-04-06 23:27 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2017-04-06 06:52:33 PDT
[GCrypt] Implement raw and JWK imports and exports for EC keys
Comment 1 Zan Dobersek 2017-04-06 07:19:11 PDT
Created attachment 306381 [details]
Patch
Comment 2 Michael Catanzaro 2017-04-06 08:09:43 PDT
Comment on attachment 306381 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=306381&action=review

Not really sure what you're doing here, so if Jiewen is able to sanity-check this, that would be great.

> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:60
> +static size_t uncompressedPointSizeForCurve(CryptoKeyEC::NamedCurve curve)

Nit: I would make this return an unsigned (int). size_t is semantically not right here since it's not the size of a memory buffer. The type doesn't have to match how it's used elsewhere.

> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:70
> +static size_t uncompressedFieldElementSizeForCurve(CryptoKeyEC::NamedCurve curve)

Ditto.

> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:160
> +    Vector<uint8_t> q;

Can you add a comment to explain what you're doing with q?
Comment 3 Jiewen Tan 2017-04-06 11:20:52 PDT
Comment on attachment 306381 [details]
Patch

Didn't check if calls to gcrypt library are correct or not. Looks good to me from the semantics.
Comment 4 Michael Catanzaro 2017-04-06 11:23:24 PDT
Comment on attachment 306381 [details]
Patch

OK then
Comment 5 Zan Dobersek 2017-04-06 23:26:57 PDT
Comment on attachment 306381 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=306381&action=review

>> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:160
>> +    Vector<uint8_t> q;
> 
> Can you add a comment to explain what you're doing with q?

OK.
Comment 6 Zan Dobersek 2017-04-06 23:27:41 PDT
Created attachment 306471 [details]
Patch for landing
Comment 7 Zan Dobersek 2017-04-07 00:36:38 PDT
Comment on attachment 306471 [details]
Patch for landing

Clearing flags on attachment: 306471

Committed r215086: <http://trac.webkit.org/changeset/215086>
Comment 8 Zan Dobersek 2017-04-07 00:36:42 PDT
All reviewed patches have been landed.  Closing bug.