lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Jun 2007 13:00:34 +0200
From:	Karsten Hopp <karsten@...hat.com>
To:	Theodore Tso <tytso@....edu>
CC:	linux-ext4@...r.kernel.org
Subject: Re: Patch to support LUKS UUIDs in libblkid

Theodore Tso schrieb:
> On Mon, Jun 11, 2007 at 01:51:24PM +0200, Karsten Hopp wrote:
>> +static int probe_luks(struct blkid_probe *probe,
>> +		       struct blkid_magic *id __BLKID_ATTR((unused)), 
>> +		       unsigned char *buf)
>> +{
>> +	unsigned char *p_buf = buf;
>> +	unsigned char uuid[40];
>> +	/* 168 is the offset to the 40 character uuid: 
>> +	 * http://luks.endorphin.org/LUKS-on-disk-format.pdf */
>> +	p_buf += 168;
>> +	strncpy(uuid, p_buf, 40);
> 
> Why bother with p_buf?  It would actually be shorter and sweeter to
> do:
> 
> 	strncpy(uuid, buf+168, 40);
> 
> And remove the lines dealing with p_buf above.
> 
>> +  { "crypt_LUKS",0,	 0,  6,	"LUKS\xba\xbe",		probe_luks },
> 
> Any particular reason to use "crypt_LUKS" instead of just "LUKS"?  In
> your documentation you generally just refer to it as LUKS.
> 
> 					- Ted

I've used 'luks' in my first patch, but changed it to 'crypt_LUKS' when
Karel Zak pointed out that libvolume_id from udev already uses 'crypt_LUKS'
for this.
My first patch also did some other (unnecessary) stuff with p_buf and I just
didn't bother to remove it.
I'll attach a new patch without p_buf.

    Karsten

--
  Karsten Hopp        | Mail: karsten@...hat.de
  Red Hat Deutschland | Tel: +49-711-96437-0
  Hauptstaetterstr.58 | Fax: +49-711-613590
  D-70178 Stuttgart   | http://www.redhat.de

View attachment "e2fsprogs-1.39-luks.patch" of type "text/x-patch" (1574 bytes)

Powered by blists - more mailing lists