From: Yu Watanabe Date: Sun, 8 Jul 2018 20:40:01 +0000 (+0900) Subject: pull: initialize libgcrypt before calling any functions provided by libgcrypt X-Git-Tag: v240~983 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eef836ed0060519cf715f6b4dad7c2d5943deb98;p=thirdparty%2Fsystemd.git pull: initialize libgcrypt before calling any functions provided by libgcrypt This fixes the following warning: ``` systemd-pull[4065]: Libgcrypt warning: missing initialization - please fix the application ``` --- diff --git a/src/import/pull-job.c b/src/import/pull-job.c index 89dd20afa36..1f78f097185 100644 --- a/src/import/pull-job.c +++ b/src/import/pull-job.c @@ -4,6 +4,7 @@ #include "alloc-util.h" #include "fd-util.h" +#include "gcrypt-util.h" #include "hexdecoct.h" #include "import-util.h" #include "io-util.h" @@ -317,6 +318,8 @@ static int pull_job_open_disk(PullJob *j) { } if (j->calc_checksum) { + initialize_libgcrypt(false); + if (gcry_md_open(&j->checksum_context, GCRY_MD_SHA256, 0) != 0) { log_error("Failed to initialize hash context."); return -EIO;