]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Pipe, cephx: Message signing under config option 1151/head
authorSomnath Roy <somnath.roy@sandisk.com>
Wed, 22 Jan 2014 18:30:32 +0000 (10:30 -0800)
committerGreg Farnum <greg@inktank.com>
Fri, 31 Jan 2014 23:54:40 +0000 (15:54 -0800)
The config option was present earlier but the option is checked
not in the beginning, so, it was doing some stuff. Now the config
option guard is at the very beginning of the function.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
src/auth/cephx/CephxSessionHandler.cc

index 460e2526e10e2dd6255407b2020244bc419ad977..b2d402d2af36b7e62b4b0bb5196a8138982d3272 100644 (file)
 
 int CephxSessionHandler::sign_message(Message *m)
 {
-  bufferlist bl_plaintext, bl_encrypted;
-  ceph_msg_header header = m->get_header();
-  std::string error;
-
   // If runtime signing option is off, just return success without signing.
   if (!cct->_conf->cephx_sign_messages) {
     return 0;
   }
+  bufferlist bl_plaintext, bl_encrypted;
+  ceph_msg_header header = m->get_header();
+  std::string error;
 
   ceph_msg_footer& en_footer = m->get_footer();
 
@@ -71,16 +70,16 @@ int CephxSessionHandler::sign_message(Message *m)
 
 int CephxSessionHandler::check_message_signature(Message *m)
 {
-  bufferlist bl_plaintext, bl_ciphertext;
-  std::string sig_error;
-  ceph_msg_header& header = m->get_header();
-  ceph_msg_footer& footer = m->get_footer();
-
   // If runtime signing option is off, just return success without checking signature.
   if (!cct->_conf->cephx_sign_messages) {
     return 0;
   }
 
+  bufferlist bl_plaintext, bl_ciphertext;
+  std::string sig_error;
+  ceph_msg_header& header = m->get_header();
+  ceph_msg_footer& footer = m->get_footer();
+
   if ((features & CEPH_FEATURE_MSG_AUTH) == 0) {
     // it's fine, we didn't negotiate this feature.
     return 0;