Lines Matching full:ac

36 static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed);
38 static int ceph_x_is_authenticated(struct ceph_auth_client *ac) in ceph_x_is_authenticated() argument
40 struct ceph_x_info *xi = ac->private; in ceph_x_is_authenticated()
44 ceph_x_validate_tickets(ac, &need); in ceph_x_is_authenticated()
45 missing = ac->want_keys & ~xi->have_keys; in ceph_x_is_authenticated()
48 ac->want_keys, xi->have_keys, missing, !missing); in ceph_x_is_authenticated()
52 static int ceph_x_should_authenticate(struct ceph_auth_client *ac) in ceph_x_should_authenticate() argument
54 struct ceph_x_info *xi = ac->private; in ceph_x_should_authenticate()
57 ceph_x_validate_tickets(ac, &need); in ceph_x_should_authenticate()
59 ac->want_keys, xi->have_keys, need, !!need); in ceph_x_should_authenticate()
151 get_ticket_handler(struct ceph_auth_client *ac, int service) in get_ticket_handler() argument
154 struct ceph_x_info *xi = ac->private; in get_ticket_handler()
178 static void remove_ticket_handler(struct ceph_auth_client *ac, in remove_ticket_handler() argument
181 struct ceph_x_info *xi = ac->private; in remove_ticket_handler()
191 static int process_one_ticket(struct ceph_auth_client *ac, in process_one_ticket() argument
195 struct ceph_x_info *xi = ac->private; in process_one_ticket()
220 th = get_ticket_handler(ac, type); in process_one_ticket()
310 static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac, in ceph_x_proc_ticket_reply() argument
326 ret = process_one_ticket(ac, secret, p, end); in ceph_x_proc_ticket_reply()
393 static int ceph_x_build_authorizer(struct ceph_auth_client *ac, in ceph_x_build_authorizer() argument
437 msg_a->global_id = cpu_to_le64(ac->global_id); in ceph_x_build_authorizer()
505 static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed) in ceph_x_validate_tickets() argument
507 int want = ac->want_keys; in ceph_x_validate_tickets()
508 struct ceph_x_info *xi = ac->private; in ceph_x_validate_tickets()
511 *pneed = ac->want_keys & ~(xi->have_keys); in ceph_x_validate_tickets()
516 if (!(ac->want_keys & service)) in ceph_x_validate_tickets()
522 th = get_ticket_handler(ac, service); in ceph_x_validate_tickets()
535 static int ceph_x_build_request(struct ceph_auth_client *ac, in ceph_x_build_request() argument
538 struct ceph_x_info *xi = ac->private; in ceph_x_build_request()
544 get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_build_request()
549 ceph_x_validate_tickets(ac, &need); in ceph_x_build_request()
550 dout("%s want 0x%x have 0x%x need 0x%x\n", __func__, ac->want_keys, in ceph_x_build_request()
604 need = ac->want_keys & ~CEPH_ENTITY_TYPE_AUTH; in ceph_x_build_request()
612 ret = ceph_x_build_authorizer(ac, th, &xi->auth_authorizer); in ceph_x_build_request()
661 static int handle_auth_session_key(struct ceph_auth_client *ac, u64 global_id, in handle_auth_session_key() argument
666 struct ceph_x_info *xi = ac->private; in handle_auth_session_key()
673 ret = ceph_x_proc_ticket_reply(ac, &xi->secret, p, end); in handle_auth_session_key()
677 ceph_auth_set_global_id(ac, global_id); in handle_auth_session_key()
684 th = get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH); in handle_auth_session_key()
718 ret = ceph_x_proc_ticket_reply(ac, &th->session_key, in handle_auth_session_key()
730 static int ceph_x_handle_reply(struct ceph_auth_client *ac, u64 global_id, in ceph_x_handle_reply() argument
735 struct ceph_x_info *xi = ac->private; in ceph_x_handle_reply()
764 ret = handle_auth_session_key(ac, global_id, &p, end, in ceph_x_handle_reply()
770 th = get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_handle_reply()
775 ret = ceph_x_proc_ticket_reply(ac, &th->session_key, &p, end); in ceph_x_handle_reply()
783 if (ac->want_keys == xi->have_keys) in ceph_x_handle_reply()
800 struct ceph_auth_client *ac, int peer_type, in ceph_x_create_authorizer() argument
807 th = get_ticket_handler(ac, peer_type); in ceph_x_create_authorizer()
817 ret = ceph_x_build_authorizer(ac, th, au); in ceph_x_create_authorizer()
828 auth->sign_message = ac->ops->sign_message; in ceph_x_create_authorizer()
829 auth->check_message_signature = ac->ops->check_message_signature; in ceph_x_create_authorizer()
835 struct ceph_auth_client *ac, int peer_type, in ceph_x_update_authorizer() argument
841 th = get_ticket_handler(ac, peer_type); in ceph_x_update_authorizer()
849 return ceph_x_build_authorizer(ac, th, au); in ceph_x_update_authorizer()
884 static int ceph_x_add_authorizer_challenge(struct ceph_auth_client *ac, in ceph_x_add_authorizer_challenge() argument
943 static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac, in ceph_x_verify_authorizer_reply() argument
972 static void ceph_x_reset(struct ceph_auth_client *ac) in ceph_x_reset() argument
974 struct ceph_x_info *xi = ac->private; in ceph_x_reset()
981 static void ceph_x_destroy(struct ceph_auth_client *ac) in ceph_x_destroy() argument
983 struct ceph_x_info *xi = ac->private; in ceph_x_destroy()
986 dout("ceph_x_destroy %p\n", ac); in ceph_x_destroy()
992 remove_ticket_handler(ac, th); in ceph_x_destroy()
997 kfree(ac->private); in ceph_x_destroy()
998 ac->private = NULL; in ceph_x_destroy()
1001 static void invalidate_ticket(struct ceph_auth_client *ac, int peer_type) in invalidate_ticket() argument
1005 th = get_ticket_handler(ac, peer_type); in invalidate_ticket()
1017 static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac, in ceph_x_invalidate_authorizer() argument
1026 invalidate_ticket(ac, peer_type); in ceph_x_invalidate_authorizer()
1027 invalidate_ticket(ac, CEPH_ENTITY_TYPE_AUTH); in ceph_x_invalidate_authorizer()
1171 int ceph_x_init(struct ceph_auth_client *ac) in ceph_x_init() argument
1176 dout("ceph_x_init %p\n", ac); in ceph_x_init()
1182 if (!ac->key) { in ceph_x_init()
1187 ret = ceph_crypto_key_clone(&xi->secret, ac->key); in ceph_x_init()
1203 ac->protocol = CEPH_AUTH_CEPHX; in ceph_x_init()
1204 ac->private = xi; in ceph_x_init()
1205 ac->ops = &ceph_x_ops; in ceph_x_init()