auth_x.c (9938b04472d5c59f8bd8152a548533a8599596a2) auth_x.c (6c1ea260f89709e0021d2c59f8fd2a104b5b1123)
1
2#include <linux/ceph/ceph_debug.h>
3
4#include <linux/err.h>
5#include <linux/module.h>
6#include <linux/random.h>
7#include <linux/slab.h>
8

--- 551 unchanged lines hidden (view full) ---

560 }
561 if (ret)
562 return ret;
563 if (ac->want_keys == xi->have_keys)
564 return 0;
565 return -EAGAIN;
566}
567
1
2#include <linux/ceph/ceph_debug.h>
3
4#include <linux/err.h>
5#include <linux/module.h>
6#include <linux/random.h>
7#include <linux/slab.h>
8

--- 551 unchanged lines hidden (view full) ---

560 }
561 if (ret)
562 return ret;
563 if (ac->want_keys == xi->have_keys)
564 return 0;
565 return -EAGAIN;
566}
567
568static void ceph_x_destroy_authorizer(struct ceph_authorizer *a)
569{
570 struct ceph_x_authorizer *au = (void *)a;
571
572 ceph_x_authorizer_cleanup(au);
573 kfree(au);
574}
575
568static int ceph_x_create_authorizer(
569 struct ceph_auth_client *ac, int peer_type,
570 struct ceph_auth_handshake *auth)
571{
572 struct ceph_x_authorizer *au;
573 struct ceph_x_ticket_handler *th;
574 int ret;
575
576 th = get_ticket_handler(ac, peer_type);
577 if (IS_ERR(th))
578 return PTR_ERR(th);
579
580 au = kzalloc(sizeof(*au), GFP_NOFS);
581 if (!au)
582 return -ENOMEM;
583
576static int ceph_x_create_authorizer(
577 struct ceph_auth_client *ac, int peer_type,
578 struct ceph_auth_handshake *auth)
579{
580 struct ceph_x_authorizer *au;
581 struct ceph_x_ticket_handler *th;
582 int ret;
583
584 th = get_ticket_handler(ac, peer_type);
585 if (IS_ERR(th))
586 return PTR_ERR(th);
587
588 au = kzalloc(sizeof(*au), GFP_NOFS);
589 if (!au)
590 return -ENOMEM;
591
592 au->base.destroy = ceph_x_destroy_authorizer;
593
584 ret = ceph_x_build_authorizer(ac, th, au);
585 if (ret) {
586 kfree(au);
587 return ret;
588 }
589
590 auth->authorizer = (struct ceph_authorizer *) au;
591 auth->authorizer_buf = au->buf->vec.iov_base;

--- 46 unchanged lines hidden (view full) ---

638 ret = -EPERM;
639 else
640 ret = 0;
641 dout("verify_authorizer_reply nonce %llx got %llx ret %d\n",
642 au->nonce, le64_to_cpu(reply.nonce_plus_one), ret);
643 return ret;
644}
645
594 ret = ceph_x_build_authorizer(ac, th, au);
595 if (ret) {
596 kfree(au);
597 return ret;
598 }
599
600 auth->authorizer = (struct ceph_authorizer *) au;
601 auth->authorizer_buf = au->buf->vec.iov_base;

--- 46 unchanged lines hidden (view full) ---

648 ret = -EPERM;
649 else
650 ret = 0;
651 dout("verify_authorizer_reply nonce %llx got %llx ret %d\n",
652 au->nonce, le64_to_cpu(reply.nonce_plus_one), ret);
653 return ret;
654}
655
646static void ceph_x_destroy_authorizer(struct ceph_auth_client *ac,
647 struct ceph_authorizer *a)
648{
649 struct ceph_x_authorizer *au = (void *)a;
650
651 ceph_x_authorizer_cleanup(au);
652 kfree(au);
653}
654
655
656static void ceph_x_reset(struct ceph_auth_client *ac)
657{
658 struct ceph_x_info *xi = ac->private;
659
660 dout("reset\n");
661 xi->starting = true;
662 xi->server_challenge = 0;
663}

--- 101 unchanged lines hidden (view full) ---

765 .name = "x",
766 .is_authenticated = ceph_x_is_authenticated,
767 .should_authenticate = ceph_x_should_authenticate,
768 .build_request = ceph_x_build_request,
769 .handle_reply = ceph_x_handle_reply,
770 .create_authorizer = ceph_x_create_authorizer,
771 .update_authorizer = ceph_x_update_authorizer,
772 .verify_authorizer_reply = ceph_x_verify_authorizer_reply,
656static void ceph_x_reset(struct ceph_auth_client *ac)
657{
658 struct ceph_x_info *xi = ac->private;
659
660 dout("reset\n");
661 xi->starting = true;
662 xi->server_challenge = 0;
663}

--- 101 unchanged lines hidden (view full) ---

765 .name = "x",
766 .is_authenticated = ceph_x_is_authenticated,
767 .should_authenticate = ceph_x_should_authenticate,
768 .build_request = ceph_x_build_request,
769 .handle_reply = ceph_x_handle_reply,
770 .create_authorizer = ceph_x_create_authorizer,
771 .update_authorizer = ceph_x_update_authorizer,
772 .verify_authorizer_reply = ceph_x_verify_authorizer_reply,
773 .destroy_authorizer = ceph_x_destroy_authorizer,
774 .invalidate_authorizer = ceph_x_invalidate_authorizer,
775 .reset = ceph_x_reset,
776 .destroy = ceph_x_destroy,
777 .sign_message = ceph_x_sign_message,
778 .check_message_signature = ceph_x_check_message_signature,
779};
780
781

--- 38 unchanged lines hidden ---
773 .invalidate_authorizer = ceph_x_invalidate_authorizer,
774 .reset = ceph_x_reset,
775 .destroy = ceph_x_destroy,
776 .sign_message = ceph_x_sign_message,
777 .check_message_signature = ceph_x_check_message_signature,
778};
779
780

--- 38 unchanged lines hidden ---