Scrub privkeys from memory after done

This commit is contained in:
jl777
2019-07-15 04:06:20 -11:00
parent 9ac1b1fea8
commit ab4619c98b
14 changed files with 119 additions and 44 deletions

View File

@@ -963,6 +963,7 @@ UniValue rogue_keystrokes(uint64_t txfee,struct CCcontract_info *cp,cJSON *param
CCaddr1of2set(cp,roguepk,mypk,mypriv,destaddr);
rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,rogue_keystrokesopret(gametxid,batontxid,mypk,keystrokes));
//fprintf(stderr,"KEYSTROKES.(%s)\n",rawtx.c_str());
memset(mypriv,0,32);
return(rogue_rawtxresult(result,rawtx,1));
} else return(cclib_error(result,"keystrokes tx was too late"));
} else return(cclib_error(result,"couldnt find batontxid"));
@@ -1330,6 +1331,7 @@ UniValue rogue_finishgame(uint64_t txfee,struct CCcontract_info *cp,cJSON *param
GetOpReturnData(opret, vopretNonfungible);
rawtx = FinalizeCCTx(0, cp, mtx, mypk, txfee, EncodeTokenCreateOpRet('c', Mypubkey(), std::string(seedstr), gametxid.GetHex(), vopretNonfungible));
}
memset(mypriv,0,32);
return(rogue_rawtxresult(result,rawtx,1));
}
result.push_back(Pair("result","success"));