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] [day] [month] [year] [list]
Message-ID: <CAJKOXPcpdUtvnH45DPoK8vpDo_1ZkUU9y0RGg67S--8HSkoAXQ@mail.gmail.com>
Date:   Tue, 19 Feb 2019 13:02:08 +0100
From:   Krzysztof Kozlowski <krzk@...nel.org>
To:     Kamil Konieczny <k.konieczny@...tner.samsung.com>
Cc:     Vladimir Zapolskiy <vz@...ia.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Biggers <ebiggers@...nel.org>,
        linux-crypto@...r.kernel.org,
        "linux-samsung-soc@...r.kernel.org" 
        <linux-samsung-soc@...r.kernel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: s5p: update iv after AES op end

On Mon, 18 Feb 2019 at 17:01, Kamil Konieczny
<k.konieczny@...tner.samsung.com> wrote:
>
> Fix bug "s5p-sss crypto driver doesn't set next AES-CBC IV". This should
> also fix AES-CTR mode. Tested on Odroid U3 with Eric Biggers branch
> "iv-out-testing".
>
> Signed-off-by: Kamil Konieczny <k.konieczny@...tner.samsung.com>
> ---
>  drivers/crypto/s5p-sss.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
> index 0064be0e3941..3ea058addad3 100644
> --- a/drivers/crypto/s5p-sss.c
> +++ b/drivers/crypto/s5p-sss.c
> @@ -463,6 +463,9 @@ static void s5p_sg_copy_buf(void *buf, struct scatterlist *sg,
>
>  static void s5p_sg_done(struct s5p_aes_dev *dev)
>  {
> +       struct ablkcipher_request *req = dev->req;
> +       struct s5p_aes_reqctx *reqctx = ablkcipher_request_ctx(req);
> +
>         if (dev->sg_dst_cpy) {
>                 dev_dbg(dev->dev,
>                         "Copying %d bytes of output data back to original place\n",
> @@ -472,6 +475,11 @@ static void s5p_sg_done(struct s5p_aes_dev *dev)
>         }
>         s5p_free_sg_cpy(dev, &dev->sg_src_cpy);
>         s5p_free_sg_cpy(dev, &dev->sg_dst_cpy);
> +       if (reqctx->mode & FLAGS_AES_CBC)
> +               memcpy_fromio(req->info, dev->aes_ioaddr + SSS_REG_AES_IV_DATA(0), 0x10);
> +

0x10 -> AES_BLOCK_SIZE

> +       if (reqctx->mode & FLAGS_AES_CTR)

if -> else if

Beside that looks good.

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ