Bug 173697 - [GCrypt] Implement CryptoKeyRSA PKCS#8 exports
Summary: [GCrypt] Implement CryptoKeyRSA 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 173695
Blocks: 133122
  Show dependency treegraph
 
Reported: 2017-06-21 23:19 PDT by Zan Dobersek
Modified: 2017-07-14 22:23 PDT (History)
4 users (show)

See Also:


Attachments
WIP patch (16.81 KB, patch)
2017-06-22 00:13 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
WIP patch (13.09 KB, patch)
2017-06-26 04:59 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (15.56 KB, patch)
2017-06-28 09:29 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (15.66 KB, patch)
2017-07-03 01:04 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (1.14 MB, application/zip)
2017-07-03 03:59 PDT, Build Bot
no flags Details
Patch (13.41 KB, patch)
2017-07-13 03:25 PDT, Zan Dobersek
jiewen_tan: review+
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 23:19:23 PDT
SSIA.
Comment 1 Zan Dobersek 2017-06-22 00:13:06 PDT
Created attachment 313591 [details]
WIP patch
Comment 2 Build Bot 2017-06-22 00:18:06 PDT
Attachment 313591 [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 7 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:59:10 PDT
Created attachment 313828 [details]
WIP patch
Comment 4 Build Bot 2017-06-26 05:02:39 PDT
Attachment 313828 [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 4 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:29:11 PDT
Created attachment 314030 [details]
Patch
Comment 6 Zan Dobersek 2017-06-28 09:29:34 PDT
(In reply to Zan Dobersek from comment #5)
> Created attachment 314030 [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 01:04:04 PDT
Created attachment 314463 [details]
Patch

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

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

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

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

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

Looks good to me. r- because of duplicated functions.

> Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:377
> +        if (!PAL::TASN1::writeElement(pkcs8, "privateKeyAlgorithm.algorithm", "1.2.840.113549.1.1.1", 1))

Constant for "1.2.840.113549.1.1.1".

> Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:381
> +        if (!PAL::TASN1::writeElement(pkcs8, "privateKeyAlgorithm.parameters", "\x05\x00", 2))

Ditto for "\x05\x00".

> Source/WebCore/crypto/gcrypt/GCryptUtilities.h:159
> +static inline std::optional<Vector<uint8_t>> mpiSignedData(gcry_mpi_t mpi)

Remove these two duplicated function after Bug 173695 is resolved.
Comment 11 Zan Dobersek 2017-07-13 03:25:21 PDT
Created attachment 315340 [details]
Patch
Comment 12 Jiewen Tan 2017-07-14 08:56:43 PDT
Comment on attachment 315340 [details]
Patch

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

> Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:517
> +        if (!PAL::TASN1::writeElement(pkcs8, "privateKeyAlgorithm.parameters", "\x05\x00", 2))

"\x05\x00" could be a constant. You can do it separately.
Comment 13 Jiewen Tan 2017-07-14 08:57:06 PDT
Comment on attachment 315340 [details]
Patch

Looks good to me. r=me.
Comment 14 Zan Dobersek 2017-07-14 22:23:22 PDT
Committed r219536: <http://trac.webkit.org/changeset/219536>