iscsi_target_auth.h 861 B

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