Bug 173648 - [GCrypt] Implement CryptoKeyEC PKCS#8 exports
Summary: [GCrypt] Implement CryptoKeyEC PKCS#8 exports
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: 173646
Blocks: 133122
  Show dependency treegraph
 
Reported: 2017-06-21 06:08 PDT by Zan Dobersek
Modified: 2017-07-12 06:59 PDT (History)
4 users (show)

See Also:


Attachments
WIP patch (12.64 KB, patch)
2017-06-21 06:34 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
WIP patch (8.25 KB, patch)
2017-06-26 04:57 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (9.94 KB, patch)
2017-06-28 09:22 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (9.80 KB, patch)
2017-07-03 00:52 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (1.48 MB, application/zip)
2017-07-03 06:57 PDT, Build Bot
no flags Details
Patch for landing (9.72 KB, patch)
2017-07-12 04:34 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-06-21 06:08:52 PDT
SSIA.
Comment 1 Zan Dobersek 2017-06-21 06:34:52 PDT
Created attachment 313514 [details]
WIP patch
Comment 2 Build Bot 2017-06-21 06:37:45 PDT
Attachment 313514 [details] did not pass style-queue:


ERROR: Source/WebCore/PAL/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 2 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Zan Dobersek 2017-06-26 04:57:45 PDT
Created attachment 313826 [details]
WIP patch
Comment 4 Build Bot 2017-06-26 05:01:09 PDT
Attachment 313826 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Zan Dobersek 2017-06-28 09:22:53 PDT
Created attachment 314026 [details]
Patch
Comment 6 Zan Dobersek 2017-06-28 09:23:41 PDT
(In reply to Zan Dobersek from comment #5)
> Created attachment 314026 [details]
> Patch

This is ready for review, but the patch still relies on libtasn1 helpers that are being added in bug #173646.
Comment 7 Zan Dobersek 2017-07-03 00:52:58 PDT
Created attachment 314461 [details]
Patch

Now buildable.
Comment 8 Build Bot 2017-07-03 06:57:40 PDT
Comment on attachment 314461 [details]
Patch

Attachment 314461 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/4044017

New failing tests:
workers/bomb.html
Comment 9 Build Bot 2017-07-03 06:57:41 PDT
Created attachment 314479 [details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 10 Jiewen Tan 2017-07-11 11:34:22 PDT
Comment on attachment 314461 [details]
Patch

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

Looks good to me. r=me. Please address the following comments before landing.

> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:508
> +        // Construct the EC context that we'll use to retrieve private and public key data.

I believe private key should be ahead of parameters even though the end result is the same.

> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:542
> +        // Create the `SubjectPublicKeyInfo` structure.

Shouldn't it be "PrivateKeyInfo"?

> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:553
> +        if (!PAL::TASN1::writeElement(pkcs8, "privateKeyAlgorithm.algorithm", "1.2.840.10045.2.1", 1))

Remember to make "1.2.840.10045.2.1" as a constant in a followup patch.
Comment 11 Zan Dobersek 2017-07-12 04:32:49 PDT
Comment on attachment 314461 [details]
Patch

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

>> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:508
>> +        // Construct the EC context that we'll use to retrieve private and public key data.
> 
> I believe private key should be ahead of parameters even though the end result is the same.

I'll switch the order for the sake of consistency with the ASN.1 definition.

>> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:542
>> +        // Create the `SubjectPublicKeyInfo` structure.
> 
> Shouldn't it be "PrivateKeyInfo"?

Yes.

>> Source/WebCore/crypto/gcrypt/CryptoKeyECGCrypt.cpp:553
>> +        if (!PAL::TASN1::writeElement(pkcs8, "privateKeyAlgorithm.algorithm", "1.2.840.10045.2.1", 1))
> 
> Remember to make "1.2.840.10045.2.1" as a constant in a followup patch.

Will do.
Comment 12 Zan Dobersek 2017-07-12 04:34:33 PDT
Created attachment 315229 [details]
Patch for landing
Comment 13 Zan Dobersek 2017-07-12 06:59:40 PDT
Comment on attachment 315229 [details]
Patch for landing

Clearing flags on attachment: 315229

Committed r219392: <http://trac.webkit.org/changeset/219392>
Comment 14 Zan Dobersek 2017-07-12 06:59:43 PDT
All reviewed patches have been landed.  Closing bug.