"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/internal.h" between
cryptsetup-2.3.6.tar.xz and cryptsetup-2.4.0.tar.xz

About: cryptsetup is a utility used to conveniently setup disk encryption based on the dm-crypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt compatible format.

internal.h  (cryptsetup-2.3.6.tar.xz):internal.h  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 44 skipping to change at line 44
#include "nls.h" #include "nls.h"
#include "bitops.h" #include "bitops.h"
#include "utils_blkid.h" #include "utils_blkid.h"
#include "utils_crypt.h" #include "utils_crypt.h"
#include "utils_loop.h" #include "utils_loop.h"
#include "utils_dm.h" #include "utils_dm.h"
#include "utils_fips.h" #include "utils_fips.h"
#include "utils_keyring.h" #include "utils_keyring.h"
#include "utils_io.h" #include "utils_io.h"
#include "crypto_backend.h" #include "crypto_backend/crypto_backend.h"
#include "utils_storage_wrappers.h" #include "utils_storage_wrappers.h"
#include "libcryptsetup.h" #include "libcryptsetup.h"
/* to silent gcc -Wcast-qual for const cast */ #include "libcryptsetup_macros.h"
#define CONST_CAST(x) (x)(uintptr_t) #include "libcryptsetup_symver.h"
#define SHIFT_4K 12
#define SECTOR_SHIFT 9
#define SECTOR_SIZE (1 << SECTOR_SHIFT)
#define MAX_SECTOR_SIZE 4096 /* min page size among all platforms
*/
#define DEFAULT_DISK_ALIGNMENT 1048576 /* 1MiB */
#define DEFAULT_MEM_ALIGNMENT 4096
#define LOG_MAX_LEN 4096 #define LOG_MAX_LEN 4096
#define MAX_DM_DEPS 32 #define MAX_DM_DEPS 32
#define CRYPT_SUBDEV "SUBDEV" /* prefix for sublayered devices underne ath public crypt types */ #define CRYPT_SUBDEV "SUBDEV" /* prefix for sublayered devices underne ath public crypt types */
#define at_least(a, b) ({ __typeof__(a) __at_least = (a); (__at_least >= (b))?__
at_least:(b); })
#define MISALIGNED(a, b) ((a) & ((b) - 1))
#define MISALIGNED_4K(a) MISALIGNED((a), 1 << SHIFT_4K)
#define MISALIGNED_512(a) MISALIGNED((a), 1 << SECTOR_SHIFT)
#define NOTPOW2(a) MISALIGNED((a), (a))
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#endif
#define MOVE_REF(x, y) \
do { \
typeof (x) *_px = &(x), *_py = &(y); \
*_px = *_py; \
*_py = NULL; \
} while (0)
#ifndef O_CLOEXEC #ifndef O_CLOEXEC
#define O_CLOEXEC 0 #define O_CLOEXEC 0
#endif #endif
struct crypt_device; struct crypt_device;
struct luks2_reenc_context; struct luks2_reencrypt;
struct volume_key { struct volume_key {
int id; int id;
size_t keylength; size_t keylength;
const char *key_description; const char *key_description;
struct volume_key *next; struct volume_key *next;
char key[]; char key[];
}; };
struct volume_key *crypt_alloc_volume_key(size_t keylength, const char *key); struct volume_key *crypt_alloc_volume_key(size_t keylength, const char *key);
skipping to change at line 147 skipping to change at line 123
void device_disable_direct_io(struct device *device); void device_disable_direct_io(struct device *device);
int device_is_identical(struct device *device1, struct device *device2); int device_is_identical(struct device *device1, struct device *device2);
int device_is_rotational(struct device *device); int device_is_rotational(struct device *device);
size_t device_alignment(struct device *device); size_t device_alignment(struct device *device);
int device_direct_io(const struct device *device); int device_direct_io(const struct device *device);
int device_fallocate(struct device *device, uint64_t size); int device_fallocate(struct device *device, uint64_t size);
void device_sync(struct crypt_device *cd, struct device *device); void device_sync(struct crypt_device *cd, struct device *device);
int device_check_size(struct crypt_device *cd, int device_check_size(struct crypt_device *cd,
struct device *device, struct device *device,
uint64_t req_offset, int falloc); uint64_t req_offset, int falloc);
void device_set_block_size(struct device *device, size_t size);
size_t device_optimal_encryption_sector_size(struct crypt_device *cd, struct dev
ice *device);
int device_open_locked(struct crypt_device *cd, struct device *device, int flags ); int device_open_locked(struct crypt_device *cd, struct device *device, int flags );
int device_read_lock(struct crypt_device *cd, struct device *device); int device_read_lock(struct crypt_device *cd, struct device *device);
int device_write_lock(struct crypt_device *cd, struct device *device); int device_write_lock(struct crypt_device *cd, struct device *device);
void device_read_unlock(struct crypt_device *cd, struct device *device); void device_read_unlock(struct crypt_device *cd, struct device *device);
void device_write_unlock(struct crypt_device *cd, struct device *device); void device_write_unlock(struct crypt_device *cd, struct device *device);
bool device_is_locked(struct device *device); bool device_is_locked(struct device *device);
enum devcheck { DEV_OK = 0, DEV_EXCL = 1 }; enum devcheck { DEV_OK = 0, DEV_EXCL = 1 };
int device_check_access(struct crypt_device *cd, int device_check_access(struct crypt_device *cd,
skipping to change at line 187 skipping to change at line 165
int crypt_confirm(struct crypt_device *cd, const char *msg); int crypt_confirm(struct crypt_device *cd, const char *msg);
char *crypt_lookup_dev(const char *dev_id); char *crypt_lookup_dev(const char *dev_id);
int crypt_dev_is_rotational(int major, int minor); int crypt_dev_is_rotational(int major, int minor);
int crypt_dev_is_partition(const char *dev_path); int crypt_dev_is_partition(const char *dev_path);
char *crypt_get_partition_device(const char *dev_path, uint64_t offset, uint64_t size); char *crypt_get_partition_device(const char *dev_path, uint64_t offset, uint64_t size);
char *crypt_get_base_device(const char *dev_path); char *crypt_get_base_device(const char *dev_path);
uint64_t crypt_dev_partition_offset(const char *dev_path); uint64_t crypt_dev_partition_offset(const char *dev_path);
int lookup_by_disk_id(const char *dm_uuid); int lookup_by_disk_id(const char *dm_uuid);
int lookup_by_sysfs_uuid_field(const char *dm_uuid, size_t max_len); int lookup_by_sysfs_uuid_field(const char *dm_uuid);
int crypt_uuid_cmp(const char *dm_uuid, const char *hdr_uuid); int crypt_uuid_cmp(const char *dm_uuid, const char *hdr_uuid);
size_t crypt_getpagesize(void); size_t crypt_getpagesize(void);
unsigned crypt_cpusonline(void); unsigned crypt_cpusonline(void);
uint64_t crypt_getphysmemory_kb(void); uint64_t crypt_getphysmemory_kb(void);
int init_crypto(struct crypt_device *ctx); int init_crypto(struct crypt_device *ctx);
void logger(struct crypt_device *cd, int level, const char *file, int line, cons #define log_dbg(c, x...) crypt_logf(c, CRYPT_LOG_DEBUG, x)
t char *format, ...) __attribute__ ((format (printf, 5, 6))); #define log_std(c, x...) crypt_logf(c, CRYPT_LOG_NORMAL, x)
#define log_dbg(c, x...) logger(c, CRYPT_LOG_DEBUG, __FILE__, __LINE__, x) #define log_verbose(c, x...) crypt_logf(c, CRYPT_LOG_VERBOSE, x)
#define log_std(c, x...) logger(c, CRYPT_LOG_NORMAL, __FILE__, __LINE__, x) #define log_err(c, x...) crypt_logf(c, CRYPT_LOG_ERROR, x)
#define log_verbose(c, x...) logger(c, CRYPT_LOG_VERBOSE, __FILE__, __LINE__, x)
#define log_err(c, x...) logger(c, CRYPT_LOG_ERROR, __FILE__, __LINE__, x)
int crypt_get_debug_level(void); int crypt_get_debug_level(void);
int crypt_memlock_inc(struct crypt_device *ctx); int crypt_memlock_inc(struct crypt_device *ctx);
int crypt_memlock_dec(struct crypt_device *ctx); int crypt_memlock_dec(struct crypt_device *ctx);
int crypt_metadata_locking_enabled(void); int crypt_metadata_locking_enabled(void);
int crypt_random_init(struct crypt_device *ctx); int crypt_random_init(struct crypt_device *ctx);
int crypt_random_get(struct crypt_device *ctx, char *buf, size_t len, int qualit y); int crypt_random_get(struct crypt_device *ctx, char *buf, size_t len, int qualit y);
skipping to change at line 225 skipping to change at line 202
const char *hash_name, const char *hash_name,
char *key, size_t key_size, char *key, size_t key_size,
const char *passphrase, size_t passphrase_size); const char *passphrase, size_t passphrase_size);
int PLAIN_activate(struct crypt_device *cd, int PLAIN_activate(struct crypt_device *cd,
const char *name, const char *name,
struct volume_key *vk, struct volume_key *vk,
uint64_t size, uint64_t size,
uint32_t flags); uint32_t flags);
void *crypt_get_hdr(struct crypt_device *cd, const char *type); void *crypt_get_hdr(struct crypt_device *cd, const char *type);
void crypt_set_reenc_context(struct crypt_device *cd, struct luks2_reenc_context void crypt_set_luks2_reencrypt(struct crypt_device *cd, struct luks2_reencrypt *
*rh); rh);
struct luks2_reenc_context *crypt_get_reenc_context(struct crypt_device *cd); struct luks2_reencrypt *crypt_get_luks2_reencrypt(struct crypt_device *cd);
int onlyLUKS2(struct crypt_device *cd); int onlyLUKS2(struct crypt_device *cd);
int onlyLUKS2mask(struct crypt_device *cd, uint32_t mask); int onlyLUKS2mask(struct crypt_device *cd, uint32_t mask);
int crypt_wipe_device(struct crypt_device *cd, int crypt_wipe_device(struct crypt_device *cd,
struct device *device, struct device *device,
crypt_wipe_pattern pattern, crypt_wipe_pattern pattern,
uint64_t offset, uint64_t offset,
uint64_t length, uint64_t length,
size_t wipe_block_size, size_t wipe_block_size,
skipping to change at line 252 skipping to change at line 229
int crypt_get_integrity_key_size(struct crypt_device *cd); int crypt_get_integrity_key_size(struct crypt_device *cd);
int crypt_get_integrity_tag_size(struct crypt_device *cd); int crypt_get_integrity_tag_size(struct crypt_device *cd);
int crypt_key_in_keyring(struct crypt_device *cd); int crypt_key_in_keyring(struct crypt_device *cd);
void crypt_set_key_in_keyring(struct crypt_device *cd, unsigned key_in_keyring); void crypt_set_key_in_keyring(struct crypt_device *cd, unsigned key_in_keyring);
int crypt_volume_key_load_in_keyring(struct crypt_device *cd, struct volume_key *vk); int crypt_volume_key_load_in_keyring(struct crypt_device *cd, struct volume_key *vk);
int crypt_use_keyring_for_vk(struct crypt_device *cd); int crypt_use_keyring_for_vk(struct crypt_device *cd);
void crypt_drop_keyring_key_by_description(struct crypt_device *cd, const char * key_description, key_type_t ktype); void crypt_drop_keyring_key_by_description(struct crypt_device *cd, const char * key_description, key_type_t ktype);
void crypt_drop_keyring_key(struct crypt_device *cd, struct volume_key *vks); void crypt_drop_keyring_key(struct crypt_device *cd, struct volume_key *vks);
static inline uint64_t version(uint16_t major, uint16_t minor, uint16_t patch, u int16_t release) static inline uint64_t compact_version(uint16_t major, uint16_t minor, uint16_t patch, uint16_t release)
{ {
return (uint64_t)release | ((uint64_t)patch << 16) | ((uint64_t)minor << 32) | ((uint64_t)major << 48); return (uint64_t)release | ((uint64_t)patch << 16) | ((uint64_t)minor << 32) | ((uint64_t)major << 48);
} }
int kernel_version(uint64_t *kversion); int kernel_version(uint64_t *kversion);
int crypt_serialize_lock(struct crypt_device *cd); int crypt_serialize_lock(struct crypt_device *cd);
void crypt_serialize_unlock(struct crypt_device *cd); void crypt_serialize_unlock(struct crypt_device *cd);
bool crypt_string_in(const char *str, char **list, size_t list_size); bool crypt_string_in(const char *str, char **list, size_t list_size);
 End of changes. 10 change blocks. 
41 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)