eternaltyro / cryptsetup

Since Google code is shuttering...
http://code.google.com/p/cryptsetup
GNU General Public License v2.0
0 stars 0 forks source link

Library and the binary do not agree on the cipher mode a truecrypt volume is created with #148

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reported
http://www.saout.de/pipermail/dm-crypt/2013-February/003178.html

crypt_init_by_name() seems to wrongly initialize TCRYPT context.

Reproducer attached.

Version 1.6.0.

Original issue reported on code.google.com by gmazyl...@gmail.com on 19 Feb 2013 at 11:28

Attachments:

GoogleCodeExporter commented 9 years ago
This in fact works as expected.

Note that CIPHER is cipher (or cipher chain in TCRYPT)
and mode is encryption mode (plus IV generator).

So if you want full cipher-mode specification, you have to use
get_cipher + get_mode.

Your modified example could look like this:

#include <libcryptsetup.h>
#include <stdio.h>
int main(int argc,char * argv[])
{
        struct crypt_device *cd;

        if (argc < 2 || crypt_init_by_name(&cd, argv[1]))
                return 1 ;

        printf("cipher: %s-%s\n", crypt_get_cipher(cd), crypt_get_cipher_mode(cd));

        crypt_free(cd);
        return 0 ;
}

Original comment by gmazyl...@gmail.com on 17 Mar 2013 at 6:49