From: Szilveszter Ördög Date: Wed, 3 Mar 2010 00:03:23 +0000 (+0800) Subject: crypto: hash - Fix handling of unaligned buffers X-Git-Tag: v2.6.34-rc1~198^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbb9bf65ae25dee772e85589136e7dd1c3e743ae;p=pandora-kernel.git crypto: hash - Fix handling of unaligned buffers The correct way to calculate the start of the aligned part of an unaligned buffer is: offset = ALIGN(offset, alignmask + 1); However, crypto_hash_walk_done() has: offset += alignmask - 1; offset = ALIGN(offset, alignmask + 1); which actually skips a whole block unless offset % (alignmask + 1) == 1. This patch fixes the problem. Signed-off-by: Szilveszter Ördög Signed-off-by: Herbert Xu --- Reading git-diff-tree failed