[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Weird stuff in MD5 crypt in PAM 0.66



I'm looking at the following snippet in md5_crypt.c:

======================================================================

        memset(final,0,sizeof final);

        /* Then something really weird... */
        for (j=0,i = strlen(pw); i ; i >>= 1)
                if(i&1)
                    MD5Update(&ctx, (unsigned const char *)final+j, 1);
                else
                    MD5Update(&ctx, (unsigned const char *)pw+j, 1);

======================================================================

I was not able to find some official spec for the MD5 CRYPT hash, so I was
trying to figure it out from the code.  Now, what's the deal with "j",
here?  It's being initialized to 0, but not incremented.  It almost seems
like there's a j++ missing at the trailing end of the for.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []