Lines Matching refs:ac
16 static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed);
18 static int ceph_x_is_authenticated(struct ceph_auth_client *ac) in ceph_x_is_authenticated() argument
20 struct ceph_x_info *xi = ac->private; in ceph_x_is_authenticated()
23 ceph_x_validate_tickets(ac, &need); in ceph_x_is_authenticated()
25 ac->want_keys, need, xi->have_keys); in ceph_x_is_authenticated()
26 return (ac->want_keys & xi->have_keys) == ac->want_keys; in ceph_x_is_authenticated()
29 static int ceph_x_should_authenticate(struct ceph_auth_client *ac) in ceph_x_should_authenticate() argument
31 struct ceph_x_info *xi = ac->private; in ceph_x_should_authenticate()
34 ceph_x_validate_tickets(ac, &need); in ceph_x_should_authenticate()
36 ac->want_keys, need, xi->have_keys); in ceph_x_should_authenticate()
96 get_ticket_handler(struct ceph_auth_client *ac, int service) in get_ticket_handler() argument
99 struct ceph_x_info *xi = ac->private; in get_ticket_handler()
123 static void remove_ticket_handler(struct ceph_auth_client *ac, in remove_ticket_handler() argument
126 struct ceph_x_info *xi = ac->private; in remove_ticket_handler()
136 static int process_one_ticket(struct ceph_auth_client *ac, in process_one_ticket() argument
140 struct ceph_x_info *xi = ac->private; in process_one_ticket()
169 th = get_ticket_handler(ac, type); in process_one_ticket()
253 static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac, in ceph_x_proc_ticket_reply() argument
270 ret = process_one_ticket(ac, secret, &p, end); in ceph_x_proc_ticket_reply()
281 static int ceph_x_build_authorizer(struct ceph_auth_client *ac, in ceph_x_build_authorizer() argument
313 msg_a->global_id = cpu_to_le64(ac->global_id); in ceph_x_build_authorizer()
370 static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed) in ceph_x_validate_tickets() argument
372 int want = ac->want_keys; in ceph_x_validate_tickets()
373 struct ceph_x_info *xi = ac->private; in ceph_x_validate_tickets()
376 *pneed = ac->want_keys & ~(xi->have_keys); in ceph_x_validate_tickets()
381 if (!(ac->want_keys & service)) in ceph_x_validate_tickets()
387 th = get_ticket_handler(ac, service); in ceph_x_validate_tickets()
402 static int ceph_x_build_request(struct ceph_auth_client *ac, in ceph_x_build_request() argument
405 struct ceph_x_info *xi = ac->private; in ceph_x_build_request()
410 get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_build_request()
415 ceph_x_validate_tickets(ac, &need); in ceph_x_build_request()
418 ac->want_keys, xi->have_keys, need); in ceph_x_build_request()
466 ret = ceph_x_build_authorizer(ac, th, &xi->auth_authorizer); in ceph_x_build_request()
481 static int ceph_x_handle_reply(struct ceph_auth_client *ac, int result, in ceph_x_handle_reply() argument
484 struct ceph_x_info *xi = ac->private; in ceph_x_handle_reply()
514 ret = ceph_x_proc_ticket_reply(ac, &xi->secret, in ceph_x_handle_reply()
519 th = get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_handle_reply()
522 ret = ceph_x_proc_ticket_reply(ac, &th->session_key, in ceph_x_handle_reply()
531 if (ac->want_keys == xi->have_keys) in ceph_x_handle_reply()
537 struct ceph_auth_client *ac, int peer_type, in ceph_x_create_authorizer() argument
544 th = get_ticket_handler(ac, peer_type); in ceph_x_create_authorizer()
552 ret = ceph_x_build_authorizer(ac, th, au); in ceph_x_create_authorizer()
568 struct ceph_auth_client *ac, int peer_type, in ceph_x_update_authorizer() argument
574 th = get_ticket_handler(ac, peer_type); in ceph_x_update_authorizer()
582 return ceph_x_build_authorizer(ac, th, au); in ceph_x_update_authorizer()
587 static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac, in ceph_x_verify_authorizer_reply() argument
598 th = get_ticket_handler(ac, au->service); in ceph_x_verify_authorizer_reply()
616 static void ceph_x_destroy_authorizer(struct ceph_auth_client *ac, in ceph_x_destroy_authorizer() argument
626 static void ceph_x_reset(struct ceph_auth_client *ac) in ceph_x_reset() argument
628 struct ceph_x_info *xi = ac->private; in ceph_x_reset()
635 static void ceph_x_destroy(struct ceph_auth_client *ac) in ceph_x_destroy() argument
637 struct ceph_x_info *xi = ac->private; in ceph_x_destroy()
640 dout("ceph_x_destroy %p\n", ac); in ceph_x_destroy()
646 remove_ticket_handler(ac, th); in ceph_x_destroy()
652 kfree(ac->private); in ceph_x_destroy()
653 ac->private = NULL; in ceph_x_destroy()
656 static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac, in ceph_x_invalidate_authorizer() argument
661 th = get_ticket_handler(ac, peer_type); in ceph_x_invalidate_authorizer()
683 int ceph_x_init(struct ceph_auth_client *ac) in ceph_x_init() argument
688 dout("ceph_x_init %p\n", ac); in ceph_x_init()
695 if (!ac->key) { in ceph_x_init()
700 ret = ceph_crypto_key_clone(&xi->secret, ac->key); in ceph_x_init()
709 ac->protocol = CEPH_AUTH_CEPHX; in ceph_x_init()
710 ac->private = xi; in ceph_x_init()
711 ac->ops = &ceph_x_ops; in ceph_x_init()