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
```
This commit is contained in:
Yu Watanabe 2018-07-09 05:40:01 +09:00 committed by Lennart Poettering
parent 82ec19a47d
commit eef836ed00
1 changed files with 3 additions and 0 deletions

View File

@ -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;