Bug 170546

Summary: [GCrypt] Implement raw and JWK imports and exports for EC keys
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, jiewen_tan, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 133122    
Attachments:
Description Flags
Patch
none
Patch for landing none

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.