Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 1 | #ifndef _ISCSI_CHAP_H_ |
| 2 | #define _ISCSI_CHAP_H_ |
| 3 | |
Bart Van Assche | 8dcf07b | 2016-11-14 15:47:14 -0800 | [diff] [blame] | 4 | #include <linux/types.h> |
| 5 | |
Tejas Vaykole | 3160723 | 2014-05-30 11:13:47 +0530 | [diff] [blame] | 6 | #define CHAP_DIGEST_UNKNOWN 0 |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 7 | #define CHAP_DIGEST_MD5 5 |
| 8 | #define CHAP_DIGEST_SHA 6 |
| 9 | |
| 10 | #define CHAP_CHALLENGE_LENGTH 16 |
| 11 | #define CHAP_CHALLENGE_STR_LEN 4096 |
| 12 | #define MAX_RESPONSE_LENGTH 64 /* sufficient for MD5 */ |
| 13 | #define MAX_CHAP_N_SIZE 512 |
| 14 | |
| 15 | #define MD5_SIGNATURE_SIZE 16 /* 16 bytes in a MD5 message digest */ |
| 16 | |
| 17 | #define CHAP_STAGE_CLIENT_A 1 |
| 18 | #define CHAP_STAGE_SERVER_AIC 2 |
| 19 | #define CHAP_STAGE_CLIENT_NR 3 |
| 20 | #define CHAP_STAGE_CLIENT_NRIC 4 |
| 21 | #define CHAP_STAGE_SERVER_NR 5 |
| 22 | |
Bart Van Assche | 8dcf07b | 2016-11-14 15:47:14 -0800 | [diff] [blame] | 23 | struct iscsi_node_auth; |
| 24 | struct iscsi_conn; |
| 25 | |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 26 | extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *, char *, |
| 27 | int *, int *); |
| 28 | |
| 29 | struct iscsi_chap { |
| 30 | unsigned char digest_type; |
| 31 | unsigned char id; |
| 32 | unsigned char challenge[CHAP_CHALLENGE_LENGTH]; |
| 33 | unsigned int authenticate_target; |
| 34 | unsigned int chap_state; |
| 35 | } ____cacheline_aligned; |
| 36 | |
| 37 | #endif /*** _ISCSI_CHAP_H_ ***/ |