iscsi_target_auth.h 831 B

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