Lines Matching full:ac
20 static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed);
22 static int ceph_x_is_authenticated(struct ceph_auth_client *ac) in ceph_x_is_authenticated() argument
24 struct ceph_x_info *xi = ac->private; in ceph_x_is_authenticated()
27 ceph_x_validate_tickets(ac, &need); in ceph_x_is_authenticated()
29 ac->want_keys, need, xi->have_keys); in ceph_x_is_authenticated()
30 return (ac->want_keys & xi->have_keys) == ac->want_keys; in ceph_x_is_authenticated()
33 static int ceph_x_should_authenticate(struct ceph_auth_client *ac) in ceph_x_should_authenticate() argument
35 struct ceph_x_info *xi = ac->private; in ceph_x_should_authenticate()
38 ceph_x_validate_tickets(ac, &need); in ceph_x_should_authenticate()
40 ac->want_keys, need, xi->have_keys); in ceph_x_should_authenticate()
117 get_ticket_handler(struct ceph_auth_client *ac, int service) in get_ticket_handler() argument
120 struct ceph_x_info *xi = ac->private; in get_ticket_handler()
144 static void remove_ticket_handler(struct ceph_auth_client *ac, in remove_ticket_handler() argument
147 struct ceph_x_info *xi = ac->private; in remove_ticket_handler()
157 static int process_one_ticket(struct ceph_auth_client *ac, in process_one_ticket() argument
161 struct ceph_x_info *xi = ac->private; in process_one_ticket()
186 th = get_ticket_handler(ac, type); in process_one_ticket()
266 static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac, in ceph_x_proc_ticket_reply() argument
283 ret = process_one_ticket(ac, secret, &p, end); in ceph_x_proc_ticket_reply()
348 static int ceph_x_build_authorizer(struct ceph_auth_client *ac, in ceph_x_build_authorizer() argument
386 msg_a->global_id = cpu_to_le64(ac->global_id); in ceph_x_build_authorizer()
453 static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed) in ceph_x_validate_tickets() argument
455 int want = ac->want_keys; in ceph_x_validate_tickets()
456 struct ceph_x_info *xi = ac->private; in ceph_x_validate_tickets()
459 *pneed = ac->want_keys & ~(xi->have_keys); in ceph_x_validate_tickets()
464 if (!(ac->want_keys & service)) in ceph_x_validate_tickets()
470 th = get_ticket_handler(ac, service); in ceph_x_validate_tickets()
483 static int ceph_x_build_request(struct ceph_auth_client *ac, in ceph_x_build_request() argument
486 struct ceph_x_info *xi = ac->private; in ceph_x_build_request()
491 get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_build_request()
496 ceph_x_validate_tickets(ac, &need); in ceph_x_build_request()
499 ac->want_keys, xi->have_keys, need); in ceph_x_build_request()
548 ret = ceph_x_build_authorizer(ac, th, &xi->auth_authorizer); in ceph_x_build_request()
563 static int ceph_x_handle_reply(struct ceph_auth_client *ac, int result, in ceph_x_handle_reply() argument
566 struct ceph_x_info *xi = ac->private; in ceph_x_handle_reply()
596 ret = ceph_x_proc_ticket_reply(ac, &xi->secret, in ceph_x_handle_reply()
601 th = get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_handle_reply()
604 ret = ceph_x_proc_ticket_reply(ac, &th->session_key, in ceph_x_handle_reply()
613 if (ac->want_keys == xi->have_keys) in ceph_x_handle_reply()
627 struct ceph_auth_client *ac, int peer_type, in ceph_x_create_authorizer() argument
634 th = get_ticket_handler(ac, peer_type); in ceph_x_create_authorizer()
644 ret = ceph_x_build_authorizer(ac, th, au); in ceph_x_create_authorizer()
655 auth->sign_message = ac->ops->sign_message; in ceph_x_create_authorizer()
656 auth->check_message_signature = ac->ops->check_message_signature; in ceph_x_create_authorizer()
662 struct ceph_auth_client *ac, int peer_type, in ceph_x_update_authorizer() argument
668 th = get_ticket_handler(ac, peer_type); in ceph_x_update_authorizer()
676 return ceph_x_build_authorizer(ac, th, au); in ceph_x_update_authorizer()
704 static int ceph_x_add_authorizer_challenge(struct ceph_auth_client *ac, in ceph_x_add_authorizer_challenge() argument
729 static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac, in ceph_x_verify_authorizer_reply() argument
754 static void ceph_x_reset(struct ceph_auth_client *ac) in ceph_x_reset() argument
756 struct ceph_x_info *xi = ac->private; in ceph_x_reset()
763 static void ceph_x_destroy(struct ceph_auth_client *ac) in ceph_x_destroy() argument
765 struct ceph_x_info *xi = ac->private; in ceph_x_destroy()
768 dout("ceph_x_destroy %p\n", ac); in ceph_x_destroy()
774 remove_ticket_handler(ac, th); in ceph_x_destroy()
779 kfree(ac->private); in ceph_x_destroy()
780 ac->private = NULL; in ceph_x_destroy()
783 static void invalidate_ticket(struct ceph_auth_client *ac, int peer_type) in invalidate_ticket() argument
787 th = get_ticket_handler(ac, peer_type); in invalidate_ticket()
792 static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac, in ceph_x_invalidate_authorizer() argument
801 invalidate_ticket(ac, peer_type); in ceph_x_invalidate_authorizer()
802 invalidate_ticket(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_invalidate_authorizer()
931 int ceph_x_init(struct ceph_auth_client *ac) in ceph_x_init() argument
936 dout("ceph_x_init %p\n", ac); in ceph_x_init()
943 if (!ac->key) { in ceph_x_init()
948 ret = ceph_crypto_key_clone(&xi->secret, ac->key); in ceph_x_init()
957 ac->protocol = CEPH_AUTH_CEPHX; in ceph_x_init()
958 ac->private = xi; in ceph_x_init()
959 ac->ops = &ceph_x_ops; in ceph_x_init()