mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Use #if for ENABLE_AF_ALG.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include "crypto_backend_internal.h"
|
||||
|
||||
#ifdef ENABLE_AF_ALG
|
||||
#if ENABLE_AF_ALG
|
||||
|
||||
#include <linux/if_alg.h>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ static int luks2_encrypt_to_storage(char *src, size_t srcLength,
|
||||
struct volume_key *vk, unsigned int sector,
|
||||
struct crypt_device *cd)
|
||||
{
|
||||
#ifndef ENABLE_AF_ALG /* Support for old kernel without Crypto API */
|
||||
#if !ENABLE_AF_ALG /* Support for old kernel without Crypto API */
|
||||
return LUKS_encrypt_to_storage(src, srcLength, cipher, cipher_mode, vk, sector, cd);
|
||||
#else
|
||||
struct crypt_storage *s;
|
||||
@@ -75,7 +75,7 @@ static int luks2_decrypt_from_storage(char *dst, size_t dstLength,
|
||||
unsigned int sector, struct crypt_device *cd)
|
||||
{
|
||||
struct device *device = crypt_metadata_device(cd);
|
||||
#ifndef ENABLE_AF_ALG /* Support for old kernel without Crypto API */
|
||||
#if !ENABLE_AF_ALG /* Support for old kernel without Crypto API */
|
||||
int r = device_read_lock(cd, device);
|
||||
if (r) {
|
||||
log_err(cd, _("Failed to acquire read lock on device %s."), device_path(device));
|
||||
|
||||
@@ -606,7 +606,7 @@ static int TCRYPT_init_hdr(struct crypt_device *cd,
|
||||
|
||||
if ((r < 0 && skipped && skipped == i) || r == -ENOTSUP) {
|
||||
log_err(cd, _("Required kernel crypto interface not available."));
|
||||
#ifdef ENABLE_AF_ALG
|
||||
#if ENABLE_AF_ALG
|
||||
log_err(cd, _("Ensure you have algif_skcipher kernel module loaded."));
|
||||
#endif
|
||||
r = -ENOTSUP;
|
||||
|
||||
@@ -1319,7 +1319,7 @@ static int action_benchmark(void)
|
||||
|
||||
if (r == -ENOTSUP) {
|
||||
log_err(_("Required kernel crypto interface not available."));
|
||||
#ifdef ENABLE_AF_ALG
|
||||
#if ENABLE_AF_ALG
|
||||
log_err( _("Ensure you have algif_skcipher kernel module loaded."));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ void tools_package_version(const char *name, bool use_pwlibs)
|
||||
#ifdef ENABLE_FIPS
|
||||
fips = true;
|
||||
#endif
|
||||
#ifdef ENABLE_AF_ALG
|
||||
#if ENABLE_AF_ALG
|
||||
kernel_capi = true;
|
||||
#endif
|
||||
#if defined(ENABLE_PWQUALITY)
|
||||
|
||||
@@ -1510,7 +1510,7 @@ static int memcmp_test(void)
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AF_ALG
|
||||
#if ENABLE_AF_ALG
|
||||
struct capi_test_vector {
|
||||
const char *name;
|
||||
const char *mode;
|
||||
@@ -1535,7 +1535,7 @@ static struct capi_test_vector capi_test_vectors[] = {
|
||||
|
||||
static int kernel_capi_check_test(void)
|
||||
{
|
||||
#ifdef ENABLE_AF_ALG
|
||||
#if ENABLE_AF_ALG
|
||||
unsigned int i;
|
||||
int r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user