mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-11 07:17:53 +00:00
signing userpost without rt/sig_rt to do rt again...
This commit is contained in:
parent
f857194215
commit
8d5bd0c956
@ -1618,10 +1618,24 @@ bool createSignedUserpost(entry &v, std::string const &username, int k,
|
||||
switch(flag)
|
||||
{
|
||||
case USERPOST_FLAG_RT:
|
||||
{
|
||||
if (msg.size())
|
||||
{
|
||||
std::vector<char> buf;
|
||||
bencode(std::back_inserter(buf), userpost);
|
||||
std::string sig = createSignature(std::string(buf.data(),buf.size()), username);
|
||||
if(sig.size())
|
||||
{
|
||||
v["sig_wort"] = sig;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//userpost["t"] = "rt";
|
||||
userpost["rt"] = *ent;
|
||||
userpost["sig_rt"] = *sig;
|
||||
break;
|
||||
}
|
||||
case USERPOST_FLAG_FAV:
|
||||
userpost["fav"] = *ent;
|
||||
userpost["sig_fav"] = *sig;
|
||||
|
@ -373,6 +373,7 @@ void hexcapePost(libtorrent::entry &e)
|
||||
{
|
||||
if( e.type() == libtorrent::entry::dictionary_t ) {
|
||||
findAndHexcape(e,"sig_userpost");
|
||||
findAndHexcape(e,"sig_wort");
|
||||
if( e.find_key("userpost") ) {
|
||||
entry &userpost = e["userpost"];
|
||||
if( userpost.type() == libtorrent::entry::dictionary_t ) {
|
||||
|
Loading…
Reference in New Issue
Block a user