crypto: authenc - Fix zero-length IV crash
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 13 Jan 2009 00:26:18 +0000 (11:26 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Feb 2009 17:53:28 +0000 (09:53 -0800)
commit5e797b3a373d0a5b8602d2b72fbc257ea6b6e629
tree20bb78ebb4f001b02460023efe24b5087b9e1ad3
parentc4d1d5f06dd93dafbd3d6adb25000f0d7ab23849
crypto: authenc - Fix zero-length IV crash

commit 29b37f42127f7da511560a40ea74f5047da40c13 upstream.

As it is if an algorithm with a zero-length IV is used (e.g.,
NULL encryption) with authenc, authenc may generate an SG entry
of length zero, which will trigger a BUG check in the hash layer.

This patch fixes it by skipping the IV SG generation if the IV
size is zero.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
crypto/authenc.c