Changeset 173872 in webkit
- Timestamp:
- Sep 23, 2014 8:17:52 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r173867 r173872 1 2014-09-23 Eduardo Lima Mitev <elima@igalia.com> 2 3 [GTK] Adds implementation of Subtle Crypto digest algorithms 4 https://bugs.webkit.org/show_bug.cgi?id=133319 5 6 Leaves all crypto/subtle tests skipped and whitelist only those related to 7 digest algorithms (sha-*.html). When enough crypto algorithms are implemented, 8 we can invert the approach and blacklist only those tests whose algorithms are 9 not implemented. 10 11 Reviewed by Philippe Normand. 12 13 * platform/gtk/TestExpectations: Unskip tests for Subtle-Crypto digest algorithms. 14 1 15 2014-09-23 Ion Rosca <rosca@adobe.com> 2 16 -
trunk/LayoutTests/platform/gtk/TestExpectations
- Property svn:executable deleted
r173809 r173872 356 356 webkit.org/b/117975 fast/text/international/synthesized-italic-vertical-latin.html [ Skip ] 357 357 358 # crypto.subtle is not yet enabled 359 Bug(GTK) crypto/subtle [ Skip ] 358 # crypto.subtle is not yet enabled, but digest algorithms are already implemented 359 # and their tests are whitelisted 360 webkit.org/b/133122 crypto/subtle [ Skip ] 361 webkit.org/b/133319 crypto/subtle/sha-1.html [ Pass ] 362 webkit.org/b/133319 crypto/subtle/sha-224.html [ Pass ] 363 webkit.org/b/133319 crypto/subtle/sha-256.html [ Pass ] 364 webkit.org/b/133319 crypto/subtle/sha-384.html [ Pass ] 365 webkit.org/b/133319 crypto/subtle/sha-512.html [ Pass ] 360 366 361 367 # QuickTime plug-in not relevant to this port -
trunk/Source/WebCore/ChangeLog
r173868 r173872 1 2014-09-23 Eduardo Lima Mitev <elima@igalia.com> 2 3 [GTK] Adds implementation of Subtle Crypto digest algorithms 4 https://bugs.webkit.org/show_bug.cgi?id=133319 5 6 Reviewed by Philippe Normand. 7 8 Tests are already in place under crypto/subtle/sha-*.html 9 10 * crypto/gtk/CryptoDigestGtk.cpp: 11 (WebCore::CryptoDigest::CryptoDigest): 12 (WebCore::CryptoDigest::~CryptoDigest): 13 (WebCore::CryptoDigest::create): 14 (WebCore::CryptoDigest::addBytes): 15 (WebCore::CryptoDigest::computeHash): 16 1 17 2014-09-15 Sergio Villar Senin <svillar@igalia.com> 2 18 -
trunk/Source/WebCore/crypto/gtk/CryptoDigestGtk.cpp
r172389 r173872 29 29 #if ENABLE(SUBTLE_CRYPTO) 30 30 31 #include "NotImplemented.h" 31 #include <gnutls/gnutls.h> 32 #include <gnutls/crypto.h> 32 33 33 34 namespace WebCore { 34 35 35 36 struct CryptoDigestContext { 37 gnutls_digest_algorithm_t algorithm; 38 gnutls_hash_hd_t hash; 36 39 }; 37 40 … … 39 42 : m_context(new CryptoDigestContext) 40 43 { 41 notImplemented();42 44 } 43 45 44 46 CryptoDigest::~CryptoDigest() 45 47 { 46 notImplemented();48 gnutls_hash_deinit(m_context->hash, 0); 47 49 } 48 49 50 50 51 std::unique_ptr<CryptoDigest> CryptoDigest::create(CryptoAlgorithmIdentifier algorithm) 51 52 { 52 notImplemented(); 53 UNUSED_PARAM(algorithm); 53 gnutls_digest_algorithm_t gnutlsAlgorithm; 54 54 55 return 0; 55 switch (algorithm) { 56 case CryptoAlgorithmIdentifier::SHA_1: { 57 gnutlsAlgorithm = GNUTLS_DIG_SHA1; 58 break; 59 } 60 case CryptoAlgorithmIdentifier::SHA_224: { 61 gnutlsAlgorithm = GNUTLS_DIG_SHA224; 62 break; 63 } 64 case CryptoAlgorithmIdentifier::SHA_256: { 65 gnutlsAlgorithm = GNUTLS_DIG_SHA256; 66 break; 67 } 68 case CryptoAlgorithmIdentifier::SHA_384: { 69 gnutlsAlgorithm = GNUTLS_DIG_SHA384; 70 break; 71 } 72 case CryptoAlgorithmIdentifier::SHA_512: { 73 gnutlsAlgorithm = GNUTLS_DIG_SHA512; 74 break; 75 } 76 default: 77 return nullptr; 78 } 79 80 std::unique_ptr<CryptoDigest> digest(new CryptoDigest); 81 digest->m_context->algorithm = gnutlsAlgorithm; 82 83 int ret = gnutls_hash_init(&digest->m_context->hash, gnutlsAlgorithm); 84 if (ret != GNUTLS_E_SUCCESS) 85 return nullptr; 86 87 return digest; 56 88 } 57 89 58 90 void CryptoDigest::addBytes(const void* input, size_t length) 59 91 { 60 notImplemented(); 61 UNUSED_PARAM(input); 62 UNUSED_PARAM(length); 92 gnutls_hash(m_context->hash, input, length); 63 93 } 64 94 65 95 Vector<uint8_t> CryptoDigest::computeHash() 66 96 { 67 notImplemented(); 68 Vector<uint8_t> result(0); 97 Vector<uint8_t> result; 98 int digestLen = gnutls_hash_get_len(m_context->algorithm); 99 result.resize(digestLen); 100 101 gnutls_hash_output(m_context->hash, result.data()); 102 69 103 return result; 70 104 }
Note: See TracChangeset
for help on using the changeset viewer.