From a29ffeed1a5bcadef6c5ef4638703c2c7468e20c Mon Sep 17 00:00:00 2001 From: flowtron Date: Tue, 17 Aug 2021 13:51:34 +0200 Subject: [PATCH] server private key: no default and HowTo --- config/menus_auth.cfg | 28 ++++++++++++++++------------ source/src/protos.h | 16 ++++++++++++++-- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/config/menus_auth.cfg b/config/menus_auth.cfg index aa75c032..2c0f92c8 100644 --- a/config/menus_auth.cfg +++ b/config/menus_auth.cfg @@ -1,20 +1,24 @@ newmenu [auth setup] menuinit [ tempalias ___ppass "" ; tempalias ___pass ""; tempalias ___rememberpass 0; ] -menuitem "To play online you need to create a game account which will be used" -1 -menuitem "identify you to game servers. This identity is stored as a public/private" -1 -menuitem "keypair and only the public key is ever transmitted to the server. You are" -1 -menuitem "able to change the password at a future point in time." -1 -menuitem "" -1 -menuitem "There exists a mechanism to recover your identity if lost that uses a" -1 -menuitem "seperate password." -1 -menuitem "" -1 -menuitem "To learn more about this functionality you can go to this URL in your browser" -1 -menuitem "\f1https://assault.cubers.net/docs/auth.html" -1 +menuitem "To play online you need to create an account" -1 +menuitem "which servers will use to identify you." -1 +menuitem "This identity is stored as a public/private keypair." -1 +menuitem "\f5Keep the \f2private key \f3private\f5!" -1 +menuitem "You can change the unlock password at any time." -1 +menuitem "You can NOT change the master password. Ever." -1 menuitem "" -1 +//TODO: auth.html does not exist and the procedure does not exist +//menuitem "The way to recover a lost identity uses" -1 +//menuitem "a seperate and unchangeable password." -1 +//menuitem "" -1 +//menuitem "To learn more about this functionality you can go to this URL in your browser" -1 +//menuitem "\f1https://assault.cubers.net/docs/auth.html" -1 +//menuitem "" -1 +//ABOUT: the master password was advertised as 'password for account restoration' menuitem "\f0Set passwords \f4(recommended)" -1 -menuitemtextinput "Password for your game account\t" "" [___pass = $arg1] [] 64 -menuitemtextinput "Password for account restoration\t" "" [___ppass = $arg1] [] 64 +menuitemtextinput "Unlock password\t" "" [___pass = $arg1] [] 64 +menuitemtextinput "Master password\t" "" [___ppass = $arg1] [] 64 menuitem "" -1 menuitemradio "Remember game account password: " 0 1 [ ] [ "No \f4(recommended)" "Yes"] [ ___rememberpass = (= $arg1 1)] menuitem "\f2\t\t\t [ OK ]" [ diff --git a/source/src/protos.h b/source/src/protos.h index 9d003584..4be6ae99 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -1173,7 +1173,7 @@ struct servercommandline servercommandline() : uprate(0), serverport(CUBE_DEFAULT_SERVER_PORT), syslogfacility(6), filethres(-1), syslogthres(-1), maxdemos(-1), maxclients(DEFAULTCLIENTS), kickthreshold(-5), banthreshold(-6), verbose(0), incoming_limit(10), afk_limit(45000), ban_time(20*60*1000), - ip(""), master(NULL), logident(""), serverpassword(""), adminpasswd(""), demopath(NULL), + ip(""), master(NULL), logident(""), serverpassword(""), adminpasswd(""), demopath("demos/"), maprotfile("config/maprot.cfg"), pwdfile("config/serverpwd.cfg"), blfile("config/serverblacklist.cfg"), geoipfile("config/geoip.cfg"), nbfile("config/nicknameblacklist.cfg"), infopath("config/serverinfo"), motdpath("config/motd"), forbidden("config/forbidden.cfg"), service(NULL), logfilepath("logs/"), parfilepath("config/serverparameters.cfg"), ssk(NULL), vitabasename("config/servervita"), logtimestamp(false), demo_interm(false), loggamestatus(true), @@ -1191,7 +1191,19 @@ struct servercommandline // client: dtwhzbsave switch(arg[1]) { // todo: gjlqEJQU - case 'Y': ssk = a; break; // private server key + case 'Y': // private server key + { + bool allas = true; // a is all A's? + loopi(strlen(a)){ if(a[i]!='A') allas = false; } + if(allas){ + printf("KEY FAILURE: you provided the (inacceptable) example private key.\nKEY FAILURE: generate your own - read: https://assault.cubers.net/docs/server.html\n"); + } + else + { + ssk = a; + } + } + break; case '-': if(!strncmp(arg, "--masterport=", 13)) {