summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortedu <>2013-04-21 18:31:56 +0000
committertedu <>2013-04-21 18:31:56 +0000
commit258b97b5c9cb81b8843471618fbe6e840bf58698 (patch)
treedea7daca3bfeabfa90d4037def575f0f8e1d3a02 /src
parent22be8e36a0f7b5a8e4488bafa05e43e3c1fdedc2 (diff)
downloadopenbsd-258b97b5c9cb81b8843471618fbe6e840bf58698.tar.gz
openbsd-258b97b5c9cb81b8843471618fbe6e840bf58698.tar.bz2
openbsd-258b97b5c9cb81b8843471618fbe6e840bf58698.zip
tweak a few comments
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/crypt/md5crypt.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/libc/crypt/md5crypt.c b/src/lib/libc/crypt/md5crypt.c
index b32cd2115f..3b7884d5c9 100644
--- a/src/lib/libc/crypt/md5crypt.c
+++ b/src/lib/libc/crypt/md5crypt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: md5crypt.c,v 1.15 2009/10/31 13:29:07 sobrado Exp $ */ 1/* $OpenBSD: md5crypt.c,v 1.16 2013/04/21 18:31:56 tedu Exp $ */
2 2
3/* 3/*
4 * ---------------------------------------------------------------------------- 4 * ----------------------------------------------------------------------------
@@ -44,8 +44,8 @@ char *
44md5crypt(const char *pw, const char *salt) 44md5crypt(const char *pw, const char *salt)
45{ 45{
46 /* 46 /*
47 * This string is magic for this algorithm. Having 47 * This string is the magic for this algorithm.
48 * it this way, we can get get better later on 48 * Having it this way, we can get better later on.
49 */ 49 */
50 static unsigned char *magic = (unsigned char *)"$1$"; 50 static unsigned char *magic = (unsigned char *)"$1$";
51 51
@@ -56,7 +56,7 @@ md5crypt(const char *pw, const char *salt)
56 MD5_CTX ctx,ctx1; 56 MD5_CTX ctx,ctx1;
57 u_int32_t l; 57 u_int32_t l;
58 58
59 /* Refine the Salt first */ 59 /* Refine the salt first */
60 sp = (const unsigned char *)salt; 60 sp = (const unsigned char *)salt;
61 61
62 /* If it starts with the magic string, then skip that */ 62 /* If it starts with the magic string, then skip that */
@@ -107,9 +107,11 @@ md5crypt(const char *pw, const char *salt)
107 MD5Final(final,&ctx); 107 MD5Final(final,&ctx);
108 108
109 /* 109 /*
110 * and now, just to make sure things don't run too fast 110 * And now, just to make sure things don't run too fast
111 * On a 60 MHz Pentium this takes 34 msec, so you would 111 * On a 60 MHz Pentium this takes 34 msec, so you would
112 * need 30 seconds to build a 1000 entry dictionary... 112 * need 30 seconds to build a 1000 entry dictionary...
113 * On a modern machine, with possible GPU optimization,
114 * this will run a lot faster than that.
113 */ 115 */
114 for(i=0;i<1000;i++) { 116 for(i=0;i<1000;i++) {
115 MD5Init(&ctx1); 117 MD5Init(&ctx1);