Skip to content
Snippets Groups Projects
Commit dedf7e22 authored by rswindell's avatar rswindell
Browse files

Warn the sysop that changing the System Password will require a regeneration

of the Cryptlib private key (cryptlib.key) and TLS certificate (ssl.cert) files.
When the system password is changed, prompt to delete the cryptlib.key and
ssl.cert files for the sysop.

This is sort of hacky-yucky but better than answering this FAQ all the time.
parent 3da9ce2d
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,19 @@ void sys_cfg(void)
static int sys_dflt,adv_dflt,tog_dflt,new_dflt;
char str[81],done=0;
int i,j,k,dflt,bar;
char sys_pass[sizeof(cfg.sys_pass)];
SAFECOPY(sys_pass, cfg.sys_pass);
char* cryptlib_syspass_helpbuf =
"`Changing the System Password requires new Cryptlib key and certificate:`\n"
"\n"
"The Cryptlib private key (`cryptlib.key`) and TLS certificate (`ssl.cert`)\n"
"files, located in the Synchronet `ctrl` directory, are encrypted with the\n"
"current `System Password`.\n"
"\n"
"Changing the System Password will require that the Cryptlib Private Key\n"
"and Certificate files be regenerated. The Cryptlib key and certificate\n"
"regeneration should occur automatically after the files are deleted and\n"
"the Synchronet servers are recycled.";
while(1) {
i=0;
......@@ -125,6 +138,16 @@ void sys_cfg(void)
break;
if(!i) {
cfg.new_install=new_install;
if(strcmp(sys_pass, cfg.sys_pass) != 0) {
uifc.helpbuf = cryptlib_syspass_helpbuf;
if((fexist("ssl.cert") || fexist("cryptlib.key"))
&& uifc.confirm("System Password Changed. Delete Cryptlib Key and Certificate?")) {
if(remove("ssl.cert") != 0)
uifc.msgf("Error %d removing ssl.cert", errno);
if(remove("cryptlib.key") != 0)
uifc.msgf("Error %d removing cryptlib.key", errno);
}
}
save_main_cfg(&cfg,backup_level);
refresh_cfg(&cfg);
}
......@@ -373,6 +396,9 @@ void sys_cfg(void)
uifc.input(WIN_MID,0,0,"System Operator",cfg.sys_op,sizeof(cfg.sys_op)-1,K_EDIT);
break;
case 4:
uifc.helpbuf=cryptlib_syspass_helpbuf;
if(uifc.deny("Changing SysPass requires new Cryptlib key/cert. Continue?"))
break;
uifc.helpbuf=
"`System Password:`\n"
"\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment