iscsi_target_auth.h 931 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _ISCSI_CHAP_H_
  2. #define _ISCSI_CHAP_H_
  3. #include <linux/types.h>
  4. #define CHAP_DIGEST_UNKNOWN 0
  5. #define CHAP_DIGEST_MD5 5
  6. #define CHAP_DIGEST_SHA 6
  7. #define CHAP_CHALLENGE_LENGTH 16
  8. #define CHAP_CHALLENGE_STR_LEN 4096
  9. #define MAX_RESPONSE_LENGTH 64 /* sufficient for MD5 */
  10. #define MAX_CHAP_N_SIZE 512
  11. #define MD5_SIGNATURE_SIZE 16 /* 16 bytes in a MD5 message digest */
  12. #define CHAP_STAGE_CLIENT_A 1
  13. #define CHAP_STAGE_SERVER_AIC 2
  14. #define CHAP_STAGE_CLIENT_NR 3
  15. #define CHAP_STAGE_CLIENT_NRIC 4
  16. #define CHAP_STAGE_SERVER_NR 5
  17. struct iscsi_node_auth;
  18. struct iscsi_conn;
  19. extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *, char *,
  20. int *, int *);
  21. struct iscsi_chap {
  22. unsigned char digest_type;
  23. unsigned char id;
  24. unsigned char challenge[CHAP_CHALLENGE_LENGTH];
  25. unsigned int authenticate_target;
  26. unsigned int chap_state;
  27. } ____cacheline_aligned;
  28. #endif /*** _ISCSI_CHAP_H_ ***/