"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/luks2/luks2_segment.c" between
cryptsetup-2.4.2.tar.xz and cryptsetup-2.4.3.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_segment.c  (cryptsetup-2.4.2.tar.xz):luks2_segment.c  (cryptsetup-2.4.3.tar.xz)
skipping to change at line 126 skipping to change at line 126
static json_object *json_segment_get_flags(json_object *jobj_segment) static json_object *json_segment_get_flags(json_object *jobj_segment)
{ {
json_object *jobj; json_object *jobj;
if (!jobj_segment || !(json_object_object_get_ex(jobj_segment, "flags", & jobj))) if (!jobj_segment || !(json_object_object_get_ex(jobj_segment, "flags", & jobj)))
return NULL; return NULL;
return jobj; return jobj;
} }
static bool json_segment_contains_flag(json_object *jobj_segment, const char *fl ag_str, size_t len) bool json_segment_contains_flag(json_object *jobj_segment, const char *flag_str, size_t len)
{ {
int r, i; int r, i;
json_object *jobj, *jobj_flags = json_segment_get_flags(jobj_segment); json_object *jobj, *jobj_flags = json_segment_get_flags(jobj_segment);
if (!jobj_flags) if (!jobj_flags)
return false; return false;
for (i = 0; i < (int)json_object_array_length(jobj_flags); i++) { for (i = 0; i < (int)json_object_array_length(jobj_flags); i++) {
jobj = json_object_array_get_idx(jobj_flags, i); jobj = json_object_array_get_idx(jobj_flags, i);
if (len) if (len)
skipping to change at line 413 skipping to change at line 413
json_object *LUKS2_get_segment_by_flag(struct luks2_hdr *hdr, const char *flag) json_object *LUKS2_get_segment_by_flag(struct luks2_hdr *hdr, const char *flag)
{ {
json_object *jobj_segment = NULL, json_object *jobj_segment = NULL,
*jobj_segments = LUKS2_get_segments_jobj(hdr); *jobj_segments = LUKS2_get_segments_jobj(hdr);
if (jobj_segments) if (jobj_segments)
_get_segment_or_id_by_flag(jobj_segments, flag, 0, &jobj_segment) ; _get_segment_or_id_by_flag(jobj_segments, flag, 0, &jobj_segment) ;
return jobj_segment; return jobj_segment;
} }
/* compares key characteristics of both segments */
bool json_segment_cmp(json_object *jobj_segment_1, json_object *jobj_segment_2)
const char *type = json_segment_type(jobj_segment_1);
const char *type2 = json_segment_type(jobj_segment_2);
if (!type || !type2)
return false;
if (strcmp(type, type2))
return false;
if (!strcmp(type, "crypt"))
return (json_segment_get_sector_size(jobj_segment_1) == json_segm
ent_get_sector_size(jobj_segment_2) &&
return true;
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added

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