iscsi_target_auth.h 970 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ISCSI_CHAP_H_
  3. #define _ISCSI_CHAP_H_
  4. #include <linux/types.h>
  5. #define CHAP_DIGEST_UNKNOWN 0
  6. #define CHAP_DIGEST_MD5 5
  7. #define CHAP_DIGEST_SHA 6
  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. #define MD5_SIGNATURE_SIZE 16 /* 16 bytes in a MD5 message digest */
  13. #define CHAP_STAGE_CLIENT_A 1
  14. #define CHAP_STAGE_SERVER_AIC 2
  15. #define CHAP_STAGE_CLIENT_NR 3
  16. #define CHAP_STAGE_CLIENT_NRIC 4
  17. #define CHAP_STAGE_SERVER_NR 5
  18. struct iscsi_node_auth;
  19. struct iscsi_conn;
  20. extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *, char *,
  21. int *, int *);
  22. struct iscsi_chap {
  23. unsigned char digest_type;
  24. unsigned char id;
  25. unsigned char challenge[CHAP_CHALLENGE_LENGTH];
  26. unsigned int authenticate_target;
  27. unsigned int chap_state;
  28. } ____cacheline_aligned;
  29. #endif /*** _ISCSI_CHAP_H_ ***/