summaryrefslogtreecommitdiff
path: root/drivers/target/iscsi/iscsi_target_auth.h
diff options
context:
space:
mode:
authorMaurizio Lombardi <mlombard@redhat.com>2019-10-17 15:10:36 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2019-11-06 00:13:24 -0500
commit19f5f88ed779180f16e236949e18389a0dca4aae (patch)
tree3eaf0f11fe05e4e7d02183a12f4c6e0d524f1780 /drivers/target/iscsi/iscsi_target_auth.h
parenta572d24af4d16e70743feb0b4decb17aaae7ce43 (diff)
scsi: target: iscsi: tie the challenge length to the hash digest size
Link: https://lore.kernel.org/r/20191017131037.9903-3-mlombard@redhat.com Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Tested-by: Chris Leech <cleech@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_auth.h')
-rw-r--r--drivers/target/iscsi/iscsi_target_auth.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/iscsi/iscsi_target_auth.h b/drivers/target/iscsi/iscsi_target_auth.h
index 93db1ab5516c..fc75c1c20e23 100644
--- a/drivers/target/iscsi/iscsi_target_auth.h
+++ b/drivers/target/iscsi/iscsi_target_auth.h
@@ -10,7 +10,7 @@
#define CHAP_DIGEST_SHA256 7
#define CHAP_DIGEST_SHA3_256 8
-#define CHAP_CHALLENGE_LENGTH 16
+#define MAX_CHAP_CHALLENGE_LEN 32
#define CHAP_CHALLENGE_STR_LEN 4096
#define MAX_RESPONSE_LENGTH 128 /* sufficient for SHA3 256 */
#define MAX_CHAP_N_SIZE 512
@@ -34,7 +34,7 @@ extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *,
struct iscsi_chap {
unsigned char id;
- unsigned char challenge[CHAP_CHALLENGE_LENGTH];
+ unsigned char challenge[MAX_CHAP_CHALLENGE_LEN];
unsigned int challenge_len;
unsigned char *digest_name;
unsigned int digest_size;