// 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();
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
// 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;
// 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()))
// 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
// 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))