auth_x.h 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _FS_CEPH_AUTH_X_H
  2. #define _FS_CEPH_AUTH_X_H
  3. #include <linux/rbtree.h>
  4. #include <linux/ceph/auth.h>
  5. #include "crypto.h"
  6. #include "auth_x_protocol.h"
  7. /*
  8. * Handle ticket for a single service.
  9. */
  10. struct ceph_x_ticket_handler {
  11. struct rb_node node;
  12. unsigned int service;
  13. struct ceph_crypto_key session_key;
  14. bool have_key;
  15. u64 secret_id;
  16. struct ceph_buffer *ticket_blob;
  17. unsigned long renew_after, expires;
  18. };
  19. #define CEPHX_AU_ENC_BUF_LEN 128 /* big enough for encrypted blob */
  20. struct ceph_x_authorizer {
  21. struct ceph_authorizer base;
  22. struct ceph_crypto_key session_key;
  23. struct ceph_buffer *buf;
  24. unsigned int service;
  25. u64 nonce;
  26. u64 secret_id;
  27. char enc_buf[CEPHX_AU_ENC_BUF_LEN] __aligned(8);
  28. };
  29. struct ceph_x_info {
  30. struct ceph_crypto_key secret;
  31. bool starting;
  32. u64 server_challenge;
  33. unsigned int have_keys;
  34. struct rb_root ticket_handlers;
  35. struct ceph_x_authorizer auth_authorizer;
  36. };
  37. int ceph_x_init(struct ceph_auth_client *ac);
  38. #endif