Bug 164746 - Update SubtleCrypto::wrapKey to match the latest spec
Summary: Update SubtleCrypto::wrapKey to match the latest spec
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jiewen Tan
URL:
Keywords: InRadar
Depends on:
Blocks: 160883
  Show dependency treegraph
 
Reported: 2016-11-14 15:59 PST by Jiewen Tan
Modified: 2016-11-30 14:26 PST (History)
8 users (show)

See Also:


Attachments
Patch (56.69 KB, patch)
2016-11-29 13:13 PST, Jiewen Tan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiewen Tan 2016-11-14 15:59:26 PST
Update SubtleCrypto::wrapKey to match the latest spec.
Comment 1 Radar WebKit Bug Importer 2016-11-14 16:52:50 PST
<rdar://problem/29258160>
Comment 2 Jiewen Tan 2016-11-29 13:13:51 PST
Created attachment 295626 [details]
Patch
Comment 3 WebKit Commit Bot 2016-11-29 13:15:36 PST
Attachment 295626 [details] did not pass style-queue:


ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp:161:  CryptoAlgorithmAES_KW::wrapKey is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:36:  CryptoAlgorithmAES_KW::platformWrapKey is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmAES_KWMac.cpp:39:  wrapKeyAES_KW is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmAES_KWMac.cpp:50:  CryptoAlgorithmAES_KW::platformWrapKey is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 4 in 33 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Brent Fulgham 2016-11-29 13:28:23 PST
Comment on attachment 295626 [details]
Patch

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

r=me

> Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp:651
> +    supportExportKeyThrow(state, key->algorithmIdentifier());

Is it okay that we are changing from this promise rejection to a DOM exception? Is that per the new specification?

> LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt:67
> +PASS SubtleCrypto interface: calling wrapKey(KeyFormat,CryptoKey,CryptoKey,AlgorithmIdentifier) on crypto.subtle with too few arguments must throw TypeError 

Ever closer! I hope to see 'unwrapKey' soon! :-)
Comment 5 Jiewen Tan 2016-11-29 13:58:53 PST
Comment on attachment 295626 [details]
Patch

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

Thanks Brent for r+ my patch.

>> Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp:651
>> +    supportExportKeyThrow(state, key->algorithmIdentifier());
> 
> Is it okay that we are changing from this promise rejection to a DOM exception? Is that per the new specification?

Don't worry. There is a catcher in callPromiseFunction to convert any thrown exceptions to rejected promises.
Comment 6 WebKit Commit Bot 2016-11-30 14:26:31 PST
Comment on attachment 295626 [details]
Patch

Clearing flags on attachment: 295626

Committed r209155: <http://trac.webkit.org/changeset/209155>
Comment 7 WebKit Commit Bot 2016-11-30 14:26:35 PST
All reviewed patches have been landed.  Closing bug.