"Fossies" - the Fresh Open Source Software Archive  

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

integrity.c  (cryptsetup-2.3.6.tar.xz):integrity.c  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 123 skipping to change at line 123
int r; int r;
r = INTEGRITY_read_superblock(cd, device, offset, &sb); r = INTEGRITY_read_superblock(cd, device, offset, &sb);
if (r) if (r)
return r; return r;
*data_sectors = sb.provided_data_sectors; *data_sectors = sb.provided_data_sectors;
return 0; return 0;
} }
int INTEGRITY_key_size(struct crypt_device *cd, const char *integrity) int INTEGRITY_key_size(struct crypt_device *cd __attribute__((unused)), const ch ar *integrity)
{ {
if (!integrity) if (!integrity)
return 0; return 0;
//FIXME: use crypto backend hash size //FIXME: use crypto backend hash size
if (!strcmp(integrity, "aead")) if (!strcmp(integrity, "aead"))
return 0; return 0;
else if (!strcmp(integrity, "hmac(sha1)")) else if (!strcmp(integrity, "hmac(sha1)"))
return 20; return 20;
else if (!strcmp(integrity, "hmac(sha256)")) else if (!strcmp(integrity, "hmac(sha256)"))
skipping to change at line 166 skipping to change at line 166
r = sscanf(integrity, "hmac(%" MAX_CIPHER_LEN_STR "[^)]s", hash); r = sscanf(integrity, "hmac(%" MAX_CIPHER_LEN_STR "[^)]s", hash);
if (r == 1) if (r == 1)
r = crypt_hash_size(hash); r = crypt_hash_size(hash);
else else
r = crypt_hash_size(integrity); r = crypt_hash_size(integrity);
return r < 0 ? 0 : r; return r < 0 ? 0 : r;
} }
int INTEGRITY_tag_size(struct crypt_device *cd, int INTEGRITY_tag_size(struct crypt_device *cd __attribute__((unused)),
const char *integrity, const char *integrity,
const char *cipher, const char *cipher,
const char *cipher_mode) const char *cipher_mode)
{ {
int iv_tag_size = 0, auth_tag_size = 0; int iv_tag_size = 0, auth_tag_size = 0;
if (!cipher_mode) if (!cipher_mode)
iv_tag_size = 0; iv_tag_size = 0;
else if (!strcmp(cipher_mode, "xts-random")) else if (!strcmp(cipher_mode, "xts-random"))
iv_tag_size = 16; iv_tag_size = 16;
skipping to change at line 192 skipping to change at line 192
iv_tag_size = 16; iv_tag_size = 16;
else if (!strcmp(cipher, "aegis256") && !strcmp(cipher_mode, "random")) else if (!strcmp(cipher, "aegis256") && !strcmp(cipher_mode, "random"))
iv_tag_size = 32; iv_tag_size = 32;
else if (!strcmp(cipher_mode, "random")) else if (!strcmp(cipher_mode, "random"))
iv_tag_size = 16; iv_tag_size = 16;
//FIXME: use crypto backend hash size //FIXME: use crypto backend hash size
if (!integrity || !strcmp(integrity, "none")) if (!integrity || !strcmp(integrity, "none"))
auth_tag_size = 0; auth_tag_size = 0;
else if (!strcmp(integrity, "aead")) else if (!strcmp(integrity, "aead"))
auth_tag_size = 16; //FIXME gcm- mode only auth_tag_size = 16; /* gcm- mode only */
else if (!strcmp(integrity, "cmac(aes)")) else if (!strcmp(integrity, "cmac(aes)"))
auth_tag_size = 16; auth_tag_size = 16;
else if (!strcmp(integrity, "hmac(sha1)")) else if (!strcmp(integrity, "hmac(sha1)"))
auth_tag_size = 20; auth_tag_size = 20;
else if (!strcmp(integrity, "hmac(sha256)")) else if (!strcmp(integrity, "hmac(sha256)"))
auth_tag_size = 32; auth_tag_size = 32;
else if (!strcmp(integrity, "hmac(sha512)")) else if (!strcmp(integrity, "hmac(sha512)"))
auth_tag_size = 64; auth_tag_size = 64;
else if (!strcmp(integrity, "poly1305")) { else if (!strcmp(integrity, "poly1305")) {
if (iv_tag_size) if (iv_tag_size)
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

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