util-linux (crypto patch)

util-linux (crypto patch)

Post by LAN Service Grou » Tue, 27 Jun 2000 04:00:00



Hi.  I was following the instructions for the Loopback Encrypted Filesystem
HOWTO at http://www.veryComputer.com/
into a bit of a problem.

The HOWTO explains that I must download and patch the kernel with
patch-int-2.2.16.x.  After doing that and recompiling my kernel it left me
another patch in linux/Documentation/crypto/util-linux-2.10m.int.patch which
I was to use against the util-linux-2.10m source tree.  That all went well.
I even had extra options durring 'make menuconfig' on my kernel for cipher
types and such.  I compiled all as modules.

Section 3, Step 10 it tells me to recompile util-linux after reading the
INSTALL and editing MCONFIG (ensuring not to overwrite any auth files like
login, passwd, etc.).  That's where I run into a problem.  When it's almost
done with the compilation it spews:

<snip>
make[1]: Entering directory `/home/kteague/temp/util-linux-2.10m/mount'
cc -c -Wall -Wstrict-prototypes -Wmissing-prototypes -I../lib -pipe -O2 -m48
6 -fomit-frame-pointer -DHAVE_NFS lomount.c
lomount.c:49: `LO_CRYPT_SERPENT' undeclared here (not in a function)
lomount.c:49: initializer element is not constant
lomount.c:49: (near initialization for `crypt_type_tbl[7].id')
lomount.c:50: `LO_CRYPT_MARS' undeclared here (not in a function)
lomount.c:50: initializer element is not constant
lomount.c:50: (near initialization for `crypt_type_tbl[8].id')
lomount.c:51: `LO_CRYPT_RC6' undeclared here (not in a function)
lomount.c:51: initializer element is not constant
lomount.c:51: (near initialization for `crypt_type_tbl[9].id')
lomount.c:52: `LO_CRYPT_DFC' undeclared here (not in a function)
lomount.c:52: initializer element is not constant
lomount.c:52: (near initialization for `crypt_type_tbl[10].id')
lomount.c: In function `set_loop':
lomount.c:255: `LO_CRYPT_SERPENT' undeclared (first use in this function)
lomount.c:255: (Each undeclared identifier is reported only once
lomount.c:255: for each function it appears in.)
lomount.c:256: `LO_CRYPT_MARS' undeclared (first use in this function)
lomount.c:257: `LO_CRYPT_RC6' undeclared (first use in this function)
lomount.c:258: `LO_CRYPT_DFC' undeclared (first use in this function)
make[1]: *** [lomount.o] Error 1
make[1]: Leaving directory `/home/kteague/temp/util-linux-2.10m/mount'
make: *** [all] Error 1
<snip>

Those errors seem to only include the cipher types included with the patch I
applied.  Cipher types that are already part of util-linux (e.g. DES, etc.)
are not in the error above so the problem seems to be with what was patched
in.  I looked in lomount.c, line 49 and found:

<snip>
#ifdef LOOP_SET_FD
struct crypt_type_struct {
        int id;
        char *name;

Quote:} crypt_type_tbl[] = {

        { LO_CRYPT_NONE, "no" },
        { LO_CRYPT_NONE, "none" },
        { LO_CRYPT_XOR, "xor" },
        { LO_CRYPT_DES, "DES" },
        { LO_CRYPT_FISH2, "twofish" },
        { LO_CRYPT_BLOW, "blowfish"},
        { LO_CRYPT_CAST128, "cast128"},
        { LO_CRYPT_SERPENT, "serpent"},
        { LO_CRYPT_MARS, "mars" },
        { LO_CRYPT_RC6, "rc6" },
        { LO_CRYPT_DFC, "dfc" },
        { LO_CRYPT_IDEA, "idea"},
        { -1, NULL   }
Quote:};

<snip>

Unfortunatly my knowledge of C on a scale of 1-10 (10 being best) ranks at
about... 1.  Please be nice to me. :-)

I've tried recompiling after modprobing the rc5, rc62, and serpent modules
but that didn't make a difference.  I would like to use rc6 but would also
like to have other cipher types available as well.  Also, other errors spew
in the same file on diff. lines but they're related to the errors I get
here.  I didn't think they'd be important so I didn't paste it above.  If I
left anything out please let me know.

One other thing that was confusing in the HOWTO was the modifications to
MCONFIG for util-linux.  The example shown in the HOWTO shows:

<snip>
HAVE_SHADOW=yes
HAVE_PASSWD=yes
<snip>

... whereas MCONFIG states:

<snip>
# If HAVE_SHADOW is set to "yes", then login, chfn, chsh, newgrp, passwd,
# and vipw will not be built or installed from the login-utils
# subdirectory.
HAVE_SHADOW=yes

# If HAVE_PASSWD is set to "yes", then passwd will not be built or
# installed from the login-utils subdirectory (but login, chfn, chsh,
# newgrp, and vipw *will* be installed).
HAVE_PASSWD=no
<snip>

Wouldn't setting both to =yes be contradicting given the explainations for
the config options?  I left mine with the defaults shown.

Other than that the HOWTO was pretty good... especially for being short.
The summary got me going fairly quick and there wasn't any coder
technogarble to confuse me. <whew> :-)  I'm pretty close to getting this to
work.  I was about to try SFS but they don't keep their patches up-to-date.
CFS is pretty limiting.  As I was about to try TCFS I ran across the
loopback encrypted filesystem HOWTO and found that it's kept up-to-date
pretty well.  I'm eager and e*d to get this going.  Hopefully it works
with Linux (md) RAID linear (append) without problems.  Thanks in advance
for any assistance provided.

<snip>
maximillion:~# uname -a ;gcc -v
Linux maximillion 2.2.16-raid #1 Sun Jun 25 11:06:02 PDT 2000 i686 unknown
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
<snip>


this newsgroup.  Thanks.

- Ken

 
 
 

1. util-linux + crypto patches SRPM (for Red Hat)

Hello all,

My attempt at a SRPM for util-linux + the crypto patches from kerneli.org
is here:

http://www.geocities.com/fullung/utillinux.zip

(rename to util-linux-2.10o-1.src.rpm; GeoCities is weird)

I tried to stick as close to the existing util-linux RPM as possible.

guy there.

I haven't had a chance to test the RPM yet, so be careful. I encourage other
people to modify the RPM for their distributions. This way, getting crypto
is as easy as installing a RPM (I'm not brave enough to kill util-linux and
replace it something I compiled without the benefit of rpm -ba :)) and then
applying the crypto patch and recompiling.


know that we really want him to make this RPM work.

Regards,

Albert

2. Drivers for ISA Madge card needed?

3. Problem compiling util-linux (with crypto) under Debian 2.2r4

4. problems with INN 1.4 on Linux -- bad file number

5. util-linux patch inside int'l kernel patch

6. Best X net apps

7. uClibC problems with Util-Linux

8. Help with Kernel Panic in RH 5.1 Install

9. Can't configure util-linux

10. util-linux and sysVinit - Question

11. Util-Linux utility file

12. util-linux 1.6 now available

13. Help: lost *bash* & *util-linux* - can't login at all!!