Bug 170869

Summary: [WebCrypto] Support RSA-PSS
Product: WebKit Reporter: Jiewen Tan <jiewen_tan>
Component: WebCore Misc.Assignee: Jiewen Tan <jiewen_tan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, buildbot, commit-queue, florian.gaultier, jfbastien, jiewen_tan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 166746    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
bfulgham: review+
Patch for landing
none
Patch for landing commit-queue: commit-queue-

Jiewen Tan
Reported 2017-04-14 18:25:25 PDT
Support RSA-PSS as specified in: https://www.w3.org/TR/WebCryptoAPI/#rsa-pss.
Attachments
Patch (158.57 KB, patch)
2017-05-22 13:55 PDT, Jiewen Tan
no flags
Patch (158.57 KB, patch)
2017-05-22 15:45 PDT, Jiewen Tan
no flags
Patch (159.12 KB, patch)
2017-05-22 16:32 PDT, Jiewen Tan
bfulgham: review+
Patch for landing (158.95 KB, patch)
2017-05-23 14:29 PDT, Jiewen Tan
no flags
Patch for landing (159.03 KB, patch)
2017-05-23 15:25 PDT, Jiewen Tan
commit-queue: commit-queue-
Jiewen Tan
Comment 1 2017-04-14 18:27:11 PDT
Currently, the underlying Crypto API we are using, i.e. CommonCrypto, doesn't support RSA-PSS. Therefore, the implementation of RSA-PSS is deferred until either CommonCrypto supports it or we transfer to another Crypto API.
Radar WebKit Bug Importer
Comment 2 2017-04-14 18:27:43 PDT
Jiewen Tan
Comment 3 2017-05-22 13:55:56 PDT
Build Bot
Comment 4 2017-05-22 13:58:35 PDT
Attachment 310916 [details] did not pass style-queue: ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:40: signRSA_PSS is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:65: verifyRSA_PSS is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:86: CryptoAlgorithmRSA_PSS::platformSign is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:109: CryptoAlgorithmRSA_PSS::platformVerify is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:46: CryptoAlgorithmRSA_PSS::create is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:51: CryptoAlgorithmRSA_PSS::identifier is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:56: CryptoAlgorithmRSA_PSS::sign is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:65: CryptoAlgorithmRSA_PSS::verify is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:74: CryptoAlgorithmRSA_PSS::generateKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:94: CryptoAlgorithmRSA_PSS::importKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:171: CryptoAlgorithmRSA_PSS::exportKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 11 in 71 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jiewen Tan
Comment 5 2017-05-22 15:45:44 PDT
Build Bot
Comment 6 2017-05-22 15:48:57 PDT
Attachment 310940 [details] did not pass style-queue: ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:40: signRSA_PSS is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:65: verifyRSA_PSS is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:86: CryptoAlgorithmRSA_PSS::platformSign is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:109: CryptoAlgorithmRSA_PSS::platformVerify is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:46: CryptoAlgorithmRSA_PSS::create is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:51: CryptoAlgorithmRSA_PSS::identifier is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:56: CryptoAlgorithmRSA_PSS::sign is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:65: CryptoAlgorithmRSA_PSS::verify is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:74: CryptoAlgorithmRSA_PSS::generateKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:94: CryptoAlgorithmRSA_PSS::importKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:171: CryptoAlgorithmRSA_PSS::exportKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 11 in 71 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jiewen Tan
Comment 7 2017-05-22 16:32:02 PDT
Build Bot
Comment 8 2017-05-22 16:35:20 PDT
Attachment 310951 [details] did not pass style-queue: ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:40: signRSA_PSS is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:65: verifyRSA_PSS is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:86: CryptoAlgorithmRSA_PSS::platformSign is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:109: CryptoAlgorithmRSA_PSS::platformVerify is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:46: CryptoAlgorithmRSA_PSS::create is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:51: CryptoAlgorithmRSA_PSS::identifier is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:56: CryptoAlgorithmRSA_PSS::sign is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:65: CryptoAlgorithmRSA_PSS::verify is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:74: CryptoAlgorithmRSA_PSS::generateKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:94: CryptoAlgorithmRSA_PSS::importKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:171: CryptoAlgorithmRSA_PSS::exportKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 11 in 72 files If any of these errors are false positives, please file a bug against check-webkit-style.
Brent Fulgham
Comment 9 2017-05-22 16:35:31 PDT
Comment on attachment 310951 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310951&action=review r=me assuming the GTK build works properly. > LayoutTests/TestExpectations:1023 > +# WebCryptoAPI features that hasn't been enabled for current OS "features that HAVEN'T been enabled..."
Jiewen Tan
Comment 10 2017-05-22 16:47:59 PDT
Comment on attachment 310951 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310951&action=review Thanks Brent for r+ my patch. >> LayoutTests/TestExpectations:1023 >> +# WebCryptoAPI features that hasn't been enabled for current OS > > "features that HAVEN'T been enabled..." Fixed.
Jiewen Tan
Comment 11 2017-05-23 14:29:35 PDT
Created attachment 311052 [details] Patch for landing
Jiewen Tan
Comment 12 2017-05-23 15:25:33 PDT
Created attachment 311064 [details] Patch for landing
Build Bot
Comment 13 2017-05-23 15:31:07 PDT
Attachment 311064 [details] did not pass style-queue: ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:40: signRSA_PSS is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:65: verifyRSA_PSS is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:86: CryptoAlgorithmRSA_PSS::platformSign is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:109: CryptoAlgorithmRSA_PSS::platformVerify is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:46: CryptoAlgorithmRSA_PSS::create is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:51: CryptoAlgorithmRSA_PSS::identifier is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:56: CryptoAlgorithmRSA_PSS::sign is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:65: CryptoAlgorithmRSA_PSS::verify is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:74: CryptoAlgorithmRSA_PSS::generateKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:94: CryptoAlgorithmRSA_PSS::importKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:171: CryptoAlgorithmRSA_PSS::exportKey is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 11 in 72 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 14 2017-05-23 16:41:18 PDT
Comment on attachment 311064 [details] Patch for landing Rejecting attachment 311064 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'validate-changelog', '--check-oops', '--non-interactive', 311064, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit ChangeLog entry in Source/WTF/ChangeLog contains OOPS!. Full output: http://webkit-queues.webkit.org/results/3803267
Jiewen Tan
Comment 15 2017-05-23 17:33:32 PDT
JF Bastien
Comment 16 2017-06-01 15:44:31 PDT
Comment on attachment 310951 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310951&action=review > Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:58 > + CCCryptorStatus status = CCRSACryptorSign(key, ccRSAPSSPadding, digestData.data(), digestData.size(), digestAlgorithm, saltLength, signature.data(), &signatureSize); ccRSAPSSPadding here and line 80 isn't defined anywhere, this fails to compile.
Jiewen Tan
Comment 17 2017-06-01 16:01:37 PDT
(In reply to JF Bastien from comment #16) > Comment on attachment 310951 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=310951&action=review > > > Source/WebCore/crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:58 > > + CCCryptorStatus status = CCRSACryptorSign(key, ccRSAPSSPadding, digestData.data(), digestData.size(), digestAlgorithm, saltLength, signature.data(), &signatureSize); > > ccRSAPSSPadding here and line 80 isn't defined anywhere, this fails to > compile. I have added a flag HAVE_RSA_PSS to enable this for future OS release.
Note You need to log in before you can comment on or make changes to this bug.