auth_none.c (2d8ad8719591fa803b0d589ed057fa46f49b7155) auth_none.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

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

54
55/*
56 * build an 'authorizer' with our entity_name and global_id. we can
57 * reuse a single static copy since it is identical for all services
58 * we connect to.
59 */
60static int ceph_auth_none_create_authorizer(
61 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

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

54
55/*
56 * build an 'authorizer' with our entity_name and global_id. we can
57 * reuse a single static copy since it is identical for all services
58 * we connect to.
59 */
60static int ceph_auth_none_create_authorizer(
61 struct ceph_auth_client *ac, int peer_type,
62 struct ceph_authorizer **a,
63 void **buf, size_t *len,
64 void **reply_buf, size_t *reply_len)
62 struct ceph_auth_handshake *auth)
65{
66 struct ceph_auth_none_info *ai = ac->private;
67 struct ceph_none_authorizer *au = &ai->au;
68 void *p, *end;
69 int ret;
70
71 if (!ai->built_authorizer) {
72 p = au->buf;

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

77 goto bad;
78 ceph_decode_need(&p, end, sizeof(u64), bad2);
79 ceph_encode_64(&p, ac->global_id);
80 au->buf_len = p - (void *)au->buf;
81 ai->built_authorizer = true;
82 dout("built authorizer len %d\n", au->buf_len);
83 }
84
63{
64 struct ceph_auth_none_info *ai = ac->private;
65 struct ceph_none_authorizer *au = &ai->au;
66 void *p, *end;
67 int ret;
68
69 if (!ai->built_authorizer) {
70 p = au->buf;

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

75 goto bad;
76 ceph_decode_need(&p, end, sizeof(u64), bad2);
77 ceph_encode_64(&p, ac->global_id);
78 au->buf_len = p - (void *)au->buf;
79 ai->built_authorizer = true;
80 dout("built authorizer len %d\n", au->buf_len);
81 }
82
85 *a = (struct ceph_authorizer *)au;
86 *buf = au->buf;
87 *len = au->buf_len;
88 *reply_buf = au->reply_buf;
89 *reply_len = sizeof(au->reply_buf);
83 auth->authorizer = (struct ceph_authorizer *) au;
84 auth->authorizer_buf = au->buf;
85 auth->authorizer_buf_len = au->buf_len;
86 auth->authorizer_reply_buf = au->reply_buf;
87 auth->authorizer_reply_buf_len = sizeof (au->reply_buf);
88
90 return 0;
91
92bad2:
93 ret = -ERANGE;
94bad:
95 return ret;
96}
97

--- 35 unchanged lines hidden ---
89 return 0;
90
91bad2:
92 ret = -ERANGE;
93bad:
94 return ret;
95}
96

--- 35 unchanged lines hidden ---