diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2018-01-11 05:56:18 +0300 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-11 10:25:26 +0000 |
commit | 79143ccfc158ec4fffc49eee600d600edb342b16 (patch) | |
tree | 0e078499d8fe3e8627e3612537e61f2dd1029625 /Source/WebCore/crypto | |
parent | cb895f50d5c08976c0f5ecbb82e6bd19d9ea090d (diff) |
Import WebKit commit a8b574fb3cd509a2d3f2a1568ad0a66d1bf0f6e8
Change-Id: I66add69e6d08b74111ec8e7e4401e4d813501206
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/crypto')
6 files changed, 5 insertions, 62 deletions
diff --git a/Source/WebCore/crypto/CryptoDigest.h b/Source/WebCore/crypto/CryptoDigest.h deleted file mode 100644 index 353b13e82..000000000 --- a/Source/WebCore/crypto/CryptoDigest.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2013 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef CryptoDigest_h -#define CryptoDigest_h - -#include "CryptoAlgorithmIdentifier.h" -#include <wtf/Noncopyable.h> -#include <wtf/Vector.h> - -#if ENABLE(SUBTLE_CRYPTO) - -namespace WebCore { - -struct CryptoDigestContext; - -class CryptoDigest { - WTF_MAKE_NONCOPYABLE(CryptoDigest); -public: - static std::unique_ptr<CryptoDigest> create(CryptoAlgorithmIdentifier); - ~CryptoDigest(); - - void addBytes(const void* input, size_t length); - Vector<uint8_t> computeHash(); - -private: - CryptoDigest(); - - std::unique_ptr<CryptoDigestContext> m_context; -}; - -} // namespace WebCore - -#endif // ENABLE(SUBTLE_CRYPTO) -#endif // CryptoDigest_h diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp index bc94aa3de..54dcd03fb 100644 --- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp +++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp @@ -54,7 +54,7 @@ CryptoAlgorithmIdentifier CryptoAlgorithmSHA1::identifier() const void CryptoAlgorithmSHA1::digest(const CryptoAlgorithmParameters&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback, ExceptionCode&) { - std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoAlgorithmIdentifier::SHA_1); + std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_1); if (!digest) { failureCallback(); return; diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp index 62cc5a8c2..3878227d9 100644 --- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp +++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp @@ -54,7 +54,7 @@ CryptoAlgorithmIdentifier CryptoAlgorithmSHA224::identifier() const void CryptoAlgorithmSHA224::digest(const CryptoAlgorithmParameters&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback, ExceptionCode&) { - std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoAlgorithmIdentifier::SHA_224); + std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_224); if (!digest) { failureCallback(); return; diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp index 27fe8aa0a..0acaf0905 100644 --- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp +++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp @@ -54,7 +54,7 @@ CryptoAlgorithmIdentifier CryptoAlgorithmSHA256::identifier() const void CryptoAlgorithmSHA256::digest(const CryptoAlgorithmParameters&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback, ExceptionCode&) { - std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoAlgorithmIdentifier::SHA_256); + std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_256); if (!digest) { failureCallback(); return; diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp index 6eba234f3..b1bfbe157 100644 --- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp +++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp @@ -54,7 +54,7 @@ CryptoAlgorithmIdentifier CryptoAlgorithmSHA384::identifier() const void CryptoAlgorithmSHA384::digest(const CryptoAlgorithmParameters&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback, ExceptionCode&) { - std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoAlgorithmIdentifier::SHA_384); + std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_384); if (!digest) { failureCallback(); return; diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp index 87d62d445..7ddf1d4d2 100644 --- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp +++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp @@ -54,7 +54,7 @@ CryptoAlgorithmIdentifier CryptoAlgorithmSHA512::identifier() const void CryptoAlgorithmSHA512::digest(const CryptoAlgorithmParameters&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback, ExceptionCode&) { - std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoAlgorithmIdentifier::SHA_512); + std::unique_ptr<CryptoDigest> digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_512); if (!digest) { failureCallback(); return; |