<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:mcatanzaro&#64;igalia.com" title="Michael Catanzaro &lt;mcatanzaro&#64;igalia.com&gt;"> <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&#64;igalia.com" title="Michael Catanzaro &lt;mcatanzaro&#64;igalia.com&gt;"> <span class="fn">Michael Catanzaro</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=290961&amp;action=diff" name="attach_290961" title="Patch">attachment 290961</a> <a href="attachment.cgi?id=290961&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=290961&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=290961&amp;action=review</a>

Thanks for working on this! I'm giving r+ but with several things that need fixed before committing:

<span class="quote">&gt; Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:3
&gt; + * Copyright (C) 2014 Igalia S.L. All rights reserved.
&gt; + * Copyright (C) 2016 SoftAtHome. All rights reserved.</span >

Please remove the &quot;All rights reserved&quot; since that contradicts the license right below.

<span class="quote">&gt; Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:81
&gt; +    UNUSED_PARAM(failureCallback);
&gt; +    int algorithm = getGCryptDigestAlgorithm(parameters.hash);
&gt; +    if (algorithm == GCRY_MAC_NONE) {
&gt; +        ec = NOT_SUPPORTED_ERR;
&gt; +        return;</span >

You don't need to call failureCallback when the function fails...?

<span class="quote">&gt; Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:91
&gt; +    UNUSED_PARAM(failureCallback);</span >

Ditto?

<span class="quote">&gt; Source/WebCore/platform/crypto/gcrypt/CryptoDigestGCrypt.cpp:3
&gt; + * Copyright (C) 2014 Igalia S.L. All rights reserved.
&gt; + * Copyright (C) 2016 SoftAtHome. All rights reserved.</span >

Ditto.

<span class="quote">&gt; Source/WebCore/platform/crypto/gcrypt/CryptoDigestGCrypt.cpp:73
&gt; +    switch (algorithm) {
&gt; +    case CryptoDigest::Algorithm::SHA_1: {
&gt; +        gcryptAlgorithm = GCRY_MD_SHA1;
&gt; +        break;
&gt; +    }
&gt; +    case CryptoDigest::Algorithm::SHA_224: {
&gt; +        gcryptAlgorithm = GCRY_MD_SHA224;
&gt; +        break;
&gt; +    }
&gt; +    case CryptoDigest::Algorithm::SHA_256: {
&gt; +        gcryptAlgorithm = GCRY_MD_SHA256;
&gt; +        break;
&gt; +    }
&gt; +    case CryptoDigest::Algorithm::SHA_384: {
&gt; +        gcryptAlgorithm = GCRY_MD_SHA384;
&gt; +        break;
&gt; +    }
&gt; +    case CryptoDigest::Algorithm::SHA_512: {
&gt; +        gcryptAlgorithm = GCRY_MD_SHA512;
&gt; +        break;
&gt; +    }
&gt; +    }</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">&gt; Source/cmake/FindGCrypt.cmake:23
&gt; +    # 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">&gt; Source/cmake/FindGCrypt.cmake:70
&gt; +endif (GCRYPT_LIBRARIES AND GCRYPT_INCLUDE_DIRS)</span >

WebKit CMake style is endif ()

<span class="quote">&gt; Source/cmake/OptionsGTK.cmake:35
&gt; +find_package(GCrypt REQUIRED)</span >

All the functions you used were available in the first release of GCrypt?

<span class="quote">&gt; Tools/ChangeLog:8
&gt; +        * 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>