libceph: add nocephx_sign_messages option
Support for message signing was merged into 3.19, along with nocephx_require_signatures option. But, all that option does is allow the kernel client to talk to clusters that don't support MSG_AUTH feature bit. That's pretty useless, given that it's been supported since bobtail. Meanwhile, if one disables message signing on the server side with "cephx sign messages = false", it becomes impossible to use the kernel client since it expects messages to be signed if MSG_AUTH was negotiated. Add nocephx_sign_messages option to support this use case. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <linux/ceph/decode.h>
|
||||
#include <linux/ceph/auth.h>
|
||||
#include <linux/ceph/libceph.h>
|
||||
#include <linux/ceph/messenger.h>
|
||||
|
||||
#include "crypto.h"
|
||||
@@ -698,6 +699,9 @@ static int ceph_x_sign_message(struct ceph_auth_handshake *auth,
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (ceph_test_opt(from_msgr(msg->con->msgr), NOMSGSIGN))
|
||||
return 0;
|
||||
|
||||
ret = calcu_signature((struct ceph_x_authorizer *)auth->authorizer,
|
||||
msg, &msg->footer.sig);
|
||||
if (ret < 0)
|
||||
@@ -712,6 +716,9 @@ static int ceph_x_check_message_signature(struct ceph_auth_handshake *auth,
|
||||
__le64 sig_check;
|
||||
int ret;
|
||||
|
||||
if (ceph_test_opt(from_msgr(msg->con->msgr), NOMSGSIGN))
|
||||
return 0;
|
||||
|
||||
ret = calcu_signature((struct ceph_x_authorizer *)auth->authorizer,
|
||||
msg, &sig_check);
|
||||
if (ret < 0)
|
||||
|
Reference in New Issue
Block a user