Re: [PATCH v3] wusb: switch to cbcmac transform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 16, 2019 at 08:52:32AM +0200, Ard Biesheuvel wrote:
> On Sun, 16 Jun 2019 at 03:20, Eric Biggers <ebiggers@xxxxxxxxxx> wrote:
> >
> > On Sat, Jun 15, 2019 at 11:17:45AM +0200, Ard Biesheuvel wrote:
> > > The wusb code takes a very peculiar approach at implementing CBC-MAC,
> > > by using plain CBC into a scratch buffer, and taking the output IV
> > > as the MAC.
> > >
> > > We can clean up this code substantially by switching to the cbcmac
> > > shash, as exposed by the CCM template. To ensure that the module is
> > > loaded on demand, add the cbcmac template name as a module alias.
> > >
> > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
> > > ---
> > > v3: - add missing #include to fix build error spotted by kbuild test robot
> > > v2: - use finup()/digest() where possible, and process b0+b1 using a single
> > >       call to update()
> > >     - make 'stv_hsmic_hs' static const and remove comment regarding GCC 4.1
> > >
> > > NOTE: I don't have any hardware to test this, but the built-in selftest
> > >       still passes.
> > >
> > >  crypto/ccm.c                  |   1 +
> > >  drivers/usb/wusbcore/crypto.c | 169 +++++---------------
> > >  2 files changed, 45 insertions(+), 125 deletions(-)
> > >
> >
> > drivers/usb/wusbcore/Kconfig also needs to be updated:
> >
> > diff --git a/drivers/usb/wusbcore/Kconfig b/drivers/usb/wusbcore/Kconfig
> > index 12e89189ca7d..2ec17d6af1f8 100644
> > --- a/drivers/usb/wusbcore/Kconfig
> > +++ b/drivers/usb/wusbcore/Kconfig
> > @@ -6,9 +6,7 @@ config USB_WUSB
> >         tristate "Enable Wireless USB extensions"
> >         depends on UWB
> >          select CRYPTO
> > -        select CRYPTO_BLKCIPHER
> > -        select CRYPTO_CBC
> > -        select CRYPTO_MANAGER
> 
> We'll need this one, as it isn't implied by any of the other ones, and
> cbcmac(aes) will be composed of the ccm template and the aes cipher on
> all architectures except arm64.
> 
> > +        select CRYPTO_CCM

Are you talking about CRYPTO_MANAGER?  One of my recent patches added
'select CRYPTO_MANAGER' to the templates that didn't already select it,
including CCM.  See in cryptodev.git:

	commit c8a3315a5f691cc4be16421aeb0608495c9a33ba
	Author: Eric Biggers <ebiggers@xxxxxxxxxx>
	Date:   Mon May 20 09:49:46 2019 -0700

	    crypto: make all templates select CRYPTO_MANAGER

So it shouldn't need to be selected here.

- Eric



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux