Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Christophe LEROY <christophe.leroy@c-s.fr>
Cc: linux-crypto@vger.kernel.org
Subject: Re: md5sum (from libkcapi) fails as splice() returns -ENOKEY
Date: Tue, 12 Sep 2017 09:20:41 +0200	[thread overview]
Message-ID: <5590856.XjYaqbyTry@tauon.chronox.de> (raw)
In-Reply-To: <85331bd3-b799-f4a1-d1da-085be723f5cb@c-s.fr>

Am Dienstag, 12. September 2017, 09:01:08 CEST schrieb Christophe LEROY:

Hi Christophe,

> Hi Stephan
> 
> Le 11/09/2017 à 21:17, Stephan Müller a écrit :
> > Am Montag, 11. September 2017, 19:07:31 CEST schrieb christophe leroy:
> > 
> > Hi christophe,
> > 
> >> Hello Stephan,
> >> 
> >> I'm trying to use md5sum from the latest libkcapi 0.14 and I getting a
> >> failure with return code -5.
> >> 
> >> What am I missing ? See strace below, splice() return -ENOKEY.
> > 
> > The ENOKEY error is due to an accept() at the wrong location. But I do not
> > see
> > that error:
> I did the test once more without the Talitos Crypto driver compiled in
> the kernel, and this time it works.
> I believe it must then be an issue with that driver.
> What could be the issue, what should I look for in the driver ?
> 

I think I see the error in talitos.c -- yet I do not have that hardware so I 
cannot create a patch and test.

In talitos_alg_alloc the function pointer setkey is set unconditional for 
CRYPTO_ALG_TYPE_AHASH. This is correct for HMAC/CMAC, but not correct for 
staight hashes. As both, md5 and hmac(md5) (and also for the SHA equivalents) 
are marked as CRYPTO_ALG_TYPE_AHASH in driver_algs, they all will get a setkey 
function.

This will trigger the following code in algif_hash:

static int hash_accept_parent(void *private, struct sock *sk)
{
        struct algif_hash_tfm *tfm = private;

        if (!tfm->has_key && crypto_ahash_has_setkey(tfm->hash))
                return -ENOKEY;

If the setkey would not be present for the straight hashes, ENOKEY would not 
be returned.

...

> 
> # autoreconf --version
> autoreconf (GNU Autoconf) 2.63

Thanks for the bug report. But I think the autoconf tools are not up to date. 
It should be 2.69.

Could you please check whether you can update?

I am thinking now to add AC_PREREQ([2.60]) to configure.ac.



Ciao
Stephan

  reply	other threads:[~2017-09-12  7:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 17:07 md5sum (from libkcapi) fails as splice() returns -ENOKEY christophe leroy
2017-09-11 19:17 ` Stephan Müller
2017-09-12  7:01   ` Christophe LEROY
2017-09-12  7:20     ` Stephan Mueller [this message]
2017-09-12  7:22       ` Stephan Mueller
2017-09-12  9:07         ` Christophe LEROY
2017-09-12  9:11           ` Stephan Mueller
2017-09-12  9:06       ` Christophe LEROY

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=5590856.XjYaqbyTry@tauon.chronox.de \
    --to=smueller@chronox.de \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-crypto@vger.kernel.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