md5sum makes unaligned word accesses...
Rob Landley
rob at landley.net
Mon May 15 00:03:47 UTC 2006
On Friday 12 May 2006 7:49 pm, Andre wrote:
> --- Rob Landley <rob at landley.net> wrote:
> > On Friday 12 May 2006 4:56 am, Andre wrote:
> > > Allocating a bounce buffer in md5_hash_block() would be a
> > > solution if md5_hash_block() really needs to be public (it used
> > > to be static in 1.1.0 ??)
> >
> > My stalled passwd cleanup (too late to get it into 1.2.0) is
> > calling that and sha1sum directly. Then you can configure out
> > support for legacy crypt and don't need libcrypt at all.
>
> Any reason why your passwd cleanup can't use the higher level
> function md5_hash_bytes() ??
I grabbed whatever md5sum was doing. Been a while since I've worked on it,
lemme see...
} else if (ENABLE_FEATURE_MD5_PASS && salt[1]=='1') {
md5_ctx_t md5;
md5_begin(&md5);
md5_hash(clear, strlen(clear), &md5);
md5_hash(subsalt, subsaltlen, &md5);
md5_end(cipher+32, &sha1);
bb_encode64(cipher+32, cipher, 128);
}
> Instead of 3 functions to do almost the same thing, maybe it would be
> better to have a single function with no implicit restrictions on
> input buffer length (or alignment) ??
I just want an API I can call, without having a bloated implementation on
platforms where the processor can do an unaligned fetch when necessary.
> Andre
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list