mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-25 14:04:27 +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)
|
switch(flag)
|
||||||
{
|
{
|
||||||
case USERPOST_FLAG_RT:
|
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["t"] = "rt";
|
||||||
userpost["rt"] = *ent;
|
userpost["rt"] = *ent;
|
||||||
userpost["sig_rt"] = *sig;
|
userpost["sig_rt"] = *sig;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case USERPOST_FLAG_FAV:
|
case USERPOST_FLAG_FAV:
|
||||||
userpost["fav"] = *ent;
|
userpost["fav"] = *ent;
|
||||||
userpost["sig_fav"] = *sig;
|
userpost["sig_fav"] = *sig;
|
||||||
|
@ -373,6 +373,7 @@ void hexcapePost(libtorrent::entry &e)
|
|||||||
{
|
{
|
||||||
if( e.type() == libtorrent::entry::dictionary_t ) {
|
if( e.type() == libtorrent::entry::dictionary_t ) {
|
||||||
findAndHexcape(e,"sig_userpost");
|
findAndHexcape(e,"sig_userpost");
|
||||||
|
findAndHexcape(e,"sig_wort");
|
||||||
if( e.find_key("userpost") ) {
|
if( e.find_key("userpost") ) {
|
||||||
entry &userpost = e["userpost"];
|
entry &userpost = e["userpost"];
|
||||||
if( userpost.type() == libtorrent::entry::dictionary_t ) {
|
if( userpost.type() == libtorrent::entry::dictionary_t ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user