Lines Matching defs: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)
24 struct ceph_x_info *xi = ac->private;
28 ceph_x_validate_tickets(ac, &need);
29 missing = ac->want_keys & ~xi->have_keys;
32 ac->want_keys, xi->have_keys, missing, !missing);
36 static int ceph_x_should_authenticate(struct ceph_auth_client *ac)
38 struct ceph_x_info *xi = ac->private;
41 ceph_x_validate_tickets(ac, &need);
43 ac->want_keys, xi->have_keys, need, !!need);
120 get_ticket_handler(struct ceph_auth_client *ac, int service)
123 struct ceph_x_info *xi = ac->private;
147 static void remove_ticket_handler(struct ceph_auth_client *ac,
150 struct ceph_x_info *xi = ac->private;
160 static int process_one_ticket(struct ceph_auth_client *ac,
164 struct ceph_x_info *xi = ac->private;
189 th = get_ticket_handler(ac, type);
270 static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
286 ret = process_one_ticket(ac, secret, p, end);
351 static int ceph_x_build_authorizer(struct ceph_auth_client *ac,
390 msg_a->global_id = cpu_to_le64(ac->global_id);
458 static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed)
460 int want = ac->want_keys;
461 struct ceph_x_info *xi = ac->private;
464 *pneed = ac->want_keys & ~(xi->have_keys);
469 if (!(ac->want_keys & service))
475 th = get_ticket_handler(ac, service);
488 static int ceph_x_build_request(struct ceph_auth_client *ac,
491 struct ceph_x_info *xi = ac->private;
497 get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH);
502 ceph_x_validate_tickets(ac, &need);
503 dout("%s want 0x%x have 0x%x need 0x%x\n", __func__, ac->want_keys,
543 need = ac->want_keys & ~CEPH_ENTITY_TYPE_AUTH;
551 ret = ceph_x_build_authorizer(ac, th, &xi->auth_authorizer);
600 static int handle_auth_session_key(struct ceph_auth_client *ac, u64 global_id,
605 struct ceph_x_info *xi = ac->private;
612 ret = ceph_x_proc_ticket_reply(ac, &xi->secret, p, end);
616 ceph_auth_set_global_id(ac, global_id);
623 th = get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH);
653 ret = ceph_x_proc_ticket_reply(ac, &th->session_key,
665 static int ceph_x_handle_reply(struct ceph_auth_client *ac, u64 global_id,
670 struct ceph_x_info *xi = ac->private;
699 ret = handle_auth_session_key(ac, global_id, &p, end,
705 th = get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH);
710 ret = ceph_x_proc_ticket_reply(ac, &th->session_key, &p, end);
718 if (ac->want_keys == xi->have_keys)
735 struct ceph_auth_client *ac, int peer_type,
742 th = get_ticket_handler(ac, peer_type);
752 ret = ceph_x_build_authorizer(ac, th, au);
763 auth->sign_message = ac->ops->sign_message;
764 auth->check_message_signature = ac->ops->check_message_signature;
770 struct ceph_auth_client *ac, int peer_type,
776 th = get_ticket_handler(ac, peer_type);
784 return ceph_x_build_authorizer(ac, th, au);
817 static int ceph_x_add_authorizer_challenge(struct ceph_auth_client *ac,
875 static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac,
904 static void ceph_x_reset(struct ceph_auth_client *ac)
906 struct ceph_x_info *xi = ac->private;
913 static void ceph_x_destroy(struct ceph_auth_client *ac)
915 struct ceph_x_info *xi = ac->private;
918 dout("ceph_x_destroy %p\n", ac);
924 remove_ticket_handler(ac, th);
929 kfree(ac->private);
930 ac->private = NULL;
933 static void invalidate_ticket(struct ceph_auth_client *ac, int peer_type)
937 th = get_ticket_handler(ac, peer_type);
949 static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac,
958 invalidate_ticket(ac, peer_type);
959 invalidate_ticket(ac, CEPH_ENTITY_TYPE_AUTH);
1087 int ceph_x_init(struct ceph_auth_client *ac)
1092 dout("ceph_x_init %p\n", ac);
1099 if (!ac->key) {
1104 ret = ceph_crypto_key_clone(&xi->secret, ac->key);
1113 ac->protocol = CEPH_AUTH_CEPHX;
1114 ac->private = xi;
1115 ac->ops = &ceph_x_ops;