- dmd.u.crypt.cipher = cipher;
- log_dbg("Trying to activate loop-AES device %s using cipher %s.",
- name, dmd.u.crypt.cipher);
+ r = dm_crypt_target_set(&dmd.segment, 0, dmd.size, crypt_data_device(cd),
+ vk, cipher, crypt_get_iv_offset(cd),
+ crypt_get_data_offset(cd), crypt_get_integrity(cd),
+ crypt_get_integrity_tag_size(cd), crypt_get_sector_size(cd));
+
+ if (r) {
+ free(cipher);
+ return r;
+ }
+
+ log_dbg(cd, "Trying to activate loop-AES device %s using cipher %s.",
+ name, cipher);