2010-10-17 Milan Broz <mbroz@redhat.com>
+ * Add crypt_get_device_name() to API (get underlying device name).
* Change detection for static libraries.
* Fix pkg-config use in automake scripts.
* Build statically linked binary (cryptsetup.static) together with shared build
* cipher - used cipher, e.g. "aes" or NULL otherwise
* cipher_mode - used cipher mode including IV, e.g. "xts-plain" or NULL otherwise
* uuid - device UUID or NULL if not set
+ * device_name - underlying device name or NULL if not yet set
* data_offset - device offset in sectors where real data starts on underlying device)
* volume_key_size - size (in bytes) of volume key for crypt device
*/
const char *crypt_get_cipher(struct crypt_device *cd);
const char *crypt_get_cipher_mode(struct crypt_device *cd);
const char *crypt_get_uuid(struct crypt_device *cd);
+const char *crypt_get_device_name(struct crypt_device *cd);
uint64_t crypt_get_data_offset(struct crypt_device *cd);
int crypt_get_volume_key_size(struct crypt_device *cd);
crypt_get_uuid;
crypt_get_data_offset;
crypt_get_volume_key_size;
+ crypt_get_device_name;
crypt_keyslot_status;
crypt_get_error;
else
log_std(cd, "Key Slot %d: DISABLED\n", i);
}
+
+ log_std(cd, "DNAME: %s\n", crypt_get_device_name(cd) ?: "");
+
return 0;
}
return NULL;
}
+const char *crypt_get_device_name(struct crypt_device *cd)
+{
+ return cd->device;
+}
+
int crypt_get_volume_key_size(struct crypt_device *cd)
{
if (isPLAIN(cd->type))
/*
* cryptsetup library API check functions
*
- * Copyright (C) 2009 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2009-2010 Red Hat, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
OK_(strcmp(cipher_mode, crypt_get_cipher_mode(cd)));
EQ_(key_size, crypt_get_volume_key_size(cd));
EQ_(4096, crypt_get_data_offset(cd));
+ OK_(strcmp(DEVICE_2, crypt_get_device_name(cd)));
reset_log();
crypt_set_log_callback(cd, &new_log, NULL);