]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - crypto.c
optimized vm by using cached local variables instead of accessing prog->
[xonotic/darkplaces.git] / crypto.c
index 85c1caac1775844b53dc1acd9fa99fc47681be7c..cf7cc5f2f1a959b151f4cb3c63b09ec4826f90eb 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -13,7 +13,7 @@ cvar_t crypto_servercpumaxtime = {CVAR_SAVE, "crypto_servercpumaxtime", "0.01",
 cvar_t crypto_servercpudebug = {CVAR_SAVE, "crypto_servercpudebug", "0", "print statistics about time usage by crypto"};
 static double crypto_servercpu_accumulator = 0;
 static double crypto_servercpu_lastrealtime = 0;
-cvar_t crypto_aeslevel = {CVAR_SAVE, "crypto_aeslevel", "1", "whether to support AES encryption in authenticated connections (0 = no, 1 = supported, 2 = requested, 3 = required); changing this may require crypto_reload to fully apply"};
+cvar_t crypto_aeslevel = {CVAR_SAVE, "crypto_aeslevel", "1", "whether to support AES encryption in authenticated connections (0 = no, 1 = supported, 2 = requested, 3 = required)"};
 int crypto_keyfp_recommended_length;
 static const char *crypto_idstring = NULL;
 static char crypto_idstring_buf[512];
@@ -545,7 +545,7 @@ qboolean Crypto_ServerFinishInstance(crypto_t *out, crypto_t *crypto)
        }
        CLEAR_CDATA;
        memcpy(out, crypto, sizeof(*out));
-       memset(crypto, 0, sizeof(crypto));
+       memset(crypto, 0, sizeof(*crypto));
        return true;
 }
 
@@ -1040,7 +1040,7 @@ void Crypto_Init(void)
                return;
        }
 
-       Crypto_Rijndael_OpenLibrary(); // if this fails, it's uncritical
+       (void) Crypto_Rijndael_OpenLibrary(); // if this fails, it's uncritical
 
        Crypto_InitHostKeys();
 }
@@ -2158,7 +2158,7 @@ int Crypto_ClientParsePacket(const char *data_in, size_t len_in, char *data_out,
                int clientid = -1, serverid = -1, wantserverid = -1;
                qboolean server_can_auth = true;
                char wantserver_idfp[FP64_SIZE+1];
-               int wantserver_aeslevel;
+               int wantserver_aeslevel = 0;
 
                // if we have a stored host key for the server, assume serverid to already be selected!
                // (the loop will refuse to overwrite this one then)