Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73210
b: refs/heads/master
c: 8a29f2b
h: refs/heads/master
v: v3
  • Loading branch information
Michael Halcrow authored and Linus Torvalds committed Nov 5, 2007
1 parent e134ae9 commit ba0f9e7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 778d1a2bd42ae862a6c6d20a1c3af5e45b3c1924
refs/heads/master: 8a29f2b0288ba2a8fb302f9a639521ac9ff302e5
26 changes: 22 additions & 4 deletions trunk/fs/ecryptfs/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,29 @@ static int ecryptfs_calculate_md5(char *dst,
}
crypt_stat->hash_tfm = desc.tfm;
}
crypto_hash_init(&desc);
crypto_hash_update(&desc, &sg, len);
crypto_hash_final(&desc, dst);
mutex_unlock(&crypt_stat->cs_hash_tfm_mutex);
rc = crypto_hash_init(&desc);
if (rc) {
printk(KERN_ERR
"%s: Error initializing crypto hash; rc = [%d]\n",
__FUNCTION__, rc);
goto out;
}
rc = crypto_hash_update(&desc, &sg, len);
if (rc) {
printk(KERN_ERR
"%s: Error updating crypto hash; rc = [%d]\n",
__FUNCTION__, rc);
goto out;
}
rc = crypto_hash_final(&desc, dst);
if (rc) {
printk(KERN_ERR
"%s: Error finalizing crypto hash; rc = [%d]\n",
__FUNCTION__, rc);
goto out;
}
out:
mutex_unlock(&crypt_stat->cs_hash_tfm_mutex);
return rc;
}

Expand Down

0 comments on commit ba0f9e7

Please sign in to comment.