diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-28 02:24:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-28 02:24:49 +0300 |
commit | 743d6dc3bd60dad0db53b19eacea333933d2f094 (patch) | |
tree | 35baa0c787456b6aeeadf4834ae7601194343501 /src/elogin/md5calc.c | |
parent | 7442c3c2874b16cb6f1180289b227ca23494b734 (diff) | |
download | evol-hercules-743d6dc3bd60dad0db53b19eacea333933d2f094.tar.gz evol-hercules-743d6dc3bd60dad0db53b19eacea333933d2f094.tar.bz2 evol-hercules-743d6dc3bd60dad0db53b19eacea333933d2f094.tar.xz evol-hercules-743d6dc3bd60dad0db53b19eacea333933d2f094.zip |
Fix formatting in md5calc.c
Diffstat (limited to 'src/elogin/md5calc.c')
-rw-r--r-- | src/elogin/md5calc.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/elogin/md5calc.c b/src/elogin/md5calc.c index bfa7b92..87c4a52 100644 --- a/src/elogin/md5calc.c +++ b/src/elogin/md5calc.c @@ -313,29 +313,29 @@ char *MD5_saltcrypt(const char *key, const char *salt) if (!salt) return 0; - char buf[66], *sbuf = buf+32; - static char obuf[33]; + char buf[66], *sbuf = buf+32; + static char obuf[33]; - // hash the key then the salt - // buf ends up as a 64char null terminated string - MD5_String(key, buf); - MD5_String(salt, sbuf); + // hash the key then the salt + // buf ends up as a 64char null terminated string + MD5_String(key, buf); + MD5_String(salt, sbuf); - // Hash the buffer back into sbuf - MD5_String(buf, sbuf); + // Hash the buffer back into sbuf + MD5_String(buf, sbuf); - snprintf(obuf, 32, "!%s$%s", salt, sbuf); - return(obuf); + snprintf(obuf, 32, "!%s$%s", salt, sbuf); + return(obuf); } char *make_salt(void) { - static char salt[6]; - int i; - for (i=0; i<5; i++) - salt[i] = (char)((mt_rand() % 78) + 48); - salt[5] = '\0'; - return(salt); + static char salt[6]; + int i; + for (i=0; i<5; i++) + salt[i] = (char)((mt_rand() % 78) + 48); + salt[5] = '\0'; + return(salt); } int pass_ok(const char *password, const char *crypted) @@ -343,9 +343,9 @@ int pass_ok(const char *password, const char *crypted) if (!password || !crypted) return 0; - char buf[40], *salt=buf+1; + char buf[40], *salt=buf+1; - strncpy(buf, crypted, 40); + strncpy(buf, crypted, 40); buf[39] = 0; char *ptr = strchr(buf, '$'); if (ptr) @@ -362,7 +362,7 @@ int pass_ok(const char *password, const char *crypted) // return(1); } - return(0); + return(0); } // [M|h]ashes up an IP address and a secret key |