auth_x.h 1013 B

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