<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:mcatanzaro@igalia.com" title="Michael Catanzaro <mcatanzaro@igalia.com>"> <span class="fn">Michael Catanzaro</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Use libgcrypt instead of GnuTLS for CryptoDigest and SubtleCrypto HMAC implementation"
href="https://bugs.webkit.org/show_bug.cgi?id=163125">bug 163125</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #290961 Flags</td>
<td>review?, commit-queue?
</td>
<td>review+, commit-queue-
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Use libgcrypt instead of GnuTLS for CryptoDigest and SubtleCrypto HMAC implementation"
href="https://bugs.webkit.org/show_bug.cgi?id=163125#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Use libgcrypt instead of GnuTLS for CryptoDigest and SubtleCrypto HMAC implementation"
href="https://bugs.webkit.org/show_bug.cgi?id=163125">bug 163125</a>
from <span class="vcard"><a class="email" href="mailto:mcatanzaro@igalia.com" title="Michael Catanzaro <mcatanzaro@igalia.com>"> <span class="fn">Michael Catanzaro</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=290961&action=diff" name="attach_290961" title="Patch">attachment 290961</a> <a href="attachment.cgi?id=290961&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=290961&action=review">https://bugs.webkit.org/attachment.cgi?id=290961&action=review</a>
Thanks for working on this! I'm giving r+ but with several things that need fixed before committing:
<span class="quote">> Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:3
> + * Copyright (C) 2014 Igalia S.L. All rights reserved.
> + * Copyright (C) 2016 SoftAtHome. All rights reserved.</span >
Please remove the "All rights reserved" since that contradicts the license right below.
<span class="quote">> Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:81
> + UNUSED_PARAM(failureCallback);
> + int algorithm = getGCryptDigestAlgorithm(parameters.hash);
> + if (algorithm == GCRY_MAC_NONE) {
> + ec = NOT_SUPPORTED_ERR;
> + return;</span >
You don't need to call failureCallback when the function fails...?
<span class="quote">> Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:91
> + UNUSED_PARAM(failureCallback);</span >
Ditto?
<span class="quote">> Source/WebCore/platform/crypto/gcrypt/CryptoDigestGCrypt.cpp:3
> + * Copyright (C) 2014 Igalia S.L. All rights reserved.
> + * Copyright (C) 2016 SoftAtHome. All rights reserved.</span >
Ditto.
<span class="quote">> Source/WebCore/platform/crypto/gcrypt/CryptoDigestGCrypt.cpp:73
> + switch (algorithm) {
> + case CryptoDigest::Algorithm::SHA_1: {
> + gcryptAlgorithm = GCRY_MD_SHA1;
> + break;
> + }
> + case CryptoDigest::Algorithm::SHA_224: {
> + gcryptAlgorithm = GCRY_MD_SHA224;
> + break;
> + }
> + case CryptoDigest::Algorithm::SHA_256: {
> + gcryptAlgorithm = GCRY_MD_SHA256;
> + break;
> + }
> + case CryptoDigest::Algorithm::SHA_384: {
> + gcryptAlgorithm = GCRY_MD_SHA384;
> + break;
> + }
> + case CryptoDigest::Algorithm::SHA_512: {
> + gcryptAlgorithm = GCRY_MD_SHA512;
> + break;
> + }
> + }</span >
You don't need the extra braces around the cases here, since you're not declaring any variables in the cases.
<span class="quote">> Source/cmake/FindGCrypt.cmake:23
> + # set(GCRYPT_FOUND TRUE)</span >
Well that's not right, did you comment it out for testing? Or was it broken already when you copied it from wherever its upstream is?
<span class="quote">> Source/cmake/FindGCrypt.cmake:70
> +endif (GCRYPT_LIBRARIES AND GCRYPT_INCLUDE_DIRS)</span >
WebKit CMake style is endif ()
<span class="quote">> Source/cmake/OptionsGTK.cmake:35
> +find_package(GCrypt REQUIRED)</span >
All the functions you used were available in the first release of GCrypt?
<span class="quote">> Tools/ChangeLog:8
> + * gtk/install-dependencies: List libgcrypt for WebKitGTK+ build, and gnutls for jhbuild only.</span >
Er, why keep GnuTLS? You've completely removed the dependency, so you can get rid of it, right?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>