// Plays a custom client: signs an Alias post whose alias is the victim's fingerprint, with the fingerprint hidden (fp:false). // Built against a copy of post.cpp that only differs in one line (sign() forces fp:true for Alias), i.e. what any other // implementation of the documented envelope could produce. Prints the envelope JSON. #include "forumer_core/identity.h" #include "forumer_core/post.h" #include using namespace forumer; int main(int argc, char** argv) { auto victim = identity::Account::create("victim").persona(0); auto attacker = identity::Account::create("mallory").persona(0); post::Draft d; d.kind = post::Kind::Post; d.title = "totally me"; d.body = "this is " + victim.fingerprint(); d.domains = {"test"}; d.timestampMs = 1790000000000LL; post::Error e; setenv("PROBE_HIDE_FP", "1", 1); auto p = post::sign(d, attacker, identity::Disclosure::Alias, victim.fingerprint(), 16, &e); auto real = post::sign(d, victim, identity::Disclosure::Persona, "", 16, &e); std::cerr << "victim's real post displays as : " << real->authorDisplay() << "\n"; std::cout << p->toJson() << "\n"; }