]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
minor fixes...i think we in a happy state (knock on wood)
authoranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 2 Mar 2007 01:35:22 +0000 (01:35 +0000)
committeranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 2 Mar 2007 01:35:22 +0000 (01:35 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1155 29311d96-e01e-0410-9327-a35deaab8ce9

branches/aleung/security1/ceph/mon/Monitor.cc
branches/aleung/security1/ceph/osd/OSD.cc
branches/aleung/security1/ceph/osdc/Objecter.cc

index 548246cbf62fc9809fd96580cfd5edbe4a008e44..1acb45b6f5fca5033510b91f66d1a99ad35f5486 100644 (file)
@@ -70,8 +70,12 @@ void Monitor::init()
     // FIXME.
     bufferlist bl;
     //bl.append(myPrivKey.c_str(), myPrivKey.length());
+    string prvString = privToString(myPrivKey);
+    string pubString = pubToString(myPubKey);
+    ::_encode(prvString, bl);
+    ::_encode(pubString, bl);
     store->put_bl_ss(bl, "private_key", 0);
-    assert(0);
+    //assert(0);
   }
   else {
     store->mount();
@@ -81,12 +85,18 @@ void Monitor::init()
     bufferlist bl;
     store->get_bl_ss(bl, "private_key", 0);
     //myPrivKey = bl.c_str();
-
+    int off = 0;
+    string prvString, pubString;
+    ::_decode(prvString, bl, off);
+    ::_decode(pubString, bl, off);
+    // get keys from strings
+    myPrivKey = _fromStr_esignPrivKey(prvString);
+    myPubKey = _fromStr_esignPubKey(pubString);
     // der?
-    myPrivKey = esignPrivKey("crypto/esig1536.dat");
-    myPubKey = esignPubKey(myPrivKey);
+    //myPrivKey = esignPrivKey("crypto/esig1536.dat");
+    //myPubKey = esignPubKey(myPrivKey);
 
-    assert(0);
+    // assert(0);
   }
 
   // create 
index 2fa8fe2681a2e69144ff994f47c4a8753eaf94a8..e8864395c0e29951eca13b6e7d27c6fa70792b49 100644 (file)
@@ -2857,7 +2857,7 @@ void OSD::op_read(MOSDOp *op)//, PG *pg)
 
   // FIXME only verfiy reads from a client
   // i know, i know...not secure but they should all have caps
-  if (op->get_dest().is_client()) {
+  if (op->get_source().is_client()) {
     ExtCap *op_capability = op->get_capability();
     assert(op_capability);
     cout << "OSD recieved a read capability" << endl;
@@ -3210,7 +3210,7 @@ void OSD::op_modify(MOSDOp *op, PG *pg)
   // FIXME only verfiy writes from a client
   // i know, i know...not secure but they should all have caps
   if (op->get_op() == OSD_OP_WRITE
-      && op->get_dest().is_client()) {
+      && op->get_source().is_client()) {
     ExtCap *op_capability = op->get_capability();
     assert(op_capability);
     if (op_capability->verif_extcap(monmap->get_key()))
index c1dc93f274901473a6442bd6010512d5bc6c29d0..fe505461a7fbf4dcda616ef3c0e9fc8997221970 100644 (file)
@@ -393,7 +393,7 @@ tid_t Objecter::readx_submit(OSDRead *rd, ObjectExtent &ex)
   // set ext cap
   // FIXME mds currently is writing without caps...so we let it
   // all other (client) writes should have cap
-  if (messenger->get_myname().is_client())
+  if (m->get_client().is_client())
     m->set_capability(rd->ext_cap);
   dout(10) << "readx_submit " << rd << " tid " << last_tid
            << " oid " << ex.oid << " " << ex.start << "~" << ex.length
@@ -664,7 +664,7 @@ tid_t Objecter::modifyx_submit(OSDModify *wr, ObjectExtent &ex, tid_t usetid)
   // only cap for a write, fix later
   // FIXME mds does writes through this interface without a cap
   // we let it for now
-  if (wr->op == OSD_OP_WRITE && messenger->get_myname().is_client())
+  if (wr->op == OSD_OP_WRITE && m->get_client().is_client())
       m->set_capability(wr->modify_cap);   
 
   if (wr->tid_version.count(tid))