blob: d22f7b96a06ca98aa3bd83f669d92eb686cfcec9 [file] [log] [blame]
Nicholas Bellingere48354c2011-07-23 06:43:04 +00001#ifndef _ISCSI_CHAP_H_
2#define _ISCSI_CHAP_H_
3
Tejas Vaykole31607232014-05-30 11:13:47 +05304#define CHAP_DIGEST_UNKNOWN 0
Nicholas Bellingere48354c2011-07-23 06:43:04 +00005#define CHAP_DIGEST_MD5 5
6#define CHAP_DIGEST_SHA 6
7
8#define CHAP_CHALLENGE_LENGTH 16
9#define CHAP_CHALLENGE_STR_LEN 4096
10#define MAX_RESPONSE_LENGTH 64 /* sufficient for MD5 */
11#define MAX_CHAP_N_SIZE 512
12
13#define MD5_SIGNATURE_SIZE 16 /* 16 bytes in a MD5 message digest */
14
15#define CHAP_STAGE_CLIENT_A 1
16#define CHAP_STAGE_SERVER_AIC 2
17#define CHAP_STAGE_CLIENT_NR 3
18#define CHAP_STAGE_CLIENT_NRIC 4
19#define CHAP_STAGE_SERVER_NR 5
20
21extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *, char *,
22 int *, int *);
23
24struct iscsi_chap {
25 unsigned char digest_type;
26 unsigned char id;
27 unsigned char challenge[CHAP_CHALLENGE_LENGTH];
28 unsigned int authenticate_target;
29 unsigned int chap_state;
30} ____cacheline_aligned;
31
32#endif /*** _ISCSI_CHAP_H_ ***/