Files
assaultcube-/.gitignore
T
ac-stef 381e770210 add authsetup command
authsetup contains all the funtionality needed to generate, load and save
private and public keys, and to lock and unlock the private key with a
password.

Private and public keys are used to authenticate the player to servers,
and are loaded from config/authprivate.cfg. Private keys can be stored
in an "encrypted with password" version - in which case the player has
to enter the password after game start. To prevent brute-force cracking
of the password, the key-derivation function uses a constant time to
encode (usually several seconds). Because of that, the decoding at game
start can be done in the background.

The private key is actually itself a public key generated from the
prepriv key. The prepriv key should be kept away from the computer, either
as hardcopy or on a thumbdrive. The prepriv key is not required to play
the game. It can be used to prove ownership of the private key, in case
the private key gets stolen. It can also be used to regenerate private
and public keys, in case they are lost. The prepriv key can also be
encrypted by its own password.

authsetup
  checks private and public key and returns "1", if they match.

authsetup pre preprivhex [psalthex pwdcfg]
  loads prepriv key into memory. optionally supports encrypted keys.

authsetup priv privhex [salthex pwdcfg]
  loads private key into memory. optionally supports encrypted keys.

authsetup pub pubhex
  loads public key into memory.

authsetup ppass preprivpass
  decrypts prepriv key with password

authsetup pass privpass
  decrypts private key with password

authsetup passd privpass [commandwhendone]
  decrypts private key with password in background. optionally executes
  cubescript command when done.

authsetup needpass
  returns "1" if the private key needs decryption.

authsetup genpre [prelen]
  generates new prepriv key.

authsetup genpriv
  generates private key from prepriv key.

authsetup genpub
  generates public key from private key.

authsetup newppass preprivpass [preprivfilename]
  encrypts prepriv key with new password and saves the result to file.
  The default filename is config/authpreprivate.cfg and an existing file
  gets overwritten - but the former file content is kept and also written,
  each line commented out.

authsetup newpass privpass [privatefilename]
  encrypts private key with new password and saves the encrypted private
  key and the public key to file. The default filename is
  config/authprivate.cfg and an existing file gets overwritten - but the
  former file content is kept and also written, each line commented out.

authsetup unarmed
  sets private and public keys to a fixed value. For testing only.
  Can be used to "log out".

authmemusage, authrounds, authmaxtime are only used, when new passwords are
  created (authsetup new[p]pass). authmemusage is the number of megabytes
  of RAM that are used for the password hash calculation. If authrounds
  is zero (as is default), then the hash algorithm calculates as many
  rounds as possible in the number of milliseconds specified in
  authmaxtime. If authrounds is a positive number, then that is the number
  of rounds to be done, regardless the required time. Note that, since the
  password hash algorithm is not endianness-aware, it is not possible to
  move an encrypted password to a machine with different endianness.
  Moving between 32- and 64-bit machines should be no problem.

  FIXME: the command is not blocked against use in multiplayer. It has to
         be determined later, if this is a problem or feature. Especially
         the background password calculation may be a problem.

DOCREF authsetup cryptodebug authmemusage authrounds authmaxtime
2016-08-26 14:28:54 +02:00

40 lines
823 B
Plaintext

.travis.yml
*.o
*.lo
shadows.dat
bin_unix/native_client
bin_unix/native_server
config/authpreprivate.cfg
config/authprivate.cfg
config/history
config/init.cfg
config/saved*.cfg
config/servers.cfg
config/configtemplates.zip
config/mapmodelattributes.cfg
config/entropy.dat
packages/maps/*.cfg
!packages/maps/new_content.cfg
packages/maps/*.cgz
!packages/maps/new_content.cgz
!packages/maps/dev_*.cgz
packages/misc/checksums_md5.txt
source/codeblocks/AssaultCube.layout
source/codeblocks/AssaultCube_Linux.layout
source/enet/.deps/
source/enet/.libs/
source/enet/Makefile
source/enet/config.log
source/enet/config.status
source/enet/libenet.la
source/enet/libenet.pc
source/enet/libtool
source/src/ac_client
source/src/ac_server
source/src/cube.h.gch
source/src/Makefile_local
clientlog*.txt
dumpmapconfig.txt
packetlog.txt