RESOLVED FIXED 206449
[OpenSSL] Add stubs and build for Web Crypto
https://bugs.webkit.org/show_bug.cgi?id=206449
Summary [OpenSSL] Add stubs and build for Web Crypto
Don Olmstead
Reported 2020-01-17 15:22:04 PST
Make Web Crypto build with OpenSSL.
Attachments
Patch (58.24 KB, patch)
2020-01-17 16:01 PST, Don Olmstead
no flags
Patch (58.24 KB, patch)
2020-01-17 16:05 PST, Don Olmstead
jiewen_tan: review+
Patch (58.87 KB, patch)
2020-01-22 17:34 PST, Don Olmstead
no flags
Don Olmstead
Comment 1 2020-01-17 16:01:29 PST
Don Olmstead
Comment 2 2020-01-17 16:05:03 PST
Created attachment 388107 [details] Patch Make style checker as happy as its realistically going to be.
Yoshiaki Jitsukawa
Comment 3 2020-01-17 16:33:49 PST
Comment on attachment 388107 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=388107&action=review > Source/WebCore/crypto/openssl/CryptoKeyRSAOpenSSL.cpp:56 > + notImplemented(); Shouldn't we call back the "failureCallback" just in case?
Jiewen Tan
Comment 4 2020-01-21 11:28:23 PST
Comment on attachment 388107 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=388107&action=review LGTM. r=me. Please address the following minor issues. > Source/WebCore/crypto/keys/CryptoKeyRSA.h:55 > +typedef std::unique_ptr<void*> PlatformRSAKeyContainer; PlatformRSAKey, I believe. > Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CBCOpenSSL.cpp:29 > +#if ENABLE(WEB_CRYPTO) I wonder after your change if this ENABLE macro is still needed. > Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp:29 > +#if ENABLE(WEB_CRYPTO) && HAVE(RSA_PSS) You probably don't need to include the HAVE(RSA_PSS) macro. And you probably need to set it to 1 for your ports.
Don Olmstead
Comment 5 2020-01-21 11:43:40 PST
Comment on attachment 388107 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=388107&action=review >> Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CBCOpenSSL.cpp:29 >> +#if ENABLE(WEB_CRYPTO) > > I wonder after your change if this ENABLE macro is still needed. WEB_CRYPTO can be enabled and disabled so all the .cpp files should technically have these blocks. >> Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp:29 >> +#if ENABLE(WEB_CRYPTO) && HAVE(RSA_PSS) > > You probably don't need to include the HAVE(RSA_PSS) macro. And you probably need to set it to 1 for your ports. It looks like this is OpenSSL 1.1.1 where support was added. Things get a bit more tricky with LibreSSL because it always reports as OpenSSL 2.0. When enabling this I think we need to do some kind of HAVE check within the CMake and I'd just want to put that off at the moment.
Jiewen Tan
Comment 6 2020-01-21 11:55:22 PST
(In reply to Don Olmstead from comment #5) > Comment on attachment 388107 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=388107&action=review > > >> Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CBCOpenSSL.cpp:29 > >> +#if ENABLE(WEB_CRYPTO) > > > > I wonder after your change if this ENABLE macro is still needed. > > WEB_CRYPTO can be enabled and disabled so all the .cpp files should > technically have these blocks. I think there is no points to have an ENABLE compile time flag if all ports have the implementation. > > >> Source/WebCore/crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp:29 > >> +#if ENABLE(WEB_CRYPTO) && HAVE(RSA_PSS) > > > > You probably don't need to include the HAVE(RSA_PSS) macro. And you probably need to set it to 1 for your ports. > > It looks like this is OpenSSL 1.1.1 where support was added. Things get a > bit more tricky with LibreSSL because it always reports as OpenSSL 2.0. When > enabling this I think we need to do some kind of HAVE check within the CMake > and I'd just want to put that off at the moment. Apple ports have this because RSA-PSS was added to CommonCrypto recently. Didn't know that OpenSSL has the same issue.
Don Olmstead
Comment 7 2020-01-22 17:34:36 PST
Don Olmstead
Comment 8 2020-01-22 17:37:02 PST
(In reply to Jiewen Tan from comment #6) > (In reply to Don Olmstead from comment #5) > > Comment on attachment 388107 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=388107&action=review > > > > >> Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CBCOpenSSL.cpp:29 > > >> +#if ENABLE(WEB_CRYPTO) > > > > > > I wonder after your change if this ENABLE macro is still needed. > > > > WEB_CRYPTO can be enabled and disabled so all the .cpp files should > > technically have these blocks. > > I think there is no points to have an ENABLE compile time flag if all ports > have the implementation. > I'd be happy to remove the ENABLE flags after there's actual implementations for everything.
Jiewen Tan
Comment 9 2020-01-22 17:39:48 PST
(In reply to Don Olmstead from comment #8) > (In reply to Jiewen Tan from comment #6) > > (In reply to Don Olmstead from comment #5) > > > Comment on attachment 388107 [details] > > > Patch > > > > > > View in context: > > > https://bugs.webkit.org/attachment.cgi?id=388107&action=review > > > > > > >> Source/WebCore/crypto/openssl/CryptoAlgorithmAES_CBCOpenSSL.cpp:29 > > > >> +#if ENABLE(WEB_CRYPTO) > > > > > > > > I wonder after your change if this ENABLE macro is still needed. > > > > > > WEB_CRYPTO can be enabled and disabled so all the .cpp files should > > > technically have these blocks. > > > > I think there is no points to have an ENABLE compile time flag if all ports > > have the implementation. > > > > I'd be happy to remove the ENABLE flags after there's actual implementations > for everything. Great!
WebKit Commit Bot
Comment 10 2020-01-22 18:44:32 PST
The commit-queue encountered the following flaky tests while processing attachment 388495 [details]: imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html bug 201481 (authors: shvaikalesh@gmail.com and youennf@gmail.com) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 11 2020-01-22 18:45:24 PST
Comment on attachment 388495 [details] Patch Clearing flags on attachment: 388495 Committed r254958: <https://trac.webkit.org/changeset/254958>
WebKit Commit Bot
Comment 12 2020-01-22 18:45:26 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 13 2020-01-22 18:46:12 PST
Note You need to log in before you can comment on or make changes to this bug.