blob: d5600ac30b531478276c0644c35f68b6d79c6636 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Nicholas Bellingere48354c2011-07-23 06:43:04 +00002#ifndef _ISCSI_CHAP_H_
3#define _ISCSI_CHAP_H_
4
Bart Van Assche8dcf07b2016-11-14 15:47:14 -08005#include <linux/types.h>
6
Tejas Vaykole31607232014-05-30 11:13:47 +05307#define CHAP_DIGEST_UNKNOWN 0
Nicholas Bellingere48354c2011-07-23 06:43:04 +00008#define CHAP_DIGEST_MD5 5
9#define CHAP_DIGEST_SHA 6
10
11#define CHAP_CHALLENGE_LENGTH 16
12#define CHAP_CHALLENGE_STR_LEN 4096
13#define MAX_RESPONSE_LENGTH 64 /* sufficient for MD5 */
14#define MAX_CHAP_N_SIZE 512
15
16#define MD5_SIGNATURE_SIZE 16 /* 16 bytes in a MD5 message digest */
17
18#define CHAP_STAGE_CLIENT_A 1
19#define CHAP_STAGE_SERVER_AIC 2
20#define CHAP_STAGE_CLIENT_NR 3
21#define CHAP_STAGE_CLIENT_NRIC 4
22#define CHAP_STAGE_SERVER_NR 5
23
Bart Van Assche8dcf07b2016-11-14 15:47:14 -080024struct iscsi_node_auth;
25struct iscsi_conn;
26
Nicholas Bellingere48354c2011-07-23 06:43:04 +000027extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *, char *,
28 int *, int *);
29
30struct iscsi_chap {
31 unsigned char digest_type;
32 unsigned char id;
33 unsigned char challenge[CHAP_CHALLENGE_LENGTH];
34 unsigned int authenticate_target;
35 unsigned int chap_state;
36} ____cacheline_aligned;
37
38#endif /*** _ISCSI_CHAP_H_ ***/