2002-10-11 03:46:06

by Steven French

[permalink] [raw]
Subject: Re: MD4 and MD5 library routines (was CIFS filesystem for Linux 2.5_


>> [email protected] said:
>> > fs/cifs/md4.c | 209 +++
>> > fs/cifs/md5.c | 363 +++++
>> > fs/cifs/md5.h | 38
>>
>> Unless these are somehow CIFS-specific, they should live in linux/lib/
>
>This would have the disadvantage that they would need to be always
compiled into the
>kernel, even though it may not need it. And we already have code bloat
problems,
>no need to make it worse.
>
>Making them modular also isn't good. Each module takes a 4k page at least,
so you
>would waste a lot of memory because they're smaller than 4k.
>
>As long as they are not used by anything else it's probably best to keep
it
>where they are.
>
>-Andi

The routines are small enough, less than 500 loc total, that it would not
make a whole lot of difference either way. Although I noticed a few
different places where MD5 is implemented in other parts of the kernel, the
HMAC-MD5 support (in md5.c) needed for signing smb frames is probably not
needed by anyone else (except PPP?). I did not see any places (other than
cifs) that depend on md4 so that seems like it would not make sense to move
even though the code is pretty generic. The ASN decoding routines on the
other hand (used e.g. by snmp and also will be needed in the future by the
cifs vfs for simple SPNEGO-like parsing of the session establishment frame)
might end up being useful to move into a common library in the long run.

Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: [email protected]