diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-20 15:06:34 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-20 15:06:58 +0100 |
commit | 85dbc41dc67ff49fd8a843dbac5b8b5cb0b61155 (patch) | |
tree | 27cd179d2f98ef32ed27cb66589e44751135513e /src/import/import-job.h | |
parent | 88a1aadc48e5bbefd2e689db099569ec4c3c1e4b (diff) |
import: add a simple scheme for validating the SHA256 sums of downloaded raw files
Diffstat (limited to 'src/import/import-job.h')
-rw-r--r-- | src/import/import-job.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/import/import-job.h b/src/import/import-job.h index 843daa217c..9ccaaf2c04 100644 --- a/src/import/import-job.h +++ b/src/import/import-job.h @@ -23,6 +23,7 @@ #include <lzma.h> #include <zlib.h> +#include <gcrypt.h> #include "macro.h" #include "curl-util.h" @@ -42,6 +43,8 @@ typedef enum ImportJobState { _IMPORT_JOB_STATE_INVALID = -1, } ImportJobState; +#define IMPORT_JOB_STATE_IS_COMPLETE(j) (IN_SET((j)->state, IMPORT_JOB_DONE, IMPORT_JOB_FAILED)) + typedef enum ImportJobCompression { IMPORT_JOB_UNCOMPRESSED, IMPORT_JOB_XZ, @@ -66,6 +69,7 @@ struct ImportJob { char *etag; char **old_etags; + bool etag_exists; uint64_t content_length; uint64_t written_compressed; @@ -91,6 +95,11 @@ struct ImportJob { usec_t last_status_usec; bool allow_sparse; + + bool calc_hash; + gcry_md_hd_t hash_context; + + char *sha256; }; int import_job_new(ImportJob **job, const char *url, CurlGlue *glue, void *userdata); |