Lines Matching refs:ac
17 static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed);
19 static int ceph_x_is_authenticated(struct ceph_auth_client *ac) in ceph_x_is_authenticated() argument
21 struct ceph_x_info *xi = ac->private; in ceph_x_is_authenticated()
24 ceph_x_validate_tickets(ac, &need); in ceph_x_is_authenticated()
26 ac->want_keys, need, xi->have_keys); in ceph_x_is_authenticated()
27 return (ac->want_keys & xi->have_keys) == ac->want_keys; in ceph_x_is_authenticated()
30 static int ceph_x_should_authenticate(struct ceph_auth_client *ac) in ceph_x_should_authenticate() argument
32 struct ceph_x_info *xi = ac->private; in ceph_x_should_authenticate()
35 ceph_x_validate_tickets(ac, &need); in ceph_x_should_authenticate()
37 ac->want_keys, need, xi->have_keys); in ceph_x_should_authenticate()
97 get_ticket_handler(struct ceph_auth_client *ac, int service) in get_ticket_handler() argument
100 struct ceph_x_info *xi = ac->private; in get_ticket_handler()
124 static void remove_ticket_handler(struct ceph_auth_client *ac, in remove_ticket_handler() argument
127 struct ceph_x_info *xi = ac->private; in remove_ticket_handler()
137 static int process_one_ticket(struct ceph_auth_client *ac, in process_one_ticket() argument
141 struct ceph_x_info *xi = ac->private; in process_one_ticket()
170 th = get_ticket_handler(ac, type); in process_one_ticket()
254 static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac, in ceph_x_proc_ticket_reply() argument
271 ret = process_one_ticket(ac, secret, &p, end); in ceph_x_proc_ticket_reply()
282 static int ceph_x_build_authorizer(struct ceph_auth_client *ac, in ceph_x_build_authorizer() argument
321 msg_a->global_id = cpu_to_le64(ac->global_id); in ceph_x_build_authorizer()
378 static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed) in ceph_x_validate_tickets() argument
380 int want = ac->want_keys; in ceph_x_validate_tickets()
381 struct ceph_x_info *xi = ac->private; in ceph_x_validate_tickets()
384 *pneed = ac->want_keys & ~(xi->have_keys); in ceph_x_validate_tickets()
389 if (!(ac->want_keys & service)) in ceph_x_validate_tickets()
395 th = get_ticket_handler(ac, service); in ceph_x_validate_tickets()
410 static int ceph_x_build_request(struct ceph_auth_client *ac, in ceph_x_build_request() argument
413 struct ceph_x_info *xi = ac->private; in ceph_x_build_request()
418 get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_build_request()
423 ceph_x_validate_tickets(ac, &need); in ceph_x_build_request()
426 ac->want_keys, xi->have_keys, need); in ceph_x_build_request()
474 ret = ceph_x_build_authorizer(ac, th, &xi->auth_authorizer); in ceph_x_build_request()
489 static int ceph_x_handle_reply(struct ceph_auth_client *ac, int result, in ceph_x_handle_reply() argument
492 struct ceph_x_info *xi = ac->private; in ceph_x_handle_reply()
522 ret = ceph_x_proc_ticket_reply(ac, &xi->secret, in ceph_x_handle_reply()
527 th = get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_handle_reply()
530 ret = ceph_x_proc_ticket_reply(ac, &th->session_key, in ceph_x_handle_reply()
539 if (ac->want_keys == xi->have_keys) in ceph_x_handle_reply()
545 struct ceph_auth_client *ac, int peer_type, in ceph_x_create_authorizer() argument
552 th = get_ticket_handler(ac, peer_type); in ceph_x_create_authorizer()
560 ret = ceph_x_build_authorizer(ac, th, au); in ceph_x_create_authorizer()
571 auth->sign_message = ac->ops->sign_message; in ceph_x_create_authorizer()
572 auth->check_message_signature = ac->ops->check_message_signature; in ceph_x_create_authorizer()
578 struct ceph_auth_client *ac, int peer_type, in ceph_x_update_authorizer() argument
584 th = get_ticket_handler(ac, peer_type); in ceph_x_update_authorizer()
592 return ceph_x_build_authorizer(ac, th, au); in ceph_x_update_authorizer()
597 static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac, in ceph_x_verify_authorizer_reply() argument
622 static void ceph_x_destroy_authorizer(struct ceph_auth_client *ac, in ceph_x_destroy_authorizer() argument
633 static void ceph_x_reset(struct ceph_auth_client *ac) in ceph_x_reset() argument
635 struct ceph_x_info *xi = ac->private; in ceph_x_reset()
642 static void ceph_x_destroy(struct ceph_auth_client *ac) in ceph_x_destroy() argument
644 struct ceph_x_info *xi = ac->private; in ceph_x_destroy()
647 dout("ceph_x_destroy %p\n", ac); in ceph_x_destroy()
653 remove_ticket_handler(ac, th); in ceph_x_destroy()
659 kfree(ac->private); in ceph_x_destroy()
660 ac->private = NULL; in ceph_x_destroy()
663 static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac, in ceph_x_invalidate_authorizer() argument
668 th = get_ticket_handler(ac, peer_type); in ceph_x_invalidate_authorizer()
745 int ceph_x_init(struct ceph_auth_client *ac) in ceph_x_init() argument
750 dout("ceph_x_init %p\n", ac); in ceph_x_init()
757 if (!ac->key) { in ceph_x_init()
762 ret = ceph_crypto_key_clone(&xi->secret, ac->key); in ceph_x_init()
771 ac->protocol = CEPH_AUTH_CEPHX; in ceph_x_init()
772 ac->private = xi; in ceph_x_init()
773 ac->ops = &ceph_x_ops; in ceph_x_init()