[WinCairo] Add CryptoDigestOpenSSL
authoryoshiaki.jitsukawa@sony.com <yoshiaki.jitsukawa@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Sep 2018 05:33:52 +0000 (05:33 +0000)
committeryoshiaki.jitsukawa@sony.com <yoshiaki.jitsukawa@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Sep 2018 05:33:52 +0000 (05:33 +0000)
commit450aad92ea940bdfe618dcd6d3db66bbc0ff3f72
treee84a621c1c203cfeccccf533886f09f73af52409
parent7d7ccca9d105ba62252bb6445386b615fe8ccef7
[WinCairo] Add CryptoDigestOpenSSL
https://bugs.webkit.org/show_bug.cgi?id=188978

Reviewed by Darin Adler.

Source/WebCore/PAL:

Add a CryptoDigest implementation with OpenSSL/LibreSSL and let the
WinCairo port use it.

* pal/PlatformAppleWin.cmake: Add CryptoDigestWin.cpp to PAL_SOURCES
* pal/PlatformWin.cmake: Remove CryptoDigestWin.cpp from PAL_SOURCES
* pal/PlatformWinCairo.cmake: Add CryptoDigestOpenSSL to PAL_SOURCES
* pal/crypto/openssl/CryptoDigestOpenSSL.cpp: Added.
(PAL::toSHA1Context):
(PAL::toSHA224Context):
(PAL::toSHA256Context):
(PAL::toSHA384Context):
(PAL::toSHA512Context):
(PAL::CryptoDigest::CryptoDigest):
(PAL::CryptoDigest::~CryptoDigest):
(PAL::CryptoDigest::create):
(PAL::CryptoDigest::addBytes):
(PAL::CryptoDigest::computeHash):

Tools:

Add API tests for the PAL::CryptoDigest class.

* TestWebKitAPI/PlatformWin.cmake:
Add CryptoDigest.cpp to TestWebCoreLib_Sources.

Define -DSTATICALLY_LINKED_WITH_PAL=1 to avoid warnings since
without the definition the functions marked with PAL_EXPORT are supposed to be
imported from another shared library, but as it is, TestWebCoreLib
links PAL statically.

* TestWebKitAPI/Tests/WebCore/CryptoDigest.cpp: Added.
(TestWebKitAPI::toHex):
(TestWebKitAPI::expect):
(TestWebKitAPI::expectSHA1):
(TestWebKitAPI::expectSHA224):
(TestWebKitAPI::expectSHA256):
(TestWebKitAPI::expectSHA384):
(TestWebKitAPI::expectSHA512):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/PlatformAppleWin.cmake
Source/WebCore/PAL/pal/PlatformWin.cmake
Source/WebCore/PAL/pal/PlatformWinCairo.cmake
Source/WebCore/PAL/pal/crypto/openssl/CryptoDigestOpenSSL.cpp [new file with mode: 0644]
Tools/ChangeLog
Tools/TestWebKitAPI/PlatformWin.cmake
Tools/TestWebKitAPI/Tests/WebCore/CryptoDigest.cpp [new file with mode: 0644]