shared: Clean up includes

Split out of #37344.
This commit is contained in:
Daan De Meyer
2025-05-24 14:00:44 +02:00
parent 9d75fb9647
commit 69a283c5f2
394 changed files with 1181 additions and 1903 deletions
+12 -4
View File
@@ -2,16 +2,16 @@
#include "sd-json.h"
#include "alloc-util.h"
#include "ask-password-api.h"
#include "cryptsetup-fido2.h"
#include "cryptsetup-util.h"
#include "env-util.h"
#include "fido2-util.h"
#include "fileio.h"
#include "hexdecoct.h"
#include "iovec-util.h"
#include "libfido2-util.h"
#include "parse-util.h"
#include "random-util.h"
#include "log.h"
#include "strv.h"
int acquire_fido2_key(
@@ -32,6 +32,7 @@ int acquire_fido2_key(
void **ret_decrypted_key,
size_t *ret_decrypted_key_size) {
#if HAVE_LIBCRYPTSETUP && HAVE_LIBFIDO2
_cleanup_(erase_and_freep) char *envpw = NULL;
_cleanup_strv_free_erase_ char **pins = NULL;
_cleanup_(iovec_done_erase) struct iovec loaded_salt = {};
@@ -128,6 +129,9 @@ int acquire_fido2_key(
askpw_flags &= ~ASK_PASSWORD_ACCEPT_CACHED;
}
#else
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "FIDO2 token support not available.");
#endif
}
int acquire_fido2_key_auto(
@@ -141,6 +145,7 @@ int acquire_fido2_key_auto(
void **ret_decrypted_key,
size_t *ret_decrypted_key_size) {
#if HAVE_LIBCRYPTSETUP && HAVE_LIBFIDO2
_cleanup_free_ void *cid = NULL;
size_t cid_size = 0;
int r, ret = -ENOENT;
@@ -276,4 +281,7 @@ int acquire_fido2_key_auto(
log_info("Unlocked volume via automatically discovered security FIDO2 token.");
return ret;
#else
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "FIDO2 token support not available.");
#endif
}