md5 crypt and ncsa_auth
Martijn van Oosterhout
kleptog at svana.org
Wed Feb 26 19:14:06 EST 2003
On Wed, Feb 26, 2003 at 05:31:42PM +1100, Joel Pearson wrote:
> Hi,
>
>
>
> Does anyone know what sort of encryption/hashing RedHat 8 uses for the
> shadow password file? From what I could find it seems as though it would
> probably be md5 crypt.
Probably md5 yes.
> Now on the 2nd part of the question, how hard would it be to change the
> attached code ncsa_auth.c to support md5 crypt as opposed to just crypt?
> (assuming it is md5 crypt I'm looking for)
>
> I just want to be able to import passwords from the shadow password file for
> use with ncsa_auth.
>
> My knowledge of C is very limited, but it seems as though it probably would
> be a very simple change.
Did you try it? The stuff in the passwd file is by definition what is
supported by crypt. This line:
} else if (strcmp(u->passwd, (char *) crypt(passwd, u->passwd))) {
should work just the same for normal crypt as well as md5 crypt. See using
perl:
$ perl -e 'print crypt("flyy","dSFDHrYvVN2rI"),"\n"'
dSFDHrYvVN2rI
$ perl -e 'print crypt("flyy",q[$1$dkhDSe$Qt9W/3OZvczbCzqo1jwNN1] ),"\n"'
$1$dkhDSe$Qt9W/3OZvczbCzqo1jwNN1
Hope this helps,
--
Martijn van Oosterhout <kleptog at svana.org> http://svana.org/kleptog/
> Support bacteria! They're the only culture some people have.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20030226/1ba73272/attachment.bin
More information about the linux
mailing list