On Friday April 27 2007 11:25, Jan Dvořák wrote: > Robert Connolly wrote: > > I found a copy of shadow-961025. This version of Shadow had its own > > md5crypt.c, before it was in Glibc. It works, and it is very very similar > > to md5 from openssl and openssh. I just need to narrow down why openssl's > > is silently failing. > > What about looking into glibc-2.5/crypt/md5-crypt.c::__md5_crypt_r(), > beginning on line 98 there is quite readable the most important part of > it and I believe, if you played a while with __md5 => MD5_ you may > actually get working replacement.
In glibc-2.5/crypt/md5-crypt.c it does: __md5_init_ctx ctx __md5_process_bytes key __md5_process_bytes salt_prefix __md5_process_bytes salt __md5_init_ctx alt_ctx __md5_process_bytes key __md5_process_bytes salt __md5_process_bytes key __md5_finish_ctx In shadow-4.0.4.1/lib/md5crypt.c: MD5_Init ctx MD5_Update pw MD5_Update magic MD5_Update salt MD5_Init ctx MD5_Update pw MD5_Update salt MD5_Update pw MD5_Final key=password, and magic=salt_prefix. They both are doing the same thing. The two files are almost identical, except a little further down at b64_from_24bit / to64, they both do the same thing in a much more different way, and then glibc's adds a wrapper for md5_crypt. Thanks for checking. I think I'll need to add some printf's to md5crypt.c to try to find where its failing. robert
pgpHRcqEpetgI.pgp
Description: PGP signature
-- http://linuxfromscratch.org/mailman/listinfo/hlfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
