Bug #270

des should stop talking about sun_hardware

Added by Rich Lowe over 8 years ago. Updated over 8 years ago.

Status:NewStart date:2010-09-27
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Difficulty: Tags:

Description

des (all 3 implementations, we seem to have...) do really scary things, like source:usr/src/uts/common/des/des_crypt.c@13196#L62

static int g_desfd = -1;
#define    getdesfd()    (cdevsw[11].d_open(0, 0) ? -1 : 0)
#define    ioctl(a, b, c)    (cdevsw[11].d_ioctl(0, b, c, 0) ? -1 : 0)

Luckily, they only do this under an #ifdef _KERNEL built only in userland, or #ifdef sun_hardware which, as best as I can tell, must have been a hardware DES implementation with a driver (at /dev/des) with a (static) major number of 11, which speaks to the age such a device must now have (as does the reference to cdevsw!)

After a little more checking to be certain this horror really is dead code, it should be removed.

Even better (perhaps as a separate bug), would be removing one of the implementations in userland, and making the code common. (better still, making the common bits of all 3 common, in src/common).

- source:usr/src/lib/libcrypt/common/des.c
- source:usr/src/lib/libnsl/des/des_crypt.c
- source:usr/src/uts/common/des/des_crypt.c

History

#1 Updated by Jason King over 8 years ago

Doing a very cursory glance, for the 2nd part any reason for the first two that libpkcs11 couldn't be used instead?

Also available in: Atom