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  linux-cve-announce  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]
Message-ID: <CAMj1kXFen1nickdZab0s8iY7SgauoH56VginEoPdxaAAL2qENw@mail.gmail.com>
Date:   Thu, 2 Jul 2020 20:21:25 +0200
From:   Ard Biesheuvel <ardb@...nel.org>
To:     Eric Biggers <ebiggers@...nel.org>
Cc:     linux-wireless@...r.kernel.org,
        Marcel Holtmann <marcel@...tmann.org>,
        Denis Kenzior <denkenz@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Trond Myklebust <trond.myklebust@...merspace.com>,
        Anna Schumaker <anna.schumaker@...app.com>,
        "J. Bruce Fields" <bfields@...ldses.org>,
        Chuck Lever <chuck.lever@...cle.com>,
        Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
        netdev@...r.kernel.org, devel@...verdev.osuosl.org,
        linux-nfs@...r.kernel.org
Subject: Re: [RFC PATCH 4/7] crypto: remove ARC4 support from the skcipher API

On Thu, 2 Jul 2020 at 19:50, Eric Biggers <ebiggers@...nel.org> wrote:
>
> [+linux-wireless, Marcel Holtmann, and Denis Kenzior]
>
> On Thu, Jul 02, 2020 at 12:19:44PM +0200, Ard Biesheuvel wrote:
> > Remove the generic ecb(arc4) skcipher, which is slightly cumbersome from
> > a maintenance perspective, since it does not quite behave like other
> > skciphers do in terms of key vs IV lifetime. Since we are leaving the
> > library interface in place, which is used by the various WEP and TKIP
> > implementations we have in the tree, we can safely drop this code now
> > it no longer has any users.
> >
> > Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
>
> Last year there was a discussion where it was mentioned that iwd uses
> "ecb(arc4)" via AF_ALG.  So can we really remove it yet?
> See https://lkml.kernel.org/r/97BB95F6-4A4C-4984-9EAB-6069E19B4A4F@holtmann.org
> Note that the code isn't in "iwd" itself but rather in "libell" which iwd
> depends on: https://git.kernel.org/pub/scm/libs/ell/ell.git/
>
> Apparently it also uses md4 and ecb(des) too.
>

Ah yes, I remember now :-(

> Marcel and Denis, what's your deprecation plan for these obsolete and insecure
> algorithms?
>

Given Denis's statement:

  It sounds to me like it was broken and should be fixed.  So our vote /
  preference is to have ARC4 fixed to follow the proper semantics.  We
  can deal with the kernel behavioral change on our end easily enough;
  the required workarounds are the worse evil.

I would think that an ABI break is not the end of the world for them,
and given how trivial it is to implement RC4 in C, the workaround
should be to simply implement RC4 in user space, and not even bother
trying to use AF_ALG to get at ecb(arc4)

(same applies to md4 and ecb(des) btw)

There will always be a long tail of use cases, and at some point, we
just have to draw the line and remove obsolete and insecure cruft,
especially when it impedes progress on other fronts.



Full implementation of arc4 aka ecb(arc4) below.

void arc4_crypt(struct arc4_ctx *ctx, u8 *out, const u8 *in, unsigned int len)
{
  u32 *const S = ctx->S;
  u32 x, y, a, b;
  u32 ty, ta, tb;

  if (len == 0)
    return;

  x = ctx->x;
  y = ctx->y;

  a = S[x];
  y = (y + a) & 0xff;
  b = S[y];

  do {
    S[y] = a;
    a = (a + b) & 0xff;
    S[x] = b;
    x = (x + 1) & 0xff;
    ta = S[x];
    ty = (y + ta) & 0xff;
    tb = S[ty];
    *out++ = *in++ ^ S[a];
    if (--len == 0)
      break;
    y = ty;
    a = ta;
    b = tb;
  } while (true);

  ctx->x = x;
  ctx->y = y;
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ