"Fossies" - the Fresh Open Source Software Archive  

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

crypto_cipher_kernel.c  (cryptsetup-2.3.6.tar.xz):crypto_cipher_kernel.c  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 170 skipping to change at line 170
header->cmsg_level = SOL_ALG; header->cmsg_level = SOL_ALG;
header->cmsg_type = ALG_SET_IV; header->cmsg_type = ALG_SET_IV;
header->cmsg_len = iv_msg_size; header->cmsg_len = iv_msg_size;
alg_iv = (void*)CMSG_DATA(header); alg_iv = (void*)CMSG_DATA(header);
alg_iv->ivlen = iv_length; alg_iv->ivlen = iv_length;
memcpy(alg_iv->iv, iv, iv_length); memcpy(alg_iv->iv, iv, iv_length);
} }
len = sendmsg(ctx->opfd, &msg, 0); len = sendmsg(ctx->opfd, &msg, 0);
if (len != (ssize_t)(in_length)) { if (len != (ssize_t)(in_length))
r = -EIO; r = -EIO;
goto bad; else {
len = read(ctx->opfd, out, out_length);
if (len != (ssize_t)out_length)
r = -EIO;
} }
len = read(ctx->opfd, out, out_length);
if (len != (ssize_t)out_length)
r = -EIO;
bad:
crypt_backend_memzero(buffer, sizeof(buffer)); crypt_backend_memzero(buffer, sizeof(buffer));
return r; return r;
} }
int crypt_cipher_encrypt_kernel(struct crypt_cipher_kernel *ctx, int crypt_cipher_encrypt_kernel(struct crypt_cipher_kernel *ctx,
const char *in, char *out, size_t length, const char *in, char *out, size_t length,
const char *iv, size_t iv_length) const char *iv, size_t iv_length)
{ {
return _crypt_cipher_crypt(ctx, in, length, out, length, return _crypt_cipher_crypt(ctx, in, length, out, length,
iv, iv_length, ALG_OP_ENCRYPT); iv, iv_length, ALG_OP_ENCRYPT);
 End of changes. 3 change blocks. 
6 lines changed or deleted 5 lines changed or added

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