auth_x.c (94bd217e2d683719ab21a4ac117d8a1b91cbedc9) auth_x.c (74f1869f76d043bad12ec03b4d5f04a8c3d1f157)
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

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

521 return ret;
522 if (ac->want_keys == xi->have_keys)
523 return 0;
524 return -EAGAIN;
525}
526
527static int ceph_x_create_authorizer(
528 struct ceph_auth_client *ac, int peer_type,
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

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

521 return ret;
522 if (ac->want_keys == xi->have_keys)
523 return 0;
524 return -EAGAIN;
525}
526
527static int ceph_x_create_authorizer(
528 struct ceph_auth_client *ac, int peer_type,
529 struct ceph_authorizer **a,
530 void **buf, size_t *len,
531 void **reply_buf, size_t *reply_len)
529 struct ceph_auth_handshake *auth)
532{
533 struct ceph_x_authorizer *au;
534 struct ceph_x_ticket_handler *th;
535 int ret;
536
537 th = get_ticket_handler(ac, peer_type);
538 if (IS_ERR(th))
539 return PTR_ERR(th);
540
541 au = kzalloc(sizeof(*au), GFP_NOFS);
542 if (!au)
543 return -ENOMEM;
544
545 ret = ceph_x_build_authorizer(ac, th, au);
546 if (ret) {
547 kfree(au);
548 return ret;
549 }
550
530{
531 struct ceph_x_authorizer *au;
532 struct ceph_x_ticket_handler *th;
533 int ret;
534
535 th = get_ticket_handler(ac, peer_type);
536 if (IS_ERR(th))
537 return PTR_ERR(th);
538
539 au = kzalloc(sizeof(*au), GFP_NOFS);
540 if (!au)
541 return -ENOMEM;
542
543 ret = ceph_x_build_authorizer(ac, th, au);
544 if (ret) {
545 kfree(au);
546 return ret;
547 }
548
551 *a = (struct ceph_authorizer *)au;
552 *buf = au->buf->vec.iov_base;
553 *len = au->buf->vec.iov_len;
554 *reply_buf = au->reply_buf;
555 *reply_len = sizeof(au->reply_buf);
549 auth->authorizer = (struct ceph_authorizer *) au;
550 auth->authorizer_buf = au->buf->vec.iov_base;
551 auth->authorizer_buf_len = au->buf->vec.iov_len;
552 auth->authorizer_reply_buf = au->reply_buf;
553 auth->authorizer_reply_buf_len = sizeof (au->reply_buf);
554
556 return 0;
557}
558
559static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac,
560 struct ceph_authorizer *a, size_t len)
561{
562 struct ceph_x_authorizer *au = (void *)a;
563 struct ceph_x_ticket_handler *th;

--- 127 unchanged lines hidden ---
555 return 0;
556}
557
558static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac,
559 struct ceph_authorizer *a, size_t len)
560{
561 struct ceph_x_authorizer *au = (void *)a;
562 struct ceph_x_ticket_handler *th;

--- 127 unchanged lines hidden ---