qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] crypto: fix handling of iv generator hash defaults
Date: Wed, 1 Jun 2016 09:56:37 -0600	[thread overview]
Message-ID: <574F05B5.50105@redhat.com> (raw)
In-Reply-To: <1464796193-4656-1-git-send-email-berrange@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]

On 06/01/2016 09:49 AM, Daniel P. Berrange wrote:
> When opening an existing LUKS volume, if the iv generator is
> essiv, then the iv hash algorithm is mandatory to provide. We
> must report an error if it is omitted in the cipher mode spec,
> not silently default to hash 0 (md5).  If the iv generator is
> not essiv, then we explicitly ignore any iv hash algorithm,
> rather than report an error, for compatibility with dm-crypt.
> 
> When creating a new LUKS volume, if the iv generator is essiv
> and no iv hsah algorithm is provided, we should default to
> using the sha256 hash.
> 
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  crypto/block-luks.c        |  21 ++++
>  tests/qemu-iotests/149     |  12 +++
>  tests/qemu-iotests/149.out | 240 +++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 273 insertions(+)
> 

> @@ -904,6 +916,15 @@ qcrypto_block_luks_create(QCryptoBlock *block,
>      if (!luks_opts.has_hash_alg) {
>          luks_opts.hash_alg = QCRYPTO_HASH_ALG_SHA256;
>      }
> +    if (luks_opts.ivgen_alg == QCRYPTO_IVGEN_ALG_ESSIV) {
> +        if (!luks_opts.has_ivgen_hash_alg) {
> +            luks_opts.ivgen_hash_alg = QCRYPTO_HASH_ALG_SHA256;
> +            luks_opts.has_ivgen_hash_alg = true;
> +        }
> +    }
> +    /* Note we're allowing ivgen_has_alg to be set even for

s/has_/hash_/

Simple fix, so:
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

      reply	other threads:[~2016-06-01 15:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 15:49 [Qemu-devel] [PATCH] crypto: fix handling of iv generator hash defaults Daniel P. Berrange
2016-06-01 15:56 ` Eric Blake [this message]

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=574F05B5.50105@redhat.com \
    --to=eblake@redhat.com \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).