From eef836ed0060519cf715f6b4dad7c2d5943deb98 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 9 Jul 2018 05:40:01 +0900 Subject: [PATCH] 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 ``` --- src/import/pull-job.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/import/pull-job.c b/src/import/pull-job.c index 89dd20afa3..1f78f09718 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;