#include #include #include #include #include "fdpass.h" #include #include #include using namespace std; int main (int argc, char *argv[]) { glocal int ret = -1; glocal const char *secretfile = "/etc/blackhole.secrets"; glocal bool replace = false; glocal.ret = (argc,argv); setproginfo ("blackhole-gensecret",VERSION ,"Gererate secrets used to communicate with horizon, wormhole and sub-blackhole\n" "\n" "blackhole-gensecret [ options ] horizon-name ...\n"); setarg (' ',"secretfile","File holding secrets",glocal.secretfile,false); setarg ('r',"replace","Replace old secrets in file",glocal.replace,false); glocal vector lines; glocal set names; for (int i=0; i(glocal.secretfile,true); glocal.lines.push_back(line); return 0; (glocal.secretfile,false); for (unsigned i=0; i::iterator it=glocal.names.begin(); it != glocal.names.end(); it++){ char out[32+1]; fdpass_makesalt(out); fprintf (fout,"%s %s\n",it->c_str(),out); } return 0; return 0; return glocal.ret; }