From a4ea5c02e151ac02a99bfa81a2af2880e12eefe7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 14 Oct 2020 02:15:33 +0000 Subject: [PATCH] iscsi-scst: Fix SHA-1 algorithm number According to https://www.iana.org/assignments/ppp-numbers/ppp-numbers.xml#ppp-numbers-9 the value of the SHA-1 algorithm is 6 and not 7, as it is now in iscsi-scst/usr/chap.c. If on a client side node.session.auth.chap_algs is SHA1, login fails. Signed-off-by: Lev Vainblat git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9171 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/usr/chap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iscsi-scst/usr/chap.c b/iscsi-scst/usr/chap.c index f5d69b10f..2e6131816 100644 --- a/iscsi-scst/usr/chap.c +++ b/iscsi-scst/usr/chap.c @@ -38,7 +38,7 @@ #define BASE64_FORMAT 0x02 #define CHAP_DIGEST_ALG_MD5 5 -#define CHAP_DIGEST_ALG_SHA1 7 +#define CHAP_DIGEST_ALG_SHA1 6 #define CHAP_MD5_DIGEST_LEN 16 #define CHAP_SHA1_DIGEST_LEN 20 @@ -370,7 +370,7 @@ static int chap_initiator_auth_create_challenge(struct connection *conn) conn->auth.chap.digest_alg = CHAP_DIGEST_ALG_MD5; conn->auth_state = CHAP_AUTH_STATE_CHALLENGE; break; - } else if (!strcmp(p, "7")) { + } else if (!strcmp(p, "6")) { conn->auth.chap.digest_alg = CHAP_DIGEST_ALG_SHA1; conn->auth_state = CHAP_AUTH_STATE_CHALLENGE; break;