All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: ".. ink .." <mhogomchungu@gmail.com>
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] luksFormat library API doesnt seem to work with large keyfiles.
Date: Tue, 17 Jan 2012 09:44:32 +0100	[thread overview]
Message-ID: <4F1534F0.7010900@redhat.com> (raw)
In-Reply-To: <CAFnMBaT12UmzJZ+wCUNmwa1XsgdjiYxfQc+Pkj6V3sW=rFqimg@mail.gmail.com>

On 01/17/2012 09:05 AM, .. ink .. wrote:
> using cryptsetup 1.4.1
>
> test case below.

(please also read examples in docs/examples)

> key1 keyfile is a  text file with 64 characters in it.
> key.cr <http://key.cr> is a 4.3MB mp3 file.

...
>      status = crypt_keyslot_add_by_volume_key( cd,CRYPT_ANY_SLOT,NULL,32,c,strlen( c ) );

I guess strlen(c) is wrong, it will stop on the first zero (mp3 is binary data, not C string).

What about use st.st_size here?

About limits - there is default/compiled one but you can always override
it through API, exactly as you did above.

(Also see cryptsetup --help - "Default compiled-in keyfile parameters", you have
to override keyfile size using --keyfile-size option if it is over compiled-in limit
in CLI command.)

Milan

  reply	other threads:[~2012-01-17  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17  8:05 [dm-crypt] luksFormat library API doesnt seem to work with large keyfiles .. ink ..
2012-01-17  8:44 ` Milan Broz [this message]
2012-01-18  3:15   ` .. ink ..

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F1534F0.7010900@redhat.com \
    --to=mbroz@redhat.com \
    --cc=dm-crypt@saout.de \
    --cc=mhogomchungu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.