Bug 164741

Summary: Update SubtleCrypto::verify to match the latest spec
Product: WebKit Reporter: Jiewen Tan <jiewen_tan>
Component: WebCore Misc.Assignee: Jiewen Tan <jiewen_tan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cdumez, commit-queue, esprehn+autocc, jiewen_tan, kondapallykalyan, rob, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 160883    
Attachments:
Description Flags
Patch none

Description Jiewen Tan 2016-11-14 15:53:41 PST
Update SubtleCrypto::verify to match the latest spec.
Comment 1 Radar WebKit Bug Importer 2016-11-14 16:44:57 PST
<rdar://problem/29257935>
Comment 2 Jiewen Tan 2016-11-29 17:07:55 PST
Created attachment 295675 [details]
Patch
Comment 3 WebKit Commit Bot 2016-11-29 17:09:32 PST
Attachment 295675 [details] did not pass style-queue:


ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:80:  CryptoAlgorithmRSASSA_PKCS1_v1_5::verify is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:87:  verifyRSASSA_PKCS1_v1_5 is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:133:  CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:43:  CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 4 in 57 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Brent Fulgham 2016-11-30 09:15:06 PST
Comment on attachment 295675 [details]
Patch

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

Nice job!

> Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp:113
> +void CryptoAlgorithmHMAC::platformVerify(Ref<CryptoKey>&& key, Vector<uint8_t>&& signature, Vector<uint8_t>&& data, BoolCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)

We should probably rename this directory from "mac" to "cocoa" or "apple" or something, since it is used on all Apple platforms.

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

Yay!
Comment 5 Jiewen Tan 2016-11-30 12:19:29 PST
Comment on attachment 295675 [details]
Patch

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

Thanks Brent for r+ my patch.

>> Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp:113
>> +void CryptoAlgorithmHMAC::platformVerify(Ref<CryptoKey>&& key, Vector<uint8_t>&& signature, Vector<uint8_t>&& data, BoolCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
> 
> We should probably rename this directory from "mac" to "cocoa" or "apple" or something, since it is used on all Apple platforms.

That actually confuses me as well. We have a lot files having suffix Mac but not only being used in Mac. I mean besides crypto.
Comment 6 WebKit Commit Bot 2016-11-30 13:19:41 PST
Comment on attachment 295675 [details]
Patch

Clearing flags on attachment: 295675

Committed r209150: <http://trac.webkit.org/changeset/209150>
Comment 7 WebKit Commit Bot 2016-11-30 13:19:45 PST
All reviewed patches have been landed.  Closing bug.