"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/luks2/luks2_keyslot_reenc.c" 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.

luks2_keyslot_reenc.c  (cryptsetup-2.3.6.tar.xz):luks2_keyslot_reenc.c  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 24 skipping to change at line 24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "luks2_internal.h" #include "luks2_internal.h"
static int reenc_keyslot_open(struct crypt_device *cd, static int reenc_keyslot_open(struct crypt_device *cd __attribute__((unused)),
int keyslot, int keyslot __attribute__((unused)),
const char *password, const char *password __attribute__((unused)),
size_t password_len, size_t password_len __attribute__((unused)),
char *volume_key, char *volume_key __attribute__((unused)),
size_t volume_key_len) size_t volume_key_len __attribute__((unused)))
{ {
return -ENOENT; return -ENOENT;
} }
int reenc_keyslot_alloc(struct crypt_device *cd, int reenc_keyslot_alloc(struct crypt_device *cd,
struct luks2_hdr *hdr, struct luks2_hdr *hdr,
int keyslot, int keyslot,
const struct crypt_params_reencrypt *params) const struct crypt_params_reencrypt *params)
{ {
int r; int r;
skipping to change at line 179 skipping to change at line 179
return r; return r;
} }
r = LUKS2_hdr_write(cd, hdr); r = LUKS2_hdr_write(cd, hdr);
device_write_unlock(cd, crypt_metadata_device(cd)); device_write_unlock(cd, crypt_metadata_device(cd));
return r < 0 ? r : keyslot; return r < 0 ? r : keyslot;
} }
int reenc_keyslot_update(struct crypt_device *cd, static int reenc_keyslot_wipe(struct crypt_device *cd __attribute__((unused)),
const struct luks2_reenc_context *rh) int keyslot __attribute__((unused)))
{
json_object *jobj_keyslot, *jobj_area, *jobj_area_type;
struct luks2_hdr *hdr;
if (!(hdr = crypt_get_hdr(cd, CRYPT_LUKS2)))
return -EINVAL;
jobj_keyslot = LUKS2_get_keyslot_jobj(hdr, rh->reenc_keyslot);
if (!jobj_keyslot)
return -EINVAL;
json_object_object_get_ex(jobj_keyslot, "area", &jobj_area);
json_object_object_get_ex(jobj_area, "type", &jobj_area_type);
if (rh->rp.type == REENC_PROTECTION_CHECKSUM) {
log_dbg(cd, "Updating reencrypt keyslot for checksum protection."
);
json_object_object_add(jobj_area, "type", json_object_new_string(
"checksum"));
json_object_object_add(jobj_area, "hash", json_object_new_string(
rh->rp.p.csum.hash));
json_object_object_add(jobj_area, "sector_size", json_object_new_
int64(rh->alignment));
} else if (rh->rp.type == REENC_PROTECTION_NONE) {
log_dbg(cd, "Updating reencrypt keyslot for none protection.");
json_object_object_add(jobj_area, "type", json_object_new_string(
"none"));
json_object_object_del(jobj_area, "hash");
} else if (rh->rp.type == REENC_PROTECTION_JOURNAL) {
log_dbg(cd, "Updating reencrypt keyslot for journal protection.")
;
json_object_object_add(jobj_area, "type", json_object_new_string(
"journal"));
json_object_object_del(jobj_area, "hash");
} else
log_dbg(cd, "No update of reencrypt keyslot needed.");
return 0;
}
static int reenc_keyslot_wipe(struct crypt_device *cd, int keyslot)
{ {
return 0; return 0;
} }
static int reenc_keyslot_dump(struct crypt_device *cd, int keyslot) static int reenc_keyslot_dump(struct crypt_device *cd, int keyslot)
{ {
json_object *jobj_keyslot, *jobj_area, *jobj_direction, *jobj_mode, *jobj _resilience, json_object *jobj_keyslot, *jobj_area, *jobj_direction, *jobj_mode, *jobj _resilience,
*jobj1; *jobj1;
jobj_keyslot = LUKS2_get_keyslot_jobj(crypt_get_hdr(cd, CRYPT_LUKS2), key slot); jobj_keyslot = LUKS2_get_keyslot_jobj(crypt_get_hdr(cd, CRYPT_LUKS2), key slot);
 End of changes. 2 change blocks. 
49 lines changed or deleted 8 lines changed or added

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