Bug 171230 - [GTK] Libgcrypt warning: missing initialization - please fix the application
Summary: [GTK] Libgcrypt warning: missing initialization - please fix the application
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-24 10:23 PDT by Carlos Alberto Lopez Perez
Modified: 2017-09-03 23:04 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.09 KB, patch)
2017-09-02 09:35 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (6.83 KB, patch)
2017-09-02 13:29 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2017-04-24 10:23:12 PDT
When running the WebKitGTK+ layout tests, the following warning appears on /var/log/user.log

   WebKitWebProcess: Libgcrypt warning: missing initialization - please fix the application
Comment 1 Michael Catanzaro 2017-09-01 07:01:23 PDT
I think the original warning was fixed in bug #173589.

But now we have a new one:

Sep 01 08:57:53 victory-road WebKitNetworkProcess[20806]: Libgcrypt warning: missing initialization - please fix the application

Seems like it's needed in network process too.
Comment 2 Zan Dobersek 2017-09-02 09:26:20 PDT
Most likely this is occurring due to PAL::CryptoDigest use in SoupNetworkSession.
Comment 3 Zan Dobersek 2017-09-02 09:35:11 PDT
Created attachment 319718 [details]
Patch
Comment 4 Michael Catanzaro 2017-09-02 10:11:33 PDT
Comment on attachment 319718 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=319718&action=review

Thanks!

> Source/WebKit/NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:56
> +#if USE(GCRYPT)
> +    // Call gcry_check_version() before any other libgcrypt call, ignoring the
> +    // returned version string.
> +    gcry_check_version(nullptr);
> +
> +    // Pre-allocate 16kB of secure memory and finish the initialization.
> +    gcry_control(GCRYCTL_INIT_SECMEM, 16384, nullptr);
> +    gcry_control(GCRYCTL_INITIALIZATION_FINISHED, nullptr);
> +#endif

We should move this down to PAL so we don't have to duplicate it in multiple places. Probably time to add a Source/WebCore/PAL/pal/crypto/gcrypt/Utilities.cpp.
Comment 5 Zan Dobersek 2017-09-02 13:29:15 PDT
Created attachment 319737 [details]
Patch
Comment 6 Michael Catanzaro 2017-09-02 15:54:39 PDT
Thanks. Please add it to https://trac.webkit.org/wiki/WebKitGTK/2.18.x after you land it.
Comment 7 Zan Dobersek 2017-09-03 23:04:42 PDT
Comment on attachment 319737 [details]
Patch

Clearing flags on attachment: 319737

Committed r221572: <http://trac.webkit.org/changeset/221572>
Comment 8 Zan Dobersek 2017-09-03 23:04:46 PDT
All reviewed patches have been landed.  Closing bug.