Notes on password comparisons...
Posted on 8/20/2005 7:01 pm in This Old Site
I finally broke down and looked at the code for MySQL, particularly the
portion for creating MD5 hashes. Apparently, MySQl, takes the
result that was being used in the SASL code and converts it to an ASCII
representation of the result in hexadecimal notation. It was an
easy fix to checkpw.c to make it operate the same way. I've included the function where I made the changes. My notes are in bold. Code that we're not using anymore is in italics.
static int _sasl_make_plain_secret(const char *salt,
const char *passwd, size_t passlen,
sasl_secret_t **secret)
{
MD5_CTX ctx;
unsigned sec_len = 16 + 1 + 16; /* salt + "
