MCPcopy Create free account
hub / github.com/assaultcube/AC / passdeferred

Function passdeferred

source/src/crypto.cpp:732–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730static struct { uchar *salt, *priv; uint pwdcfg; } passdargs;
731
732static int passdeferred(void *pass) // decrypt the private key in the background
733{
734 uchar keyhash[32];
735 int iterations = passdargs.pwdcfg >> 10;
736 passphrase2key((char*)pass, passdargs.salt, 16, keyhash, 32, &iterations, 0, passdargs.pwdcfg & 0x3ff);
737 xor_block(passdargs.priv, keyhash, 32);
738 delstring((char *)pass);
739 extern void authsetup(char **args, int numargs);
740 authsetup(NULL, -1); // tell authsetup, that the passwd is done
741 return 0;
742}
743
744void savepreprivkey(const char *filename, uchar *preprivkey, uchar preprivlen, uchar *psalt, uint preprivpwdcfg) {
745 char hextemp[128 * 2 + 1];

Callers

nothing calls this directly

Calls 4

passphrase2keyFunction · 0.85
xor_blockFunction · 0.85
delstringFunction · 0.85
authsetupFunction · 0.85

Tested by

no test coverage detected