diff options
author | Yan, Zheng <zyan@redhat.com> | 2014-11-04 03:33:37 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@redhat.com> | 2014-12-17 12:09:50 -0500 |
commit | 33d07337962c7bbd2fd5cf7f1106735c9507fbe2 (patch) | |
tree | 93a95e7d02db4d7ba7d282483e32fd0627a3c281 /fs | |
parent | ae385eaf24dc39c1703049112e4265b9f93b7d86 (diff) |
libceph: message signature support
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/mds_client.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index fc74617069a3..9f00853f6d42 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -3744,6 +3744,20 @@ static struct ceph_msg *mds_alloc_msg(struct ceph_connection *con, | |||
3744 | return msg; | 3744 | return msg; |
3745 | } | 3745 | } |
3746 | 3746 | ||
3747 | static int sign_message(struct ceph_connection *con, struct ceph_msg *msg) | ||
3748 | { | ||
3749 | struct ceph_mds_session *s = con->private; | ||
3750 | struct ceph_auth_handshake *auth = &s->s_auth; | ||
3751 | return ceph_auth_sign_message(auth, msg); | ||
3752 | } | ||
3753 | |||
3754 | static int check_message_signature(struct ceph_connection *con, struct ceph_msg *msg) | ||
3755 | { | ||
3756 | struct ceph_mds_session *s = con->private; | ||
3757 | struct ceph_auth_handshake *auth = &s->s_auth; | ||
3758 | return ceph_auth_check_message_signature(auth, msg); | ||
3759 | } | ||
3760 | |||
3747 | static const struct ceph_connection_operations mds_con_ops = { | 3761 | static const struct ceph_connection_operations mds_con_ops = { |
3748 | .get = con_get, | 3762 | .get = con_get, |
3749 | .put = con_put, | 3763 | .put = con_put, |
@@ -3753,6 +3767,8 @@ static const struct ceph_connection_operations mds_con_ops = { | |||
3753 | .invalidate_authorizer = invalidate_authorizer, | 3767 | .invalidate_authorizer = invalidate_authorizer, |
3754 | .peer_reset = peer_reset, | 3768 | .peer_reset = peer_reset, |
3755 | .alloc_msg = mds_alloc_msg, | 3769 | .alloc_msg = mds_alloc_msg, |
3770 | .sign_message = sign_message, | ||
3771 | .check_message_signature = check_message_signature, | ||
3756 | }; | 3772 | }; |
3757 | 3773 | ||
3758 | /* eof */ | 3774 | /* eof */ |