From: Lennart Poettering Date: Mon, 4 Dec 2023 17:12:58 +0000 (+0100) Subject: dissect-image: add a new helper that checks if VeritySettings has anything set at all X-Git-Tag: v256-rc1~283^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77740bddbe0b79450a76552cf0810ae791b23a78;p=thirdparty%2Fsystemd.git dissect-image: add a new helper that checks if VeritySettings has anything set at all --- diff --git a/src/shared/dissect-image.h b/src/shared/dissect-image.h index 416c9cb46b0..d1f5b2c5802 100644 --- a/src/shared/dissect-image.h +++ b/src/shared/dissect-image.h @@ -199,6 +199,14 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(DecryptedImage*, decrypted_image_unref); int dissected_image_relinquish(DissectedImage *m); int verity_settings_load(VeritySettings *verity, const char *image, const char *root_hash_path, const char *root_hash_sig_path); + +static inline bool verity_settings_set(const VeritySettings *settings) { + return settings && + (settings->root_hash_size > 0 || + (settings->root_hash_sig_size > 0 || + settings->data_path)); +} + void verity_settings_done(VeritySettings *verity); static inline bool verity_settings_data_covers(const VeritySettings *verity, PartitionDesignator d) {