summaryrefslogtreecommitdiff
path: root/drivers/target/iscsi/iscsi_target_auth.c
diff options
context:
space:
mode:
authorJason Jin <Jason.Jin@freescale.com>2015-03-19 05:40:14 (GMT)
committerJason Jin <Jason.Jin@freescale.com>2015-03-19 05:40:14 (GMT)
commitb2d58e506b33b18574807e63007e87ebca0f9c07 (patch)
treefc2afd772ba5cdac0dd091f65c492695b27d9a17 /drivers/target/iscsi/iscsi_target_auth.c
parent2bbe09ef71ce8446ba0b3e29df2099150e9e6fdf (diff)
parenteb985cb9b5e02d470870617b41fa51a1d9360c7f (diff)
downloadlinux-fsl-qoriq-b2d58e506b33b18574807e63007e87ebca0f9c07.tar.xz
Merge branch 'qoriq-sdk' into LS1-SDK
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_auth.c')
-rw-r--r--drivers/target/iscsi/iscsi_target_auth.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target_auth.c b/drivers/target/iscsi/iscsi_target_auth.c
index 3e80188..b25bba5 100644
--- a/drivers/target/iscsi/iscsi_target_auth.c
+++ b/drivers/target/iscsi/iscsi_target_auth.c
@@ -314,6 +314,16 @@ static int chap_server_compute_md5(
goto out;
}
/*
+ * During mutual authentication, the CHAP_C generated by the
+ * initiator must not match the original CHAP_C generated by
+ * the target.
+ */
+ if (!memcmp(challenge_binhex, chap->challenge, CHAP_CHALLENGE_LENGTH)) {
+ pr_err("initiator CHAP_C matches target CHAP_C, failing"
+ " login attempt\n");
+ goto out;
+ }
+ /*
* Generate CHAP_N and CHAP_R for mutual authentication.
*/
tfm = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC);