From e35b25e6c0ff71f2d514bf08ba4a4b6790d53621 Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Fri, 20 Oct 2023 11:30:25 -0400 Subject: [PATCH] luks-fs-mgr: fix compilation errors * Add missing includes * Suppress "unused parameter" warnings because this project is built with -Werror TESTS ============================ * Reproduce the build error * Apply this fix, rebuild and make sure it compiles w/o issues Closes-Bug: 2039980 Signed-off-by: Davlet Panech Change-Id: I05bf30845d775e9d754fb61625d2eb13c3712d47 --- filesystem/luks/src/encryption/PassphraseGenerator.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/filesystem/luks/src/encryption/PassphraseGenerator.cpp b/filesystem/luks/src/encryption/PassphraseGenerator.cpp index 47fb14db9..d89a7e061 100644 --- a/filesystem/luks/src/encryption/PassphraseGenerator.cpp +++ b/filesystem/luks/src/encryption/PassphraseGenerator.cpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include "PassphraseGenerator.h" using namespace std; @@ -78,6 +80,10 @@ class HWIDPassphraseGenerator : public PassphraseGenerator { class SGXPassphraseGenerator : public PassphraseGenerator { public: bool generatePassphrase(string &shaPhrase) override { + // Pretend like shaPhrase is used, to avoid getting the + // "unused parameter" message from the compiler, which results in + // compliation errors due to -Werror. + (void)shaPhrase; // Implement SGX-based passphrase generation // Replace this with actual generated passphrase return "sgx_generated_passphrase"; @@ -88,6 +94,10 @@ class SGXPassphraseGenerator : public PassphraseGenerator { class TPMPassphraseGenerator : public PassphraseGenerator { public: bool generatePassphrase(string &shaPhrase) override { + // Pretend like shaPhrase is used, to avoid getting the + // "unused parameter" message from the compiler, which results in + // compliation errors due to -Werror. + (void)shaPhrase; // Implement TPM-based passphrase generation // Replace this with actual generated passphrase return "tpm_generated_passphrase";